531
V = case lists:keysearch(Key, 1, Options) of
532
{value, {format_fun, U=undefined}} ->
534
{value, {info_fun, U=undefined}} ->
536
{value, {lookup_fun, U=undefined}} ->
538
{value, {parent_fun, U=undefined}} ->
540
{value, {post_fun, U=undefined}} ->
542
{value, {pre_fun, U=undefined}} ->
544
{value, {info_fun, Fun}} when is_function(Fun),
545
is_function(Fun, 1) ->
547
{value, {pre_fun, Fun}} when is_function(Fun),
548
is_function(Fun, 1) ->
550
{value, {post_fun, Fun}} when is_function(Fun),
551
is_function(Fun, 0) ->
553
{value, {lookup_fun, Fun}} when is_function(Fun),
554
is_function(Fun, 2) ->
556
{value, {max_lookup, Max}} when is_integer(Max), Max >= 0 ->
531
V = case lists:keyfind(Key, 1, Options) of
532
{format_fun, U=undefined} ->
534
{info_fun, U=undefined} ->
536
{lookup_fun, U=undefined} ->
538
{parent_fun, U=undefined} ->
540
{post_fun, U=undefined} ->
542
{pre_fun, U=undefined} ->
544
{info_fun, Fun} when is_function(Fun), is_function(Fun, 1) ->
546
{pre_fun, Fun} when is_function(Fun), is_function(Fun, 1) ->
548
{post_fun, Fun} when is_function(Fun), is_function(Fun, 0) ->
550
{lookup_fun, Fun} when is_function(Fun), is_function(Fun, 2) ->
552
{max_lookup, Max} when is_integer(Max), Max >= 0 ->
558
{value, {max_lookup, infinity}} ->
554
{max_lookup, infinity} ->
560
{value, {format_fun, Fun}} when is_function(Fun),
561
is_function(Fun, 1) ->
563
{value, {parent_fun, Fun}} when is_function(Fun),
564
is_function(Fun, 0) ->
566
{value, {key_equality, KE='=='}}->
568
{value, {key_equality, KE='=:='}}->
570
{value, {join, J=any}} ->
572
{value, {join, J=nested_loop}} ->
574
{value, {join, J=merge}} ->
576
{value, {join, J=lookup}} ->
578
{value, {lookup, LookUp}} when LookUp;
556
{format_fun, Fun} when is_function(Fun), is_function(Fun, 1) ->
558
{parent_fun, Fun} when is_function(Fun), is_function(Fun, 0) ->
560
{key_equality, KE='=='} ->
562
{key_equality, KE='=:='} ->
566
{join, J=nested_loop} ->
572
{lookup, LookUp} when is_boolean(LookUp); LookUp =:= any ->
582
{value, {max_list_size, Max}} when is_integer(Max), Max >= 0 ->
574
{max_list_size, Max} when is_integer(Max), Max >= 0 ->
584
{value, {tmpdir_usage, TmpUsage}} when TmpUsage =:= allowed;
585
TmpUsage =:= not_allowed;
586
TmpUsage =:= info_msg;
587
TmpUsage =:= warning_msg;
588
TmpUsage =:= error_msg ->
576
{tmpdir_usage, TmpUsage} when TmpUsage =:= allowed;
577
TmpUsage =:= not_allowed;
578
TmpUsage =:= info_msg;
579
TmpUsage =:= warning_msg;
580
TmpUsage =:= error_msg ->
590
{value, {unique, Unique}} when Unique; not Unique ->
582
{unique, Unique} when is_boolean(Unique) ->
592
{value, {cache, Cache}} when Cache; not Cache; Cache =:= list ->
584
{cache, Cache} when is_boolean(Cache); Cache =:= list ->
594
{value, {cache, ets}} ->
596
{value, {cache, no}} ->
598
{value, {unique_all, UniqueAll}} when UniqueAll; not UniqueAll ->
590
{unique_all, UniqueAll} when is_boolean(UniqueAll) ->
600
{value, {cache_all, CacheAll}} when CacheAll;
592
{cache_all, CacheAll} when is_boolean(CacheAll);
604
{value, {cache_all, ets}} ->
606
{value, {cache_all, no}} ->
608
{value, {spawn_options, default}} ->
599
{spawn_options, default} ->
610
{value, {spawn_options, SpawnOptions}} ->
601
{spawn_options, SpawnOptions} ->
611
602
case is_proper_list(SpawnOptions) of
613
604
{ok, SpawnOptions};
617
{value, {flat, Flat}} when Flat; not Flat ->
608
{flat, Flat} when is_boolean(Flat) ->
619
{value, {format, Format}} when Format =:= string;
620
Format =:= abstract_code;
610
{format, Format} when Format =:= string;
611
Format =:= abstract_code;
623
{value, {n_elements, NElements}} when NElements =:= infinity;
624
is_integer(NElements),
614
{n_elements, NElements} when NElements =:= infinity;
615
is_integer(NElements),
627
{value, {depth, Depth}} when Depth =:= infinity;
628
is_integer(Depth), Depth >= 0 ->
618
{depth, Depth} when Depth =:= infinity;
619
is_integer(Depth), Depth >= 0 ->
630
{value, {order, Order}} when is_function(Order),
631
is_function(Order, 2);
632
(Order =:= ascending);
633
(Order =:= descending) ->
621
{order, Order} when is_function(Order), is_function(Order, 2);
622
(Order =:= ascending);
623
(Order =:= descending) ->
635
{value, {compressed, Comp}} when Comp ->
625
{compressed, Comp} when Comp ->
636
626
{ok, [compressed]};
637
{value, {compressed, Comp}} when not Comp ->
627
{compressed, Comp} when not Comp ->
639
{value, {tmpdir, T}} ->
641
{value, {size, Size}} when is_integer(Size), Size > 0 ->
631
{size, Size} when is_integer(Size), Size > 0 ->
643
{value, {no_files, NoFiles}} when is_integer(NoFiles),
633
{no_files, NoFiles} when is_integer(NoFiles), NoFiles > 1 ->
649
638
Default = default_option(Key),