diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..412eeda --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ebd21a --- /dev/null +++ b/.gitignore @@ -0,0 +1,163 @@ +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Rr]elease/ +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.vspscc +.builds +*.dotCover + +## TODO: If you have NuGet Package Restore enabled, uncomment this +#packages/ + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf + +# Visual Studio profiler +*.psess +*.vsp + +# ReSharper is a .NET coding add-in +_ReSharper* + +# Installshield output folder +[Ee]xpress + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish + +# Others +[Bb]in +[Oo]bj +sql +TestResults +*.Cache +ClientBin +stylecop.* +~$* +*.dbmdl +Generated_Code #added for RIA/Silverlight projects + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML + + + +############ +## Windows +############ + +# Windows image file caches +Thumbs.db + +# Folder config file +Desktop.ini + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg + +# Mac crap +.DS_Store diff --git a/lib/eradius/priv/dictionaries/dictionary.versanet b/lib/eradius/priv/dictionaries/dictionary.versanet index cd6a091..1b8641c 100644 --- a/lib/eradius/priv/dictionaries/dictionary.versanet +++ b/lib/eradius/priv/dictionaries/dictionary.versanet @@ -1,50 +1,50 @@ -# -# dictionary.versanet Vendor specfic attributes for versanet -# -# -# VersaNet Communications, Inc. -# Http://www.versa-net.com -# -# -#Versanet add Vendor specific terminal cause in our radius group. -#You can follow this to set it in NAS box. -# -# >> gr radius -# >> sh -# >> set 34 23 -# >> co -# -#This will let our unit transfer every detail terminal cause -#information to Redius server's accounting log file and -#save as "Vendor Specific=Terminate Cause". -# -# Version: @(#)dictionary.versanet 1.00 22-Jul-1999 support@versanetcomm.com -# - -VENDOR Versanet 2180 - -ATTRIBUTE Versanet-Termination-Cause 1 integer Versanet - -VALUE Versanet-Termination-Cause Normal-Hangup-No-Error-Occurred 0 -VALUE Versanet-Termination-Cause Call-Waiting-Caused-Disconnect 3 -VALUE Versanet-Termination-Cause Physical-Carrier-Loss 4 -VALUE Versanet-Termination-Cause No-err-correction-at-other-end 5 -VALUE Versanet-Termination-Cause No-resp-to-feature-negotiation 6 -VALUE Versanet-Termination-Cause 1st-modem-async-only-2nd-sync 7 -VALUE Versanet-Termination-Cause No-framing-technique-in-common 8 -VALUE Versanet-Termination-Cause No-protocol-in-common 9 -VALUE Versanet-Termination-Cause Bad-resp-to-feature-negotiation 10 -VALUE Versanet-Termination-Cause No-sync-info-from-remote-modem 11 -VALUE Versanet-Termination-Cause Normal-Hangup-by-Remote-modem 12 -VALUE Versanet-Termination-Cause Retransmission-limit-reached 13 -VALUE Versanet-Termination-Cause Protocol-violation-occurred 14 -VALUE Versanet-Termination-Cause Lost-DTR 15 -VALUE Versanet-Termination-Cause Received-GSTN-cleardown 16 -VALUE Versanet-Termination-Cause Inactivity-timeout 17 -VALUE Versanet-Termination-Cause Speed-not-supported 18 -VALUE Versanet-Termination-Cause Long-space-disconnect 19 -VALUE Versanet-Termination-Cause Key-abort-disconnect 20 -VALUE Versanet-Termination-Cause Clears-previous-disc-reason 21 -VALUE Versanet-Termination-Cause No-connection-established 22 -VALUE Versanet-Termination-Cause Disconnect-after-three-retrains 23 - +# +# dictionary.versanet Vendor specfic attributes for versanet +# +# +# VersaNet Communications, Inc. +# Http://www.versa-net.com +# +# +#Versanet add Vendor specific terminal cause in our radius group. +#You can follow this to set it in NAS box. +# +# >> gr radius +# >> sh +# >> set 34 23 +# >> co +# +#This will let our unit transfer every detail terminal cause +#information to Redius server's accounting log file and +#save as "Vendor Specific=Terminate Cause". +# +# Version: @(#)dictionary.versanet 1.00 22-Jul-1999 support@versanetcomm.com +# + +VENDOR Versanet 2180 + +ATTRIBUTE Versanet-Termination-Cause 1 integer Versanet + +VALUE Versanet-Termination-Cause Normal-Hangup-No-Error-Occurred 0 +VALUE Versanet-Termination-Cause Call-Waiting-Caused-Disconnect 3 +VALUE Versanet-Termination-Cause Physical-Carrier-Loss 4 +VALUE Versanet-Termination-Cause No-err-correction-at-other-end 5 +VALUE Versanet-Termination-Cause No-resp-to-feature-negotiation 6 +VALUE Versanet-Termination-Cause 1st-modem-async-only-2nd-sync 7 +VALUE Versanet-Termination-Cause No-framing-technique-in-common 8 +VALUE Versanet-Termination-Cause No-protocol-in-common 9 +VALUE Versanet-Termination-Cause Bad-resp-to-feature-negotiation 10 +VALUE Versanet-Termination-Cause No-sync-info-from-remote-modem 11 +VALUE Versanet-Termination-Cause Normal-Hangup-by-Remote-modem 12 +VALUE Versanet-Termination-Cause Retransmission-limit-reached 13 +VALUE Versanet-Termination-Cause Protocol-violation-occurred 14 +VALUE Versanet-Termination-Cause Lost-DTR 15 +VALUE Versanet-Termination-Cause Received-GSTN-cleardown 16 +VALUE Versanet-Termination-Cause Inactivity-timeout 17 +VALUE Versanet-Termination-Cause Speed-not-supported 18 +VALUE Versanet-Termination-Cause Long-space-disconnect 19 +VALUE Versanet-Termination-Cause Key-abort-disconnect 20 +VALUE Versanet-Termination-Cause Clears-previous-disc-reason 21 +VALUE Versanet-Termination-Cause No-connection-established 22 +VALUE Versanet-Termination-Cause Disconnect-after-three-retrains 23 + diff --git a/lib/gen_leader/src/gen_leader.erl b/lib/gen_leader/src/gen_leader.erl index a8969e6..832b56f 100644 --- a/lib/gen_leader/src/gen_leader.erl +++ b/lib/gen_leader/src/gen_leader.erl @@ -1,1139 +1,1139 @@ -%%% ``The 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 Hans Svensson -%%% @author Thomas Arts -%%% @author Ulf Wiger -%%% -%%% @doc Leader election behavior. -%%%

This application implements a leader election behavior modeled after -%%% gen_server. This behavior intends to make it reasonably -%%% straightforward to implement a fully distributed server with -%%% master-slave semantics.

-%%%

The gen_leader behavior supports nearly everything that gen_server -%%% does (some functions, such as multicall() and the internal timeout, -%%% have been removed), and adds a few callbacks and API functions to -%%% support leader election etc.

-%%%

Also included is an example program, a global dictionary, based -%%% on the modules gen_leader and dict. The callback implementing the -%%% global dictionary is called 'test_cb', for no particularly logical -%%% reason.

-%%%

New version: The internal leader election algorithm was faulty -%%% and has been replaced with a new version based on a different leader -%%% election algorithm. As a consequence of this the query functions -%%% alive and down can no longer be provided. -%%% The new algorithm also make use of an incarnation parameter, by -%%% default written to disk in the function incarnation. This -%%% implies that only one gen_leader per node is permitted, if -%%% used in a diskless environment, incarnation must be adapted. -%%%

-%%% @end -%%% -%%% @type election() = tuple(). Opaque state of the gen_leader behaviour. -%%% @type node() = atom(). A node name. -%%% @type name() = atom(). A locally registered name. -%%% @type serverRef() = Name | {name(),node()} | {global,Name} | pid(). -%%% See gen_server. -%%% @type callerRef() = {pid(), reference()}. See gen_server. -%%% --module(gen_leader). - -% Time between rounds of query from the leader --define(TAU,250). - -% Exports for quickcheck -%-export([safe_loop/4,loop/4]). - --export([start/6, - start_link/6, - leader_call/2, leader_call/3, leader_cast/2, - call/2, call/3, cast/2, - reply/2]). - -%% Query functions --export([%% alive/1, - %% down/1, - candidates/1, - workers/1]). - --export([ - system_continue/3, - system_terminate/4, - system_code_change/4, - format_status/2 - ]). - --export([behaviour_info/1]). - -%% Internal exports --export([init_it/6, print_event/3 - %%, safe_send/2 - ]). - --import(error_logger , [format/2]). --import(lists, [foldl/3, - foreach/2, - member/2, - keydelete/3, - keysearch/3]). - -% Include for QuickCheck -% -include("eqc.hrl"). - --record(election,{leader = none, - name, - leadernode = none, - candidate_nodes = [], - worker_nodes = [], - alive = [], - down = [], - monitored = [], - buffered = [], - status, - elid, - acks = [], - work_down = [], - pendack, - incarn, - nextel - }). - --record(server, {parent, - mod, - state, - debug}). - - -%%% --------------------------------------------------- -%%% Interface functions. -%%% --------------------------------------------------- - -%% @hidden -behaviour_info(callbacks) -> - [{init,1}, - {elected,2}, - {surrendered,3}, - {handle_leader_call,4}, - {handle_leader_cast,3}, - {from_leader,3}, - {handle_call,3}, - {handle_cast,2}, - {handle_DOWN,3}, - {handle_info,2}, - {terminate,2}, - {code_change,4}]; -behaviour_info(_Other) -> - undefined. - -%% @spec start(Name::node(), CandidateNodes::[node()], -%% Workers::[node()], Mod::atom(), Arg, Options::list()) -> -%% {ok,pid()} -%% -%% @doc Starts a gen_leader process without linking to the parent. -%% -start(Name, CandidateNodes, Workers, Mod, Arg, Options) when is_atom(Name) -> - gen:start(?MODULE, nolink, {local,Name}, - Mod, {CandidateNodes, Workers, Arg}, Options). - -%% @spec start_link(Name::atom(), CandidateNodes::[atom()], -%% Workers::[atom()], Mod::atom(), Arg, Options::list()) -> -%% {ok, pid()} -%% -%% @doc Starts a gen_leader process. -%% -%% -%% -%% -%% -%% -%% -%% -%%
NameThe locally registered name of the process
CandidateNodesThe names of nodes capable of assuming -%% a leadership role
WorkersThe names of nodes that will be part of the "cluster", -%% but cannot ever assume a leadership role.
ModThe name of the callback module
ArgArgument passed on to Mod:init/1
OptionsSame as gen_server's Options
-%% -%%

The list of candidates needs to be known from the start. Workers -%% can be added at runtime.

-%% @end -start_link(Name, CandidateNodes, Workers, - Mod, Arg, Options) when is_atom(Name) -> - % Random delay for QuickCheck - % timer:sleep(random:uniform(400)), - gen:start(?MODULE, link, {local,Name}, Mod, - {CandidateNodes, Workers, Arg}, Options). - - -%% Query functions to be used from the callback module - -%% alive(#election{alive = Alive}) -> -%% Alive. - -%% down(#election{down = Down}) -> -%% Down. - -%% @spec candidates(E::election()) -> [node()] -%% -%% @doc Returns a list of known candidates. -%% -candidates(#election{candidate_nodes = Cands}) -> - Cands. - -%% @spec workers(E::election()) -> [node()] -%% -%% @doc Returns a list of known workers. -%% -workers(#election{worker_nodes = Workers}) -> - Workers. - -% -% Make a call to a generic server. -% If the server is located at another node, that node will -% be monitored. -% If the client is trapping exits and is linked server termination -% is handled here (? Shall we do that here (or rely on timeouts) ?). -% -%% @spec call(Name::serverRef(), Request) -> term() -%% -%% @doc Equivalent to gen_server:call/2, but with a slightly -%% different exit reason if something goes wrong. This function calls -%% the gen_leader process exactly as if it were a gen_server -%% (which, for practical purposes, it is.) -%% @end -call(Name, Request) -> - case catch gen:call(Name, '$gen_call', Request) of - {ok,Res} -> - Res; - {'EXIT',Reason} -> - exit({Reason, {?MODULE, local_call, [Name, Request]}}) - end. - -%% @spec call(Name::serverRef(), Request, Timeout::integer()) -> -%% Reply -%% -%% Reply = term() -%% -%% @doc Equivalent to gen_server:call/3, but with a slightly -%% different exit reason if something goes wrong. This function calls -%% the gen_leader process exactly as if it were a gen_server -%% (which, for practical purposes, it is.) -%% @end -call(Name, Request, Timeout) -> - case catch gen:call(Name, '$gen_call', Request, Timeout) of - {ok,Res} -> - Res; - {'EXIT',Reason} -> - exit({Reason, {?MODULE, local_call, [Name, Request, Timeout]}}) - end. - -%% @spec leader_call(Name::name(), Request::term()) -%% -> Reply -%% -%% Reply = term() -%% -%% @doc Makes a call (similar to gen_server:call/2) to the -%% leader. The call is forwarded via the local gen_leader instance, if -%% that one isn't actually the leader. The client will exit if the -%% leader dies while the request is outstanding. -%%

This function uses gen:call/3, and is subject to the -%% same default timeout as e.g. gen_server:call/2.

-%% @end -%% -leader_call(Name, Request) -> - case catch gen:call(Name, '$leader_call', Request) of - {ok,{leader,reply,Res}} -> - Res; - {ok,{error, leader_died}} -> - exit({leader_died, {?MODULE, leader_call, [Name, Request]}}); - {'EXIT',Reason} -> - exit({Reason, {?MODULE, leader_call, [Name, Request]}}) - end. - -%% @spec leader_call(Name::name(), Request::term(), Timeout::integer()) -%% -> Reply -%% -%% Reply = term() -%% -%% @doc Makes a call (similar to gen_server:call/3) to the -%% leader. The call is forwarded via the local gen_leader instance, if -%% that one isn't actually the leader. The client will exit if the -%% leader dies while the request is outstanding. -%% @end -%% -leader_call(Name, Request, Timeout) -> - case catch gen:call(Name, '$leader_call', Request, Timeout) of - {ok,{leader,reply,Res}} -> - Res; - {'EXIT',Reason} -> - exit({Reason, {?MODULE, leader_call, [Name, Request, Timeout]}}) - end. - - -%% @equiv gen_server:cast/2 -cast(Name, Request) -> - catch do_cast('$gen_cast', Name, Request), - ok. - -%% @spec leader_cast(Name::name(), Msg::term()) -> ok -%% @doc Similar to gen_server:cast/2 but will be forwarded to -%% the leader via the local gen_leader instance. -leader_cast(Name, Request) -> - catch do_cast('$leader_cast', Name, Request), - ok. - - -do_cast(Tag, Name, Request) when atom(Name) -> - Name ! {Tag, Request}; -do_cast(Tag, Pid, Request) when pid(Pid) -> - Pid ! {Tag, Request}. - - -%% @spec reply(From::callerRef(), Reply::term()) -> Void -%% @equiv gen_server:reply/2 -reply({To, Tag}, Reply) -> - catch To ! {Tag, Reply}. - - -%%% --------------------------------------------------- -%%% Initiate the new process. -%%% Register the name using the Rfunc function -%%% Calls the Mod:init/Args function. -%%% Finally an acknowledge is sent to Parent and the main -%%% loop is entered. -%%% --------------------------------------------------- -%%% @hidden -init_it(Starter, self, Name, Mod, {CandidateNodes, Workers, Arg}, Options) -> - init_it(Starter, self(), Name, Mod, - {CandidateNodes, Workers, Arg}, Options); -init_it(Starter,Parent,Name,Mod,{CandidateNodes,Workers,Arg},Options) -> - - %% The following row is needed in case of trace analysis, - %% starting tracing is too slow otherwise! - %receive after 100 -> ok end, - - Debug = debug_options(Name, Options), - - AmCandidate = member(node(), CandidateNodes), - - Election = #election{candidate_nodes = CandidateNodes, - worker_nodes = Workers, - name = Name, - nextel = 0}, - - case {catch Mod:init(Arg), AmCandidate} of - {{stop, Reason},_} -> - proc_lib:init_ack(Starter, {error, Reason}), - exit(Reason); - {ignore,_} -> - proc_lib:init_ack(Starter, ignore), - exit(normal); - {{'EXIT', Reason},_} -> - proc_lib:init_ack(Starter, {error, Reason}), - exit(Reason); - {{ok, State}, true} -> - NewE = startStage1(Election#election{incarn = incarnation(node())}), - - proc_lib:init_ack(Starter, {ok, self()}), - safe_loop(#server{parent = Parent,mod = Mod, - state = State,debug = Debug}, - candidate, NewE,{init}); - {{ok, State}, false} -> - proc_lib:init_ack(Starter, {ok, self()}), - safe_loop(#server{parent = Parent,mod = Mod, - state = State,debug = Debug}, - waiting_worker, Election,{init}); - Else -> - Error = {bad_return_value, Else}, - proc_lib:init_ack(Starter, {error, Error}), - exit(Error) - end. - - - - -%%% --------------------------------------------------- -%%% The MAIN loops. -%%% --------------------------------------------------- - - -safe_loop(#server{mod = Mod, state = State} = Server, Role, - #election{name = Name} = E, _PrevMsg) -> - % Event for QuickCheck - % ?EVENT({Role,E}), - receive - {system, From, Req} -> - #server{parent = Parent, debug = Debug} = Server, - sys:handle_system_msg(Req, From, Parent, ?MODULE, Debug, - [safe, Server, Role, E]); - {'EXIT', _, Reason} = Msg -> - terminate(Reason, Msg, Server, Role, E); - {halt,T,From} = Msg -> - NewE = halting(E,T,From), - From ! {ackLeader,T,self()}, - safe_loop(Server,Role,NewE,Msg); - {hasLeader,Ldr,T,_} = Msg -> - NewE1 = mon_node(E,Ldr), - case ( (E#election.status == elec2) and (E#election.acks /= []) ) of - true -> - lists:foreach( - fun(Node) -> - {Name,Node} ! {hasLeader,Ldr,T,self()} - end,E#election.acks); - false -> - ok - end, - NewE = NewE1#election{elid = T, - status = wait, - leadernode = node(Ldr), - down = E#election.down -- [node(Ldr)], - acks = []}, - Ldr ! {isLeader,T,self()}, - safe_loop(Server,Role,NewE,Msg); - {isLeader,T,From} = Msg -> - From ! {notLeader,T,self()}, - safe_loop(Server,Role,E,Msg); - {notLeader,T,_} = Msg -> - case ( (E#election.status == wait) and (E#election.elid == T) ) of - true -> - NewE = startStage1(E); - false -> - NewE = E - end, - safe_loop(Server,Role,NewE,Msg); - {ackLeader,T,From} = Msg -> - case ( (E#election.status == elec2) and (E#election.elid == T) and - (E#election.pendack == node(From)) ) of - true -> - NewE = continStage2( - E#election{acks = [node(From)|E#election.acks]}); - false -> - NewE = E - end, - hasBecomeLeader(NewE,Server,Msg); - {ldr,Synch,T,From} = Msg -> - case ( (E#election.status == wait) and (E#election.elid == T) ) of - true -> - NewE1 = mon_node(E,From), - NewE = NewE1#election{leader = From, - leadernode = node(From), - status = norm}, - {ok,NewState} = Mod:surrendered(State,Synch,NewE), - loop(Server#server{state = NewState},surrendered,NewE,Msg); - false -> - safe_loop(Server,Role,E,Msg) - end; - {normQ,T,From} = Msg -> - case ( (E#election.status == elec1) or - ( (E#election.status == wait) and (E#election.elid == T))) of - true -> - NewE = halting(E,T,From), - From ! {notNorm,T,self()}; - false -> - NewE = E - end, - safe_loop(Server,Role,NewE,Msg); - - {notNorm,_,_} = Msg -> - safe_loop(Server,Role,E,Msg); - {workerAlive,T,From} = Msg -> - case E#election.leadernode == none of - true -> - %% We should initiate activation, - %% monitor the possible leader! - NewE = mon_node(E#election{leadernode = node(From), - elid = T}, - From), - From ! {workerIsAlive,T,self()}; - false -> - % We should acutally ignore this, the present activation - % will complete or abort first... - NewE = E - end, - safe_loop(Server,Role,NewE,Msg); - {workerIsAlive,_,_} = Msg -> - % If this happens, the activation process should abort - % This process is no longer the leader! - % The sender will notice this via a DOWN message - safe_loop(Server,Role,E,Msg); - {activateWorker,T,Synch,From} = Msg -> - case ( (T == E#election.elid) and - (node(From) == E#election.leadernode)) of - true -> - NewE = E#election{ leader = From, - status = worker }, - {ok,NewState} = Mod:surrendered(State,Synch,NewE), - loop(Server#server{state = NewState},worker,NewE,Msg); - false -> - % This should be a VERY special case... - % But doing nothing is the right thing! - % A DOWN message should arrive to solve this situation - safe_loop(Server,Role,E,Msg) - end; - - {tau_timeout} = Msg -> - safe_loop(Server,Role,E,Msg); - {'DOWN',_Ref,process,From,_Reason} = Msg when Role==waiting_worker -> - % We are only monitoring one proc, the leader! - Node = case From of - {Name,_Node} -> _Node; - _ when pid(From) -> node(From) - end, - case Node == E#election.leadernode of - true -> - NewE = E#election{ leader = none, leadernode = none, - status = waiting_worker, - monitored = []}; - false -> - NewE = E - end, - safe_loop(Server, Role, NewE,Msg); - {'DOWN',Ref,process,From,_Reason} = Msg -> - Node = case From of - {Name,_Node} -> _Node; - _ when pid(From) -> node(From) - end, - NewMon = E#election.monitored -- [{Ref,Node}], - case lists:member(Node,E#election.candidate_nodes) of - true -> - NewDown = [Node | E#election.down], - E1 = E#election{down = NewDown, monitored = NewMon}, - case ( pos(Node,E#election.candidate_nodes) < - pos(node(),E#election.candidate_nodes) ) of - true -> - Lesser = lesser(node(),E#election.candidate_nodes), - LesserIsSubset = (Lesser -- NewDown) == [], - case ((E#election.status == wait) and - (Node == E#election.leadernode)) of - true -> - NewE = startStage1(E1); - false -> - case ((E#election.status == elec1) and - LesserIsSubset) of - true -> - NewE = startStage2( - E1#election{down = Lesser}); - false -> - NewE = E1 - end - end; - false -> - case ( (E#election.status == elec2) and - (Node == E#election.pendack) ) of - true -> - NewE = continStage2(E1); - false -> - case ( (E#election.status == wait) and - (Node == E#election.leadernode)) of - true -> - NewE = startStage1(E1); - false -> - NewE = E1 - end - end - end - end, - hasBecomeLeader(NewE,Server,Msg) - end. - - -loop(#server{parent = Parent, - mod = Mod, - state = State, - debug = Debug} = Server, Role, - #election{name = Name} = E, _PrevMsg) -> - % Event for QuickCheck - % ?EVENT({Role,E}), - receive - Msg -> - - case Msg of - {system, From, Req} -> - sys:handle_system_msg(Req, From, Parent, ?MODULE, Debug, - [normal, Server, Role, E]); - {'EXIT', Parent, Reason} -> - terminate(Reason, Msg, Server, Role, E); - - {halt,_,From} -> - From ! {hasLeader,E#election.leader,E#election.elid,self()}, - loop(Server,Role,E,Msg); - {hasLeader,_,_,_} -> - loop(Server,Role,E,Msg); - {isLeader,T,From} -> - case (self() == E#election.leader) of - true -> - NewE = mon_node( - E#election{ - down = E#election.down -- [node(From)]}, - From), - {ok,Synch,NewState} = Mod:elected(State,NewE), - From ! {ldr,Synch,E#election.elid,self()}, - loop(Server#server{state = NewState},Role,NewE,Msg); - false -> - From ! {notLeader,T,self()}, - loop(Server,Role,E,Msg) - end; - {ackLeader,_,_} -> - loop(Server,Role,E,Msg); - {notLeader,_,_} -> - loop(Server,Role,E,Msg); - {ack,_,_} -> - loop(Server,Role,E,Msg); - {ldr,_,_,_} -> - loop(Server,Role,E,Msg); - {normQ,_,_} -> - loop(Server,Role,E,Msg); - {notNorm,T,From} -> - case ( (E#election.leader == self()) and - (E#election.elid == T) ) of - true -> - NewE = mon_node( - E#election{down = E#election.down - -- [node(From)]},From), - {ok,Synch,NewState} = Mod:elected(State,NewE), - From ! {ldr,Synch,E#election.elid,self()}, - loop(Server#server{state = NewState},Role,NewE,Msg); - false -> - loop(Server,Role,E,Msg) - end; - {workerAlive,_,_} -> - % Do nothing if we get this from a new leader - % We will soon notice that the prev leader has died, and - % get the same message again when we are back in safe_loop! - loop(Server,Role,E,Msg); - {activateWorker,_,_,_} -> - % We ignore this, we are already active... - % It must be an old message! - loop(Server,Role,E,Msg); - {workerIsAlive,T,From} -> - case ((T == E#election.elid) and - (self() == E#election.leader) - %% and iselem(node(From),E#election.monitored) - ) of - true -> - NewE = mon_node( - E#election{work_down = E#election.work_down - -- [node(From)]}, - From), - %% NewE = E#election{work_down = E#election.work_down - %% -- [node(From)]}, - {ok,Synch,NewState} = Mod:elected(State,NewE), - From ! {activateWorker,T,Synch,self()}, - loop( - Server#server{state = NewState},Role,NewE,Msg); - false -> - loop(Server,Role,E,Msg) - end; - {tau_timeout} -> - case (E#election.leader == self()) of - true -> - lists:foreach( - fun(Node) -> - Elid = E#election.elid, - {Name,Node} ! {normQ,Elid,self()} - end,(E#election.down -- - [lists:nth(1,E#election.candidate_nodes)])), - lists:foreach( - fun(Node) -> - Elid = E#election.elid, - {Name,Node} ! - {workerAlive,Elid,self()} - end,E#election.work_down), - timer:send_after(?TAU,{tau_timeout}); - false -> - ok - end, - loop(Server,Role,E,Msg); - {'DOWN',_Ref,process,From,_Reason} when Role == worker -> - % We are only monitoring one proc, the leader! - Node = case From of - {Name,_Node} -> _Node; - _ when pid(From) -> node(From) - end, - case Node == E#election.leadernode of - true -> - NewE = E#election{ leader = none, leadernode = none, - status = waiting_worker, - monitored = []}, - safe_loop(Server, waiting_worker, NewE,Msg); - false -> - loop(Server, Role, E,Msg) - end; - {'DOWN',Ref,process,From,_Reason} -> - Node = case From of - {Name,_Node} -> _Node; - _ when pid(From) -> node(From) - end, - NewMon = E#election.monitored -- [{Ref,Node}], - case lists:member(Node,E#election.candidate_nodes) of - true -> - NewDown = [Node | E#election.down], - E1 = E#election{down = NewDown, monitored = NewMon}, - case (Node == E#election.leadernode) of - true -> - NewE = startStage1(E1), - safe_loop(Server, candidate, NewE,Msg); - - false -> - loop(Server, Role, E1,Msg) - end; - false -> - %% I am the leader, - %% make sure the dead worker is in work_down. - E1 = E#election{ - monitored = NewMon, - work_down = [Node | - (E#election.work_down -- [Node])] - }, - loop(Server, Role, E1,Msg) - end; - _Msg when Debug == [] -> - handle_msg(Msg, Server, Role, E); - _Msg -> - Debug1 = sys:handle_debug(Debug, {?MODULE, print_event}, - E#election.name, {in, Msg}), - handle_msg(Msg, Server#server{debug = Debug1}, Role, E) - end - end. - -%%----------------------------------------------------------------- -%% Callback functions for system messages handling. -%%----------------------------------------------------------------- -%% @hidden -system_continue(_Parent, _Debug, [safe, Server, Role, E]) -> - safe_loop(Server, Role, E,{}); -system_continue(_Parent, _Debug, [normal, Server, Role, E]) -> - loop(Server, Role, E,{}). - -%% @hidden -system_terminate(Reason, _Parent, _Debug, [_Mode, Server, Role, E]) -> - terminate(Reason, [], Server, Role, E). - -%% @hidden -system_code_change([Mode, Server, Role, E], _Module, OldVsn, Extra) -> - #server{mod = Mod, state = State} = Server, - case catch Mod:code_change(OldVsn, State, E, Extra) of - {ok, NewState} -> - NewServer = Server#server{state = NewState}, - {ok, [Mode, NewServer, Role, E]}; - {ok, NewState, NewE} -> - NewServer = Server#server{state = NewState}, - {ok, [Mode, NewServer, Role, NewE]}; - Else -> Else - end. - -%%----------------------------------------------------------------- -%% Format debug messages. Print them as the call-back module sees -%% them, not as the real erlang messages. Use trace for that. -%%----------------------------------------------------------------- -%% @hidden -print_event(Dev, {in, Msg}, Name) -> - case Msg of - {'$gen_call', {From, _Tag}, Call} -> - io:format(Dev, "*DBG* ~p got local call ~p from ~w~n", - [Name, Call, From]); - {'$leader_call', {From, _Tag}, Call} -> - io:format(Dev, "*DBG* ~p got global call ~p from ~w~n", - [Name, Call, From]); - {'$gen_cast', Cast} -> - io:format(Dev, "*DBG* ~p got local cast ~p~n", - [Name, Cast]); - {'$leader_cast', Cast} -> - io:format(Dev, "*DBG* ~p got global cast ~p~n", - [Name, Cast]); - _ -> - io:format(Dev, "*DBG* ~p got ~p~n", [Name, Msg]) - end; -print_event(Dev, {out, Msg, To, State}, Name) -> - io:format(Dev, "*DBG* ~p sent ~p to ~w, new state ~w~n", - [Name, Msg, To, State]); -print_event(Dev, {noreply, State}, Name) -> - io:format(Dev, "*DBG* ~p new state ~w~n", [Name, State]); -print_event(Dev, Event, Name) -> - io:format(Dev, "*DBG* ~p dbg ~p~n", [Name, Event]). - - -handle_msg({'$leader_call', From, Request} = Msg, - #server{mod = Mod, state = State} = Server, elected = Role, E) -> - case catch Mod:handle_leader_call(Request, From, State, E) of - {reply, Reply, NState} -> - NewServer = reply(From, {leader,reply,Reply}, - Server#server{state = NState}, Role, E), - loop(NewServer, Role, E,Msg); - {reply, Reply, Broadcast, NState} -> - NewE = broadcast({from_leader,Broadcast}, E), - NewServer = reply(From, {leader,reply,Reply}, - Server#server{state = NState}, Role, - NewE), - loop(NewServer, Role, NewE,Msg); - {noreply, NState} = Reply -> - NewServer = handle_debug(Server#server{state = NState}, - Role, E, Reply), - loop(NewServer, Role, E,Msg); - {stop, Reason, Reply, NState} -> - {'EXIT', R} = - (catch terminate(Reason, Msg, - Server#server{state = NState}, - Role, E)), - reply(From, Reply), - exit(R); - Other -> - handle_common_reply(Other, Msg, Server, Role, E) - end; -handle_msg({from_leader, Cmd} = Msg, - #server{mod = Mod, state = State} = Server, Role, E) -> - handle_common_reply(catch Mod:from_leader(Cmd, State, E), - Msg, Server, Role, E); -handle_msg({'$leader_call', From, Request} = Msg, Server, Role, - #election{buffered = Buffered, leader = Leader} = E) -> - Ref = make_ref(), - Leader ! {'$leader_call', {self(),Ref}, Request}, - NewBuffered = [{Ref,From}|Buffered], - loop(Server, Role, E#election{buffered = NewBuffered},Msg); -handle_msg({Ref, {leader,reply,Reply}} = Msg, Server, Role, - #election{buffered = Buffered} = E) -> - {value, {_,From}} = keysearch(Ref,1,Buffered), - NewServer = reply(From, {leader,reply,Reply}, Server, Role, - E#election{buffered = keydelete(Ref,1,Buffered)}), - loop(NewServer, Role, E, Msg); -handle_msg({'$gen_call', From, Request} = Msg, - #server{mod = Mod, state = State} = Server, Role, E) -> - case catch Mod:handle_call(Request, From, State) of - {reply, Reply, NState} -> - NewServer = reply(From, Reply, - Server#server{state = NState}, Role, E), - loop(NewServer, Role, E, Msg); - {noreply, NState} = Reply -> - NewServer = handle_debug(Server#server{state = NState}, - Role, E, Reply), - loop(NewServer, Role, E, Msg); - {stop, Reason, Reply, NState} -> - {'EXIT', R} = - (catch terminate(Reason, Msg, Server#server{state = NState}, - Role, E)), - reply(From, Reply), - exit(R); - Other -> - handle_common_reply(Other, Msg, Server, Role, E) - end; -handle_msg({'$gen_cast',Msg} = Cast, - #server{mod = Mod, state = State} = Server, Role, E) -> - handle_common_reply(catch Mod:handle_cast(Msg, State), - Cast, Server, Role, E); -handle_msg(Msg, - #server{mod = Mod, state = State} = Server, Role, E) -> - handle_common_reply(catch Mod:handle_info(Msg, State), - Msg, Server, Role, E). - - -handle_common_reply(Reply, Msg, Server, Role, E) -> - case Reply of - {ok, NState} -> - NewServer = handle_debug(Server#server{state = NState}, - Role, E, Reply), - loop(NewServer, Role, E, Msg); - {stop, Reason, NState} -> - terminate(Reason, Msg, Server#server{state = NState}, Role, E); - {'EXIT', Reason} -> - terminate(Reason, Msg, Server, Role, E); - _ -> - terminate({bad2_return_value, Reply}, Msg, Server, Role, E) - end. - - -reply({To, Tag}, Reply, #server{state = State} = Server, Role, E) -> - reply({To, Tag}, Reply), - handle_debug(Server, Role, E, {out, Reply, To, State}). - - -handle_debug(#server{debug = []} = Server, _Role, _E, _Event) -> - Server; -handle_debug(#server{debug = Debug} = Server, _Role, E, Event) -> - Debug1 = sys:handle_debug(Debug, {?MODULE, print_event}, - E#election.name, Event), - Server#server{debug = Debug1}. - -%%% --------------------------------------------------- -%%% Terminate the server. -%%% --------------------------------------------------- - -terminate(Reason, Msg, #server{mod = Mod, - state = State, - debug = Debug} = _Server, _Role, - #election{name = Name} = _E) -> - case catch Mod:terminate(Reason, State) of - {'EXIT', R} -> - error_info(R, Name, Msg, State, Debug), - exit(R); - _ -> - case Reason of - normal -> - exit(normal); - shutdown -> - exit(shutdown); - _ -> - error_info(Reason, Name, Msg, State, Debug), - exit(Reason) - end - end. - -%% Maybe we shouldn't do this? We have the crash report... -error_info(Reason, Name, Msg, State, Debug) -> - format("** Generic leader ~p terminating \n" - "** Last message in was ~p~n" - "** When Server state == ~p~n" - "** Reason for termination == ~n** ~p~n", - [Name, Msg, State, Reason]), - sys:print_log(Debug), - ok. - -%%% --------------------------------------------------- -%%% Misc. functions. -%%% --------------------------------------------------- - -opt(Op, [{Op, Value}|_]) -> - {ok, Value}; -opt(Op, [_|Options]) -> - opt(Op, Options); -opt(_, []) -> - false. - -debug_options(Name, Opts) -> - case opt(debug, Opts) of - {ok, Options} -> dbg_options(Name, Options); - _ -> dbg_options(Name, []) - end. - -dbg_options(Name, []) -> - Opts = - case init:get_argument(generic_debug) of - error -> - []; - _ -> - [log, statistics] - end, - dbg_opts(Name, Opts); -dbg_options(Name, Opts) -> - dbg_opts(Name, Opts). - -dbg_opts(Name, Opts) -> - case catch sys:debug_options(Opts) of - {'EXIT',_} -> - format("~p: ignoring erroneous debug options - ~p~n", - [Name, Opts]), - []; - Dbg -> - Dbg - end. - -%%----------------------------------------------------------------- -%% Status information -%%----------------------------------------------------------------- -%% @hidden -format_status(Opt, StatusData) -> - [PDict, SysState, Parent, Debug, [_Mode, Server, _Role, E]] = StatusData, - Header = lists:concat(["Status for generic server ", E#election.name]), - Log = sys:get_debug(log, Debug, []), - #server{mod = Mod, state = State} = Server, - Specific = - case erlang:function_exported(Mod, format_status, 2) of - true -> - case catch apply(Mod, format_status, [Opt, [PDict, State]]) of - {'EXIT', _} -> [{data, [{"State", State}]}]; - Else -> Else - end; - _ -> - [{data, [{"State", State}]}] - end, - [{header, Header}, - {data, [{"Status", SysState}, - {"Parent", Parent}, - {"Logged events", Log}]} | - Specific]. - - -%%----------------------------------------------------------------- -%% Leader-election functions -%%----------------------------------------------------------------- - -%% Corresponds to startStage1 in Figure 1 in the Stoller-article -startStage1(E) -> - Elid = {pos(node(),E#election.candidate_nodes), - E#election.incarn,E#election.nextel}, - NewE = E#election{ - elid = Elid, - nextel = E#election.nextel + 1, - down = [], - status = elec1}, - case ( pos(node(),E#election.candidate_nodes) == 1) of - true -> - startStage2(NewE); - false -> - mon_nodes(NewE,lesser(node(),E#election.candidate_nodes)) - end. - -%% Corresponds to startStage2 -startStage2(E) -> - continStage2(E#election{ - status = elec2, - pendack = node(), - acks = []}). - -continStage2(E) -> - case (pos(E#election.pendack,E#election.candidate_nodes) - < length(E#election.candidate_nodes)) of - true -> - Pendack = next(E#election.pendack,E#election.candidate_nodes), - NewE = mon_nodes(E,[Pendack]), - {E#election.name,Pendack} ! {halt,E#election.elid,self()}, - NewE#election{pendack = Pendack}; - false -> - % I am the leader - % io:format("I am the leader (Node ~w) ~n", [node()]), - E#election{leader = self(), - leadernode = node(), - status = norm} - end. - -%% corresponds to Halting -halting(E,T,From) -> - NewE = mon_node(E,From), - NewE#election{elid = T, - status = wait, - leadernode = node(From), - down = E#election.down -- [node(From)] - }. - -%% Start monitor a bunch of nodes -mon_nodes(E,Nodes) -> - foldl( - fun(Node,_E) -> - mon_node(_E,{_E#election.name,Node}) - end,E,Nodes). - -%% Star monitoring one Process -mon_node(E,Proc) -> - Node = case Proc of - {_Name,Node_} -> - Node_; - Pid when pid(Pid) -> - node(Pid) - end, - case iselem(Node,E#election.monitored) of - true -> - E; - false -> - Ref = erlang:monitor(process,Proc), - E#election{monitored = [{Ref,Node} | E#election.monitored]} - end. - - -%%%% Stop monitoring of a bunch of nodes -%%%demon_nodes(E) -> -%%% foreach(fun({R,_}) -> -%%% erlang:demonitor(R) -%%% end,E#election.monitored), -%%% E#election{monitored = []}. - -%%% checks if the proc has become the leader, if so switch to loop -hasBecomeLeader(E,Server,Msg) -> - case ((E#election.status == norm) and (E#election.leader == self())) of - true -> - {ok,Synch,NewState} = - (Server#server.mod):elected(Server#server.state,E), - lists:foreach( - fun(Node) -> - {E#election.name,Node} ! - {ldr, Synch, E#election.elid, self()} - end,E#election.acks), - - %% Make sure we will try to contact all workers! - NewE = E#election{work_down = E#election.worker_nodes}, - - %% Set the internal timeout (corresponds to Periodically) - timer:send_after(?TAU,{tau_timeout}), - %% (It's meaningful only when I am the leader!) - loop(Server#server{state = NewState},elected,NewE,Msg); - false -> - safe_loop(Server,candidate,E,Msg) - end. - - - - -%%% -%%% -%%% incarnation should return an integer value for the next -%%% incarnation of this node. We create a file for each node, -%%% this file contains a counter. When starting the system for the -%%% first time, the files should be intialized with 0 incarnation -%%% counter for all nodes orelse be removed, since we create -%%% files if not present with counter 1. -%%% -%%% Atomicity: This approach is safe as long as there is only -%%% one gen_leader running per node. -%%% -incarnation(Node) -> - case file:read_file_info(Node) of - {error,_Reason} -> - ok = file:write_file(Node,term_to_binary(1)), - 0; - {ok,_} -> - {ok,Bin} = file:read_file(Node), - Incarn = binary_to_term(Bin), - ok = file:write_file(Node,term_to_binary(Incarn+1)), - Incarn - end. - - -broadcast(Msg, #election{monitored = Monitored} = E) -> - %% This function is used for broadcasts, - %% and we make sure only to broadcast to already known nodes. - ToNodes = [N || {_,N} <- Monitored], - broadcast(Msg, ToNodes, E). - -broadcast({from_leader, Msg}, ToNodes, E) -> - foreach( - fun(Node) -> - {E#election.name,Node} ! {from_leader, Msg} - end,ToNodes), - E. - -iselem(_,[]) -> - false; -iselem(P,[{_,P}|_]) -> - true; -iselem(P,[_ | Ns]) -> - iselem(P,Ns). - -lesser(_,[]) -> - []; -lesser(N,[N|_]) -> - []; -lesser(N,[M|Ms]) -> - [M|lesser(N,Ms)]. - -next(_,[]) -> - no_val; -next(N,[N|Ms]) -> - lists:nth(1,Ms); -next(N,[_|Ms]) -> - next(N,Ms). - -pos(N1,[N1|_]) -> - 1; -pos(N1,[_|Ns]) -> - 1+pos(N1,Ns). +%%% ``The 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 Hans Svensson +%%% @author Thomas Arts +%%% @author Ulf Wiger +%%% +%%% @doc Leader election behavior. +%%%

This application implements a leader election behavior modeled after +%%% gen_server. This behavior intends to make it reasonably +%%% straightforward to implement a fully distributed server with +%%% master-slave semantics.

+%%%

The gen_leader behavior supports nearly everything that gen_server +%%% does (some functions, such as multicall() and the internal timeout, +%%% have been removed), and adds a few callbacks and API functions to +%%% support leader election etc.

+%%%

Also included is an example program, a global dictionary, based +%%% on the modules gen_leader and dict. The callback implementing the +%%% global dictionary is called 'test_cb', for no particularly logical +%%% reason.

+%%%

New version: The internal leader election algorithm was faulty +%%% and has been replaced with a new version based on a different leader +%%% election algorithm. As a consequence of this the query functions +%%% alive and down can no longer be provided. +%%% The new algorithm also make use of an incarnation parameter, by +%%% default written to disk in the function incarnation. This +%%% implies that only one gen_leader per node is permitted, if +%%% used in a diskless environment, incarnation must be adapted. +%%%

+%%% @end +%%% +%%% @type election() = tuple(). Opaque state of the gen_leader behaviour. +%%% @type node() = atom(). A node name. +%%% @type name() = atom(). A locally registered name. +%%% @type serverRef() = Name | {name(),node()} | {global,Name} | pid(). +%%% See gen_server. +%%% @type callerRef() = {pid(), reference()}. See gen_server. +%%% +-module(gen_leader). + +% Time between rounds of query from the leader +-define(TAU,250). + +% Exports for quickcheck +%-export([safe_loop/4,loop/4]). + +-export([start/6, + start_link/6, + leader_call/2, leader_call/3, leader_cast/2, + call/2, call/3, cast/2, + reply/2]). + +%% Query functions +-export([%% alive/1, + %% down/1, + candidates/1, + workers/1]). + +-export([ + system_continue/3, + system_terminate/4, + system_code_change/4, + format_status/2 + ]). + +-export([behaviour_info/1]). + +%% Internal exports +-export([init_it/6, print_event/3 + %%, safe_send/2 + ]). + +-import(error_logger , [format/2]). +-import(lists, [foldl/3, + foreach/2, + member/2, + keydelete/3, + keysearch/3]). + +% Include for QuickCheck +% -include("eqc.hrl"). + +-record(election,{leader = none, + name, + leadernode = none, + candidate_nodes = [], + worker_nodes = [], + alive = [], + down = [], + monitored = [], + buffered = [], + status, + elid, + acks = [], + work_down = [], + pendack, + incarn, + nextel + }). + +-record(server, {parent, + mod, + state, + debug}). + + +%%% --------------------------------------------------- +%%% Interface functions. +%%% --------------------------------------------------- + +%% @hidden +behaviour_info(callbacks) -> + [{init,1}, + {elected,2}, + {surrendered,3}, + {handle_leader_call,4}, + {handle_leader_cast,3}, + {from_leader,3}, + {handle_call,3}, + {handle_cast,2}, + {handle_DOWN,3}, + {handle_info,2}, + {terminate,2}, + {code_change,4}]; +behaviour_info(_Other) -> + undefined. + +%% @spec start(Name::node(), CandidateNodes::[node()], +%% Workers::[node()], Mod::atom(), Arg, Options::list()) -> +%% {ok,pid()} +%% +%% @doc Starts a gen_leader process without linking to the parent. +%% +start(Name, CandidateNodes, Workers, Mod, Arg, Options) when is_atom(Name) -> + gen:start(?MODULE, nolink, {local,Name}, + Mod, {CandidateNodes, Workers, Arg}, Options). + +%% @spec start_link(Name::atom(), CandidateNodes::[atom()], +%% Workers::[atom()], Mod::atom(), Arg, Options::list()) -> +%% {ok, pid()} +%% +%% @doc Starts a gen_leader process. +%% +%% +%% +%% +%% +%% +%% +%% +%%
NameThe locally registered name of the process
CandidateNodesThe names of nodes capable of assuming +%% a leadership role
WorkersThe names of nodes that will be part of the "cluster", +%% but cannot ever assume a leadership role.
ModThe name of the callback module
ArgArgument passed on to Mod:init/1
OptionsSame as gen_server's Options
+%% +%%

The list of candidates needs to be known from the start. Workers +%% can be added at runtime.

+%% @end +start_link(Name, CandidateNodes, Workers, + Mod, Arg, Options) when is_atom(Name) -> + % Random delay for QuickCheck + % timer:sleep(random:uniform(400)), + gen:start(?MODULE, link, {local,Name}, Mod, + {CandidateNodes, Workers, Arg}, Options). + + +%% Query functions to be used from the callback module + +%% alive(#election{alive = Alive}) -> +%% Alive. + +%% down(#election{down = Down}) -> +%% Down. + +%% @spec candidates(E::election()) -> [node()] +%% +%% @doc Returns a list of known candidates. +%% +candidates(#election{candidate_nodes = Cands}) -> + Cands. + +%% @spec workers(E::election()) -> [node()] +%% +%% @doc Returns a list of known workers. +%% +workers(#election{worker_nodes = Workers}) -> + Workers. + +% +% Make a call to a generic server. +% If the server is located at another node, that node will +% be monitored. +% If the client is trapping exits and is linked server termination +% is handled here (? Shall we do that here (or rely on timeouts) ?). +% +%% @spec call(Name::serverRef(), Request) -> term() +%% +%% @doc Equivalent to gen_server:call/2, but with a slightly +%% different exit reason if something goes wrong. This function calls +%% the gen_leader process exactly as if it were a gen_server +%% (which, for practical purposes, it is.) +%% @end +call(Name, Request) -> + case catch gen:call(Name, '$gen_call', Request) of + {ok,Res} -> + Res; + {'EXIT',Reason} -> + exit({Reason, {?MODULE, local_call, [Name, Request]}}) + end. + +%% @spec call(Name::serverRef(), Request, Timeout::integer()) -> +%% Reply +%% +%% Reply = term() +%% +%% @doc Equivalent to gen_server:call/3, but with a slightly +%% different exit reason if something goes wrong. This function calls +%% the gen_leader process exactly as if it were a gen_server +%% (which, for practical purposes, it is.) +%% @end +call(Name, Request, Timeout) -> + case catch gen:call(Name, '$gen_call', Request, Timeout) of + {ok,Res} -> + Res; + {'EXIT',Reason} -> + exit({Reason, {?MODULE, local_call, [Name, Request, Timeout]}}) + end. + +%% @spec leader_call(Name::name(), Request::term()) +%% -> Reply +%% +%% Reply = term() +%% +%% @doc Makes a call (similar to gen_server:call/2) to the +%% leader. The call is forwarded via the local gen_leader instance, if +%% that one isn't actually the leader. The client will exit if the +%% leader dies while the request is outstanding. +%%

This function uses gen:call/3, and is subject to the +%% same default timeout as e.g. gen_server:call/2.

+%% @end +%% +leader_call(Name, Request) -> + case catch gen:call(Name, '$leader_call', Request) of + {ok,{leader,reply,Res}} -> + Res; + {ok,{error, leader_died}} -> + exit({leader_died, {?MODULE, leader_call, [Name, Request]}}); + {'EXIT',Reason} -> + exit({Reason, {?MODULE, leader_call, [Name, Request]}}) + end. + +%% @spec leader_call(Name::name(), Request::term(), Timeout::integer()) +%% -> Reply +%% +%% Reply = term() +%% +%% @doc Makes a call (similar to gen_server:call/3) to the +%% leader. The call is forwarded via the local gen_leader instance, if +%% that one isn't actually the leader. The client will exit if the +%% leader dies while the request is outstanding. +%% @end +%% +leader_call(Name, Request, Timeout) -> + case catch gen:call(Name, '$leader_call', Request, Timeout) of + {ok,{leader,reply,Res}} -> + Res; + {'EXIT',Reason} -> + exit({Reason, {?MODULE, leader_call, [Name, Request, Timeout]}}) + end. + + +%% @equiv gen_server:cast/2 +cast(Name, Request) -> + catch do_cast('$gen_cast', Name, Request), + ok. + +%% @spec leader_cast(Name::name(), Msg::term()) -> ok +%% @doc Similar to gen_server:cast/2 but will be forwarded to +%% the leader via the local gen_leader instance. +leader_cast(Name, Request) -> + catch do_cast('$leader_cast', Name, Request), + ok. + + +do_cast(Tag, Name, Request) when atom(Name) -> + Name ! {Tag, Request}; +do_cast(Tag, Pid, Request) when pid(Pid) -> + Pid ! {Tag, Request}. + + +%% @spec reply(From::callerRef(), Reply::term()) -> Void +%% @equiv gen_server:reply/2 +reply({To, Tag}, Reply) -> + catch To ! {Tag, Reply}. + + +%%% --------------------------------------------------- +%%% Initiate the new process. +%%% Register the name using the Rfunc function +%%% Calls the Mod:init/Args function. +%%% Finally an acknowledge is sent to Parent and the main +%%% loop is entered. +%%% --------------------------------------------------- +%%% @hidden +init_it(Starter, self, Name, Mod, {CandidateNodes, Workers, Arg}, Options) -> + init_it(Starter, self(), Name, Mod, + {CandidateNodes, Workers, Arg}, Options); +init_it(Starter,Parent,Name,Mod,{CandidateNodes,Workers,Arg},Options) -> + + %% The following row is needed in case of trace analysis, + %% starting tracing is too slow otherwise! + %receive after 100 -> ok end, + + Debug = debug_options(Name, Options), + + AmCandidate = member(node(), CandidateNodes), + + Election = #election{candidate_nodes = CandidateNodes, + worker_nodes = Workers, + name = Name, + nextel = 0}, + + case {catch Mod:init(Arg), AmCandidate} of + {{stop, Reason},_} -> + proc_lib:init_ack(Starter, {error, Reason}), + exit(Reason); + {ignore,_} -> + proc_lib:init_ack(Starter, ignore), + exit(normal); + {{'EXIT', Reason},_} -> + proc_lib:init_ack(Starter, {error, Reason}), + exit(Reason); + {{ok, State}, true} -> + NewE = startStage1(Election#election{incarn = incarnation(node())}), + + proc_lib:init_ack(Starter, {ok, self()}), + safe_loop(#server{parent = Parent,mod = Mod, + state = State,debug = Debug}, + candidate, NewE,{init}); + {{ok, State}, false} -> + proc_lib:init_ack(Starter, {ok, self()}), + safe_loop(#server{parent = Parent,mod = Mod, + state = State,debug = Debug}, + waiting_worker, Election,{init}); + Else -> + Error = {bad_return_value, Else}, + proc_lib:init_ack(Starter, {error, Error}), + exit(Error) + end. + + + + +%%% --------------------------------------------------- +%%% The MAIN loops. +%%% --------------------------------------------------- + + +safe_loop(#server{mod = Mod, state = State} = Server, Role, + #election{name = Name} = E, _PrevMsg) -> + % Event for QuickCheck + % ?EVENT({Role,E}), + receive + {system, From, Req} -> + #server{parent = Parent, debug = Debug} = Server, + sys:handle_system_msg(Req, From, Parent, ?MODULE, Debug, + [safe, Server, Role, E]); + {'EXIT', _, Reason} = Msg -> + terminate(Reason, Msg, Server, Role, E); + {halt,T,From} = Msg -> + NewE = halting(E,T,From), + From ! {ackLeader,T,self()}, + safe_loop(Server,Role,NewE,Msg); + {hasLeader,Ldr,T,_} = Msg -> + NewE1 = mon_node(E,Ldr), + case ( (E#election.status == elec2) and (E#election.acks /= []) ) of + true -> + lists:foreach( + fun(Node) -> + {Name,Node} ! {hasLeader,Ldr,T,self()} + end,E#election.acks); + false -> + ok + end, + NewE = NewE1#election{elid = T, + status = wait, + leadernode = node(Ldr), + down = E#election.down -- [node(Ldr)], + acks = []}, + Ldr ! {isLeader,T,self()}, + safe_loop(Server,Role,NewE,Msg); + {isLeader,T,From} = Msg -> + From ! {notLeader,T,self()}, + safe_loop(Server,Role,E,Msg); + {notLeader,T,_} = Msg -> + case ( (E#election.status == wait) and (E#election.elid == T) ) of + true -> + NewE = startStage1(E); + false -> + NewE = E + end, + safe_loop(Server,Role,NewE,Msg); + {ackLeader,T,From} = Msg -> + case ( (E#election.status == elec2) and (E#election.elid == T) and + (E#election.pendack == node(From)) ) of + true -> + NewE = continStage2( + E#election{acks = [node(From)|E#election.acks]}); + false -> + NewE = E + end, + hasBecomeLeader(NewE,Server,Msg); + {ldr,Synch,T,From} = Msg -> + case ( (E#election.status == wait) and (E#election.elid == T) ) of + true -> + NewE1 = mon_node(E,From), + NewE = NewE1#election{leader = From, + leadernode = node(From), + status = norm}, + {ok,NewState} = Mod:surrendered(State,Synch,NewE), + loop(Server#server{state = NewState},surrendered,NewE,Msg); + false -> + safe_loop(Server,Role,E,Msg) + end; + {normQ,T,From} = Msg -> + case ( (E#election.status == elec1) or + ( (E#election.status == wait) and (E#election.elid == T))) of + true -> + NewE = halting(E,T,From), + From ! {notNorm,T,self()}; + false -> + NewE = E + end, + safe_loop(Server,Role,NewE,Msg); + + {notNorm,_,_} = Msg -> + safe_loop(Server,Role,E,Msg); + {workerAlive,T,From} = Msg -> + case E#election.leadernode == none of + true -> + %% We should initiate activation, + %% monitor the possible leader! + NewE = mon_node(E#election{leadernode = node(From), + elid = T}, + From), + From ! {workerIsAlive,T,self()}; + false -> + % We should acutally ignore this, the present activation + % will complete or abort first... + NewE = E + end, + safe_loop(Server,Role,NewE,Msg); + {workerIsAlive,_,_} = Msg -> + % If this happens, the activation process should abort + % This process is no longer the leader! + % The sender will notice this via a DOWN message + safe_loop(Server,Role,E,Msg); + {activateWorker,T,Synch,From} = Msg -> + case ( (T == E#election.elid) and + (node(From) == E#election.leadernode)) of + true -> + NewE = E#election{ leader = From, + status = worker }, + {ok,NewState} = Mod:surrendered(State,Synch,NewE), + loop(Server#server{state = NewState},worker,NewE,Msg); + false -> + % This should be a VERY special case... + % But doing nothing is the right thing! + % A DOWN message should arrive to solve this situation + safe_loop(Server,Role,E,Msg) + end; + + {tau_timeout} = Msg -> + safe_loop(Server,Role,E,Msg); + {'DOWN',_Ref,process,From,_Reason} = Msg when Role==waiting_worker -> + % We are only monitoring one proc, the leader! + Node = case From of + {Name,_Node} -> _Node; + _ when pid(From) -> node(From) + end, + case Node == E#election.leadernode of + true -> + NewE = E#election{ leader = none, leadernode = none, + status = waiting_worker, + monitored = []}; + false -> + NewE = E + end, + safe_loop(Server, Role, NewE,Msg); + {'DOWN',Ref,process,From,_Reason} = Msg -> + Node = case From of + {Name,_Node} -> _Node; + _ when pid(From) -> node(From) + end, + NewMon = E#election.monitored -- [{Ref,Node}], + case lists:member(Node,E#election.candidate_nodes) of + true -> + NewDown = [Node | E#election.down], + E1 = E#election{down = NewDown, monitored = NewMon}, + case ( pos(Node,E#election.candidate_nodes) < + pos(node(),E#election.candidate_nodes) ) of + true -> + Lesser = lesser(node(),E#election.candidate_nodes), + LesserIsSubset = (Lesser -- NewDown) == [], + case ((E#election.status == wait) and + (Node == E#election.leadernode)) of + true -> + NewE = startStage1(E1); + false -> + case ((E#election.status == elec1) and + LesserIsSubset) of + true -> + NewE = startStage2( + E1#election{down = Lesser}); + false -> + NewE = E1 + end + end; + false -> + case ( (E#election.status == elec2) and + (Node == E#election.pendack) ) of + true -> + NewE = continStage2(E1); + false -> + case ( (E#election.status == wait) and + (Node == E#election.leadernode)) of + true -> + NewE = startStage1(E1); + false -> + NewE = E1 + end + end + end + end, + hasBecomeLeader(NewE,Server,Msg) + end. + + +loop(#server{parent = Parent, + mod = Mod, + state = State, + debug = Debug} = Server, Role, + #election{name = Name} = E, _PrevMsg) -> + % Event for QuickCheck + % ?EVENT({Role,E}), + receive + Msg -> + + case Msg of + {system, From, Req} -> + sys:handle_system_msg(Req, From, Parent, ?MODULE, Debug, + [normal, Server, Role, E]); + {'EXIT', Parent, Reason} -> + terminate(Reason, Msg, Server, Role, E); + + {halt,_,From} -> + From ! {hasLeader,E#election.leader,E#election.elid,self()}, + loop(Server,Role,E,Msg); + {hasLeader,_,_,_} -> + loop(Server,Role,E,Msg); + {isLeader,T,From} -> + case (self() == E#election.leader) of + true -> + NewE = mon_node( + E#election{ + down = E#election.down -- [node(From)]}, + From), + {ok,Synch,NewState} = Mod:elected(State,NewE), + From ! {ldr,Synch,E#election.elid,self()}, + loop(Server#server{state = NewState},Role,NewE,Msg); + false -> + From ! {notLeader,T,self()}, + loop(Server,Role,E,Msg) + end; + {ackLeader,_,_} -> + loop(Server,Role,E,Msg); + {notLeader,_,_} -> + loop(Server,Role,E,Msg); + {ack,_,_} -> + loop(Server,Role,E,Msg); + {ldr,_,_,_} -> + loop(Server,Role,E,Msg); + {normQ,_,_} -> + loop(Server,Role,E,Msg); + {notNorm,T,From} -> + case ( (E#election.leader == self()) and + (E#election.elid == T) ) of + true -> + NewE = mon_node( + E#election{down = E#election.down + -- [node(From)]},From), + {ok,Synch,NewState} = Mod:elected(State,NewE), + From ! {ldr,Synch,E#election.elid,self()}, + loop(Server#server{state = NewState},Role,NewE,Msg); + false -> + loop(Server,Role,E,Msg) + end; + {workerAlive,_,_} -> + % Do nothing if we get this from a new leader + % We will soon notice that the prev leader has died, and + % get the same message again when we are back in safe_loop! + loop(Server,Role,E,Msg); + {activateWorker,_,_,_} -> + % We ignore this, we are already active... + % It must be an old message! + loop(Server,Role,E,Msg); + {workerIsAlive,T,From} -> + case ((T == E#election.elid) and + (self() == E#election.leader) + %% and iselem(node(From),E#election.monitored) + ) of + true -> + NewE = mon_node( + E#election{work_down = E#election.work_down + -- [node(From)]}, + From), + %% NewE = E#election{work_down = E#election.work_down + %% -- [node(From)]}, + {ok,Synch,NewState} = Mod:elected(State,NewE), + From ! {activateWorker,T,Synch,self()}, + loop( + Server#server{state = NewState},Role,NewE,Msg); + false -> + loop(Server,Role,E,Msg) + end; + {tau_timeout} -> + case (E#election.leader == self()) of + true -> + lists:foreach( + fun(Node) -> + Elid = E#election.elid, + {Name,Node} ! {normQ,Elid,self()} + end,(E#election.down -- + [lists:nth(1,E#election.candidate_nodes)])), + lists:foreach( + fun(Node) -> + Elid = E#election.elid, + {Name,Node} ! + {workerAlive,Elid,self()} + end,E#election.work_down), + timer:send_after(?TAU,{tau_timeout}); + false -> + ok + end, + loop(Server,Role,E,Msg); + {'DOWN',_Ref,process,From,_Reason} when Role == worker -> + % We are only monitoring one proc, the leader! + Node = case From of + {Name,_Node} -> _Node; + _ when pid(From) -> node(From) + end, + case Node == E#election.leadernode of + true -> + NewE = E#election{ leader = none, leadernode = none, + status = waiting_worker, + monitored = []}, + safe_loop(Server, waiting_worker, NewE,Msg); + false -> + loop(Server, Role, E,Msg) + end; + {'DOWN',Ref,process,From,_Reason} -> + Node = case From of + {Name,_Node} -> _Node; + _ when pid(From) -> node(From) + end, + NewMon = E#election.monitored -- [{Ref,Node}], + case lists:member(Node,E#election.candidate_nodes) of + true -> + NewDown = [Node | E#election.down], + E1 = E#election{down = NewDown, monitored = NewMon}, + case (Node == E#election.leadernode) of + true -> + NewE = startStage1(E1), + safe_loop(Server, candidate, NewE,Msg); + + false -> + loop(Server, Role, E1,Msg) + end; + false -> + %% I am the leader, + %% make sure the dead worker is in work_down. + E1 = E#election{ + monitored = NewMon, + work_down = [Node | + (E#election.work_down -- [Node])] + }, + loop(Server, Role, E1,Msg) + end; + _Msg when Debug == [] -> + handle_msg(Msg, Server, Role, E); + _Msg -> + Debug1 = sys:handle_debug(Debug, {?MODULE, print_event}, + E#election.name, {in, Msg}), + handle_msg(Msg, Server#server{debug = Debug1}, Role, E) + end + end. + +%%----------------------------------------------------------------- +%% Callback functions for system messages handling. +%%----------------------------------------------------------------- +%% @hidden +system_continue(_Parent, _Debug, [safe, Server, Role, E]) -> + safe_loop(Server, Role, E,{}); +system_continue(_Parent, _Debug, [normal, Server, Role, E]) -> + loop(Server, Role, E,{}). + +%% @hidden +system_terminate(Reason, _Parent, _Debug, [_Mode, Server, Role, E]) -> + terminate(Reason, [], Server, Role, E). + +%% @hidden +system_code_change([Mode, Server, Role, E], _Module, OldVsn, Extra) -> + #server{mod = Mod, state = State} = Server, + case catch Mod:code_change(OldVsn, State, E, Extra) of + {ok, NewState} -> + NewServer = Server#server{state = NewState}, + {ok, [Mode, NewServer, Role, E]}; + {ok, NewState, NewE} -> + NewServer = Server#server{state = NewState}, + {ok, [Mode, NewServer, Role, NewE]}; + Else -> Else + end. + +%%----------------------------------------------------------------- +%% Format debug messages. Print them as the call-back module sees +%% them, not as the real erlang messages. Use trace for that. +%%----------------------------------------------------------------- +%% @hidden +print_event(Dev, {in, Msg}, Name) -> + case Msg of + {'$gen_call', {From, _Tag}, Call} -> + io:format(Dev, "*DBG* ~p got local call ~p from ~w~n", + [Name, Call, From]); + {'$leader_call', {From, _Tag}, Call} -> + io:format(Dev, "*DBG* ~p got global call ~p from ~w~n", + [Name, Call, From]); + {'$gen_cast', Cast} -> + io:format(Dev, "*DBG* ~p got local cast ~p~n", + [Name, Cast]); + {'$leader_cast', Cast} -> + io:format(Dev, "*DBG* ~p got global cast ~p~n", + [Name, Cast]); + _ -> + io:format(Dev, "*DBG* ~p got ~p~n", [Name, Msg]) + end; +print_event(Dev, {out, Msg, To, State}, Name) -> + io:format(Dev, "*DBG* ~p sent ~p to ~w, new state ~w~n", + [Name, Msg, To, State]); +print_event(Dev, {noreply, State}, Name) -> + io:format(Dev, "*DBG* ~p new state ~w~n", [Name, State]); +print_event(Dev, Event, Name) -> + io:format(Dev, "*DBG* ~p dbg ~p~n", [Name, Event]). + + +handle_msg({'$leader_call', From, Request} = Msg, + #server{mod = Mod, state = State} = Server, elected = Role, E) -> + case catch Mod:handle_leader_call(Request, From, State, E) of + {reply, Reply, NState} -> + NewServer = reply(From, {leader,reply,Reply}, + Server#server{state = NState}, Role, E), + loop(NewServer, Role, E,Msg); + {reply, Reply, Broadcast, NState} -> + NewE = broadcast({from_leader,Broadcast}, E), + NewServer = reply(From, {leader,reply,Reply}, + Server#server{state = NState}, Role, + NewE), + loop(NewServer, Role, NewE,Msg); + {noreply, NState} = Reply -> + NewServer = handle_debug(Server#server{state = NState}, + Role, E, Reply), + loop(NewServer, Role, E,Msg); + {stop, Reason, Reply, NState} -> + {'EXIT', R} = + (catch terminate(Reason, Msg, + Server#server{state = NState}, + Role, E)), + reply(From, Reply), + exit(R); + Other -> + handle_common_reply(Other, Msg, Server, Role, E) + end; +handle_msg({from_leader, Cmd} = Msg, + #server{mod = Mod, state = State} = Server, Role, E) -> + handle_common_reply(catch Mod:from_leader(Cmd, State, E), + Msg, Server, Role, E); +handle_msg({'$leader_call', From, Request} = Msg, Server, Role, + #election{buffered = Buffered, leader = Leader} = E) -> + Ref = make_ref(), + Leader ! {'$leader_call', {self(),Ref}, Request}, + NewBuffered = [{Ref,From}|Buffered], + loop(Server, Role, E#election{buffered = NewBuffered},Msg); +handle_msg({Ref, {leader,reply,Reply}} = Msg, Server, Role, + #election{buffered = Buffered} = E) -> + {value, {_,From}} = keysearch(Ref,1,Buffered), + NewServer = reply(From, {leader,reply,Reply}, Server, Role, + E#election{buffered = keydelete(Ref,1,Buffered)}), + loop(NewServer, Role, E, Msg); +handle_msg({'$gen_call', From, Request} = Msg, + #server{mod = Mod, state = State} = Server, Role, E) -> + case catch Mod:handle_call(Request, From, State) of + {reply, Reply, NState} -> + NewServer = reply(From, Reply, + Server#server{state = NState}, Role, E), + loop(NewServer, Role, E, Msg); + {noreply, NState} = Reply -> + NewServer = handle_debug(Server#server{state = NState}, + Role, E, Reply), + loop(NewServer, Role, E, Msg); + {stop, Reason, Reply, NState} -> + {'EXIT', R} = + (catch terminate(Reason, Msg, Server#server{state = NState}, + Role, E)), + reply(From, Reply), + exit(R); + Other -> + handle_common_reply(Other, Msg, Server, Role, E) + end; +handle_msg({'$gen_cast',Msg} = Cast, + #server{mod = Mod, state = State} = Server, Role, E) -> + handle_common_reply(catch Mod:handle_cast(Msg, State), + Cast, Server, Role, E); +handle_msg(Msg, + #server{mod = Mod, state = State} = Server, Role, E) -> + handle_common_reply(catch Mod:handle_info(Msg, State), + Msg, Server, Role, E). + + +handle_common_reply(Reply, Msg, Server, Role, E) -> + case Reply of + {ok, NState} -> + NewServer = handle_debug(Server#server{state = NState}, + Role, E, Reply), + loop(NewServer, Role, E, Msg); + {stop, Reason, NState} -> + terminate(Reason, Msg, Server#server{state = NState}, Role, E); + {'EXIT', Reason} -> + terminate(Reason, Msg, Server, Role, E); + _ -> + terminate({bad2_return_value, Reply}, Msg, Server, Role, E) + end. + + +reply({To, Tag}, Reply, #server{state = State} = Server, Role, E) -> + reply({To, Tag}, Reply), + handle_debug(Server, Role, E, {out, Reply, To, State}). + + +handle_debug(#server{debug = []} = Server, _Role, _E, _Event) -> + Server; +handle_debug(#server{debug = Debug} = Server, _Role, E, Event) -> + Debug1 = sys:handle_debug(Debug, {?MODULE, print_event}, + E#election.name, Event), + Server#server{debug = Debug1}. + +%%% --------------------------------------------------- +%%% Terminate the server. +%%% --------------------------------------------------- + +terminate(Reason, Msg, #server{mod = Mod, + state = State, + debug = Debug} = _Server, _Role, + #election{name = Name} = _E) -> + case catch Mod:terminate(Reason, State) of + {'EXIT', R} -> + error_info(R, Name, Msg, State, Debug), + exit(R); + _ -> + case Reason of + normal -> + exit(normal); + shutdown -> + exit(shutdown); + _ -> + error_info(Reason, Name, Msg, State, Debug), + exit(Reason) + end + end. + +%% Maybe we shouldn't do this? We have the crash report... +error_info(Reason, Name, Msg, State, Debug) -> + format("** Generic leader ~p terminating \n" + "** Last message in was ~p~n" + "** When Server state == ~p~n" + "** Reason for termination == ~n** ~p~n", + [Name, Msg, State, Reason]), + sys:print_log(Debug), + ok. + +%%% --------------------------------------------------- +%%% Misc. functions. +%%% --------------------------------------------------- + +opt(Op, [{Op, Value}|_]) -> + {ok, Value}; +opt(Op, [_|Options]) -> + opt(Op, Options); +opt(_, []) -> + false. + +debug_options(Name, Opts) -> + case opt(debug, Opts) of + {ok, Options} -> dbg_options(Name, Options); + _ -> dbg_options(Name, []) + end. + +dbg_options(Name, []) -> + Opts = + case init:get_argument(generic_debug) of + error -> + []; + _ -> + [log, statistics] + end, + dbg_opts(Name, Opts); +dbg_options(Name, Opts) -> + dbg_opts(Name, Opts). + +dbg_opts(Name, Opts) -> + case catch sys:debug_options(Opts) of + {'EXIT',_} -> + format("~p: ignoring erroneous debug options - ~p~n", + [Name, Opts]), + []; + Dbg -> + Dbg + end. + +%%----------------------------------------------------------------- +%% Status information +%%----------------------------------------------------------------- +%% @hidden +format_status(Opt, StatusData) -> + [PDict, SysState, Parent, Debug, [_Mode, Server, _Role, E]] = StatusData, + Header = lists:concat(["Status for generic server ", E#election.name]), + Log = sys:get_debug(log, Debug, []), + #server{mod = Mod, state = State} = Server, + Specific = + case erlang:function_exported(Mod, format_status, 2) of + true -> + case catch apply(Mod, format_status, [Opt, [PDict, State]]) of + {'EXIT', _} -> [{data, [{"State", State}]}]; + Else -> Else + end; + _ -> + [{data, [{"State", State}]}] + end, + [{header, Header}, + {data, [{"Status", SysState}, + {"Parent", Parent}, + {"Logged events", Log}]} | + Specific]. + + +%%----------------------------------------------------------------- +%% Leader-election functions +%%----------------------------------------------------------------- + +%% Corresponds to startStage1 in Figure 1 in the Stoller-article +startStage1(E) -> + Elid = {pos(node(),E#election.candidate_nodes), + E#election.incarn,E#election.nextel}, + NewE = E#election{ + elid = Elid, + nextel = E#election.nextel + 1, + down = [], + status = elec1}, + case ( pos(node(),E#election.candidate_nodes) == 1) of + true -> + startStage2(NewE); + false -> + mon_nodes(NewE,lesser(node(),E#election.candidate_nodes)) + end. + +%% Corresponds to startStage2 +startStage2(E) -> + continStage2(E#election{ + status = elec2, + pendack = node(), + acks = []}). + +continStage2(E) -> + case (pos(E#election.pendack,E#election.candidate_nodes) + < length(E#election.candidate_nodes)) of + true -> + Pendack = next(E#election.pendack,E#election.candidate_nodes), + NewE = mon_nodes(E,[Pendack]), + {E#election.name,Pendack} ! {halt,E#election.elid,self()}, + NewE#election{pendack = Pendack}; + false -> + % I am the leader + % io:format("I am the leader (Node ~w) ~n", [node()]), + E#election{leader = self(), + leadernode = node(), + status = norm} + end. + +%% corresponds to Halting +halting(E,T,From) -> + NewE = mon_node(E,From), + NewE#election{elid = T, + status = wait, + leadernode = node(From), + down = E#election.down -- [node(From)] + }. + +%% Start monitor a bunch of nodes +mon_nodes(E,Nodes) -> + foldl( + fun(Node,_E) -> + mon_node(_E,{_E#election.name,Node}) + end,E,Nodes). + +%% Star monitoring one Process +mon_node(E,Proc) -> + Node = case Proc of + {_Name,Node_} -> + Node_; + Pid when pid(Pid) -> + node(Pid) + end, + case iselem(Node,E#election.monitored) of + true -> + E; + false -> + Ref = erlang:monitor(process,Proc), + E#election{monitored = [{Ref,Node} | E#election.monitored]} + end. + + +%%%% Stop monitoring of a bunch of nodes +%%%demon_nodes(E) -> +%%% foreach(fun({R,_}) -> +%%% erlang:demonitor(R) +%%% end,E#election.monitored), +%%% E#election{monitored = []}. + +%%% checks if the proc has become the leader, if so switch to loop +hasBecomeLeader(E,Server,Msg) -> + case ((E#election.status == norm) and (E#election.leader == self())) of + true -> + {ok,Synch,NewState} = + (Server#server.mod):elected(Server#server.state,E), + lists:foreach( + fun(Node) -> + {E#election.name,Node} ! + {ldr, Synch, E#election.elid, self()} + end,E#election.acks), + + %% Make sure we will try to contact all workers! + NewE = E#election{work_down = E#election.worker_nodes}, + + %% Set the internal timeout (corresponds to Periodically) + timer:send_after(?TAU,{tau_timeout}), + %% (It's meaningful only when I am the leader!) + loop(Server#server{state = NewState},elected,NewE,Msg); + false -> + safe_loop(Server,candidate,E,Msg) + end. + + + + +%%% +%%% +%%% incarnation should return an integer value for the next +%%% incarnation of this node. We create a file for each node, +%%% this file contains a counter. When starting the system for the +%%% first time, the files should be intialized with 0 incarnation +%%% counter for all nodes orelse be removed, since we create +%%% files if not present with counter 1. +%%% +%%% Atomicity: This approach is safe as long as there is only +%%% one gen_leader running per node. +%%% +incarnation(Node) -> + case file:read_file_info(Node) of + {error,_Reason} -> + ok = file:write_file(Node,term_to_binary(1)), + 0; + {ok,_} -> + {ok,Bin} = file:read_file(Node), + Incarn = binary_to_term(Bin), + ok = file:write_file(Node,term_to_binary(Incarn+1)), + Incarn + end. + + +broadcast(Msg, #election{monitored = Monitored} = E) -> + %% This function is used for broadcasts, + %% and we make sure only to broadcast to already known nodes. + ToNodes = [N || {_,N} <- Monitored], + broadcast(Msg, ToNodes, E). + +broadcast({from_leader, Msg}, ToNodes, E) -> + foreach( + fun(Node) -> + {E#election.name,Node} ! {from_leader, Msg} + end,ToNodes), + E. + +iselem(_,[]) -> + false; +iselem(P,[{_,P}|_]) -> + true; +iselem(P,[_ | Ns]) -> + iselem(P,Ns). + +lesser(_,[]) -> + []; +lesser(N,[N|_]) -> + []; +lesser(N,[M|Ms]) -> + [M|lesser(N,Ms)]. + +next(_,[]) -> + no_val; +next(N,[N|Ms]) -> + lists:nth(1,Ms); +next(N,[_|Ms]) -> + next(N,Ms). + +pos(N1,[N1|_]) -> + 1; +pos(N1,[_|Ns]) -> + 1+pos(N1,Ns). diff --git a/lib/js/priv/docroot/Tabtastic/tabtastic.css b/lib/js/priv/docroot/Tabtastic/tabtastic.css index 6387c2b..a9fc164 100644 --- a/lib/js/priv/docroot/Tabtastic/tabtastic.css +++ b/lib/js/priv/docroot/Tabtastic/tabtastic.css @@ -1,17 +1,17 @@ -.tabset_tabs { margin:0; padding:0; list-style-type:none; position:relative; z-index:2; white-space:nowrap } -.tabset_tabs li { margin:0; padding:0; display:inline } -.tabset_tabs a { color:#339 ! important; background-color:#def ! important; border:1px solid #99c; text-decoration:none; padding:0 0.6em; border-left-width:0; border-bottom:none } -.tabset_tabs a:hover { color:#00c ! important; background-color:#eff ! important } -.tabset_tabs a.active { color:black ! important; background-color:white ! important; border-color:black; border-left-width:1px; cursor:default; border-bottom:white; padding-top:1px; padding-bottom:1px } - -.tabset_tabs li.firstchild a { border-left-width:1px } - -.tabset_content { border:1px solid black; background-color:white; position:relative; z-index:1; padding:0.5em 1em; display:none } -.tabset_label { display:none } - -.tabset_content_active { display:block } - -@media aural{ - .tabset_content, - .tabset_label { display:block } +.tabset_tabs { margin:0; padding:0; list-style-type:none; position:relative; z-index:2; white-space:nowrap } +.tabset_tabs li { margin:0; padding:0; display:inline } +.tabset_tabs a { color:#339 ! important; background-color:#def ! important; border:1px solid #99c; text-decoration:none; padding:0 0.6em; border-left-width:0; border-bottom:none } +.tabset_tabs a:hover { color:#00c ! important; background-color:#eff ! important } +.tabset_tabs a.active { color:black ! important; background-color:white ! important; border-color:black; border-left-width:1px; cursor:default; border-bottom:white; padding-top:1px; padding-bottom:1px } + +.tabset_tabs li.firstchild a { border-left-width:1px } + +.tabset_content { border:1px solid black; background-color:white; position:relative; z-index:1; padding:0.5em 1em; display:none } +.tabset_label { display:none } + +.tabset_content_active { display:block } + +@media aural{ + .tabset_content, + .tabset_label { display:block } } \ No newline at end of file diff --git a/lib/js/priv/docroot/tabtastic.yaws b/lib/js/priv/docroot/tabtastic.yaws index 44e28d9..873bf79 100644 --- a/lib/js/priv/docroot/tabtastic.yaws +++ b/lib/js/priv/docroot/tabtastic.yaws @@ -1,24 +1,24 @@ - - - - - Tabtastic - - - - - - - -

Tabtastic (http://phrogz.net/JS/Tabtastic/)

- - -out(A) -> - {ehtml, js:tabtastic([{"overview", "Overview", true , {pre_html, "This is the overview..."}}, - {"requirements", "Requirements", false , {pre_html, "The requirements are..."}}, - {"stepbystep", "Step-by-step", false , {pre_html, "Step-by-step instructions for..."}}, - {"notes", "Notes", false , {pre_html, "A few random tips and limitations..."}}])}. - - - - + + + + + Tabtastic + + + + + + + +

Tabtastic (http://phrogz.net/JS/Tabtastic/)

+ + +out(A) -> + {ehtml, js:tabtastic([{"overview", "Overview", true , {pre_html, "This is the overview..."}}, + {"requirements", "Requirements", false , {pre_html, "The requirements are..."}}, + {"stepbystep", "Step-by-step", false , {pre_html, "Step-by-step instructions for..."}}, + {"notes", "Notes", false , {pre_html, "A few random tips and limitations..."}}])}. + + + + diff --git a/lib/lama/LICENSE b/lib/lama/LICENSE index 3add94a..b6b8bf9 100644 --- a/lib/lama/LICENSE +++ b/lib/lama/LICENSE @@ -1,32 +1,32 @@ -LICENSE -======= - -Copyright (C) 2005 Serge Aleynikov - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -DISCLAIMER OF WARRANTY. - -COVERED CODE IS PROVIDED ON AN "AS IS" BASIS, -WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, -WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF -DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR -NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF -THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE -IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER -CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR -CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART -OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER -EXCEPT UNDER THIS DISCLAIMER. +LICENSE +======= + +Copyright (C) 2005 Serge Aleynikov + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +DISCLAIMER OF WARRANTY. + +COVERED CODE IS PROVIDED ON AN "AS IS" BASIS, +WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF +DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR +NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF +THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE +IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER +CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR +CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART +OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER +EXCEPT UNDER THIS DISCLAIMER. diff --git a/lib/lama/Makefile b/lib/lama/Makefile index 5c076b3..d7fcf52 100644 --- a/lib/lama/Makefile +++ b/lib/lama/Makefile @@ -1,24 +1,24 @@ -# Makefile for the LAMA application maintained in Jungerl -# -# $Id$ -# $Url$ -# - -#include ../../support/subdir.mk -APP_NAME=lama - -all: - (cd src;$(MAKE)) - -clean: - (cd src;$(MAKE) clean) - -release: clean appfile - sh ../../support/create_release.sh - -appfile: - (cd src;$(MAKE) ../ebin/$(APP_NAME).app) - -docs: - erl -noshell -run edoc_run application "'$(APP_NAME)'" \ - '"."' '[{def,{vsn,"$(VSN)"}}]' -s init stop +# Makefile for the LAMA application maintained in Jungerl +# +# $Id$ +# $Url$ +# + +#include ../../support/subdir.mk +APP_NAME=lama + +all: + (cd src;$(MAKE)) + +clean: + (cd src;$(MAKE) clean) + +release: clean appfile + sh ../../support/create_release.sh + +appfile: + (cd src;$(MAKE) ../ebin/$(APP_NAME).app) + +docs: + erl -noshell -run edoc_run application "'$(APP_NAME)'" \ + '"."' '[{def,{vsn,"$(VSN)"}}]' -s init stop diff --git a/lib/lama/include/log_debug.hrl b/lib/lama/include/log_debug.hrl index 7ab96d4..3488f3b 100644 --- a/lib/lama/include/log_debug.hrl +++ b/lib/lama/include/log_debug.hrl @@ -1,14 +1,14 @@ -%%---------------------------------------------------------------------- -%% File : log_debug.hrl -%% Author : Serge Aleynikov -%% Purpose : Generic log message macros -%% Created : 6/1/2005 1:43PM -%%---------------------------------------------------------------------- - -%% Write the report at the local node only. --define(ALERT(Str_, Args_), io:format(Str_, Args_)). --define(ERROR(Str_, Args_), io:format(Str_, Args_)). --define(WARNING(Str_, Args_), io:format(Str_, Args_)). --define(NOTICE(Str_, Args_), io:format(Str_, Args_)). --define(INFO(Str_, Args_), io:format(Str_, Args_)). --define(DEBUG(Str_, Args_), io:format(Str_, Args_)). +%%---------------------------------------------------------------------- +%% File : log_debug.hrl +%% Author : Serge Aleynikov +%% Purpose : Generic log message macros +%% Created : 6/1/2005 1:43PM +%%---------------------------------------------------------------------- + +%% Write the report at the local node only. +-define(ALERT(Str_, Args_), io:format(Str_, Args_)). +-define(ERROR(Str_, Args_), io:format(Str_, Args_)). +-define(WARNING(Str_, Args_), io:format(Str_, Args_)). +-define(NOTICE(Str_, Args_), io:format(Str_, Args_)). +-define(INFO(Str_, Args_), io:format(Str_, Args_)). +-define(DEBUG(Str_, Args_), io:format(Str_, Args_)). diff --git a/lib/lama/include/logger.hrl b/lib/lama/include/logger.hrl index b245a2f..ab1ebd7 100644 --- a/lib/lama/include/logger.hrl +++ b/lib/lama/include/logger.hrl @@ -1,55 +1,55 @@ -%%---------------------------------------------------------------------- -%% File : logger.hrl -%% Author : Serge Aleynikov -%% Purpose : Generic log message macros -%% Created : 6/1/2005 1:43PM -%%---------------------------------------------------------------------- - -%% Write the report at the local node only. --define(ALERT(Str_, Args_), - error_logger:error_report({lama,alert}, - {false,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). --define(ERROR(Str_, Args_), - error_logger:error_report({lama,error}, - {false,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). --define(WARNING(Str_, Args_), - error_logger:error_report({lama,warning}, - {false,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). -%% NOTICE, INFO, DEBUG don't get sent to syslog, but get displayed on screen. -%% INFO, DEBUG - display plain formated text. -%% NOTICE - displays text with a standard SASL header --define(NOTICE(Str_, Args_), - error_logger:error_report({lama,notice}, - {false,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). --define(INFO(Str_, Args_), - error_logger:error_report({lama,info}, - {false,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). --define(DEBUG(Str_, Args_), - error_logger:error_report({lama,debug}, - {false,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). - -%% Write the report at all known nodes. --define(DIST_ALERT(Str_, Args_), - error_logger:error_report({lama,alert}, - {true,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). --define(DIST_ERROR(Str_, Args_), - error_logger:error_report({lama,error}, - {true,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). --define(DIST_WARNING(Str_, Args_), - error_logger:error_report({lama,warning}, - {true,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). --define(DIST_NOTICE(Str_, Args_), - error_logger:error_report({lama,notice}, - {false,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). --define(DIST_INFO(Str_, Args_), - error_logger:error_report({lama,info}, - {true,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). --define(DIST_DEBUG(Str_, Args_), - error_logger:error_report({lama,debug}, - {true,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). - -%% Format a string to be used by the macros above. --define(FMT(Format_,Arguments_), - lists:flatten(io_lib:format(Format_,Arguments_))). --define(FLAT(String_), lists:flatten(String_)). --define(IF(Condition_, Value_, True, False), case Condition_ of Value_ -> True; _ -> False end). +%%---------------------------------------------------------------------- +%% File : logger.hrl +%% Author : Serge Aleynikov +%% Purpose : Generic log message macros +%% Created : 6/1/2005 1:43PM +%%---------------------------------------------------------------------- + +%% Write the report at the local node only. +-define(ALERT(Str_, Args_), + error_logger:error_report({lama,alert}, + {false,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). +-define(ERROR(Str_, Args_), + error_logger:error_report({lama,error}, + {false,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). +-define(WARNING(Str_, Args_), + error_logger:error_report({lama,warning}, + {false,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). +%% NOTICE, INFO, DEBUG don't get sent to syslog, but get displayed on screen. +%% INFO, DEBUG - display plain formated text. +%% NOTICE - displays text with a standard SASL header +-define(NOTICE(Str_, Args_), + error_logger:error_report({lama,notice}, + {false,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). +-define(INFO(Str_, Args_), + error_logger:error_report({lama,info}, + {false,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). +-define(DEBUG(Str_, Args_), + error_logger:error_report({lama,debug}, + {false,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). + +%% Write the report at all known nodes. +-define(DIST_ALERT(Str_, Args_), + error_logger:error_report({lama,alert}, + {true,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). +-define(DIST_ERROR(Str_, Args_), + error_logger:error_report({lama,error}, + {true,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). +-define(DIST_WARNING(Str_, Args_), + error_logger:error_report({lama,warning}, + {true,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). +-define(DIST_NOTICE(Str_, Args_), + error_logger:error_report({lama,notice}, + {false,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). +-define(DIST_INFO(Str_, Args_), + error_logger:error_report({lama,info}, + {true,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). +-define(DIST_DEBUG(Str_, Args_), + error_logger:error_report({lama,debug}, + {true,{lama:get_app(),?MODULE,?LINE, Str_, Args_}})). + +%% Format a string to be used by the macros above. +-define(FMT(Format_,Arguments_), + lists:flatten(io_lib:format(Format_,Arguments_))). +-define(FLAT(String_), lists:flatten(String_)). +-define(IF(Condition_, Value_, True, False), case Condition_ of Value_ -> True; _ -> False end). diff --git a/lib/lama/src/Makefile b/lib/lama/src/Makefile index 3e6a72f..50398b1 100644 --- a/lib/lama/src/Makefile +++ b/lib/lama/src/Makefile @@ -1,13 +1,13 @@ -# -# $Id$ -# - -include ../vsn.mk -include ../../../support/include.mk -ERLC_FLAGS += -I../include -ERL_OBJECTS += $(EBIN_DIR)/lama.app - -all: $(ERL_OBJECTS) - -clean: - -rm $(ERL_OBJECTS) +# +# $Id$ +# + +include ../vsn.mk +include ../../../support/include.mk +ERLC_FLAGS += -I../include +ERL_OBJECTS += $(EBIN_DIR)/lama.app + +all: $(ERL_OBJECTS) + +clean: + -rm $(ERL_OBJECTS) diff --git a/lib/lama/src/overview.edoc b/lib/lama/src/overview.edoc index 950671a..c05fc50 100644 --- a/lib/lama/src/overview.edoc +++ b/lib/lama/src/overview.edoc @@ -1,136 +1,136 @@ - - LAMA - Log and Alarm Manager overview page - -@author Serge Aleynikov -@copyright 2003 Serge Aleynikov -@version {@vsn} $Rev: 359 $ $LastChangedDate: 2006-01-11 10:28:26 -0500 (Wed, 11 Jan 2006) $ -@title LAMA - Log and Alarm Manager Overview - -@doc This application implements LAMA - Log and Alarm Manager. - -

Contents

-
    -
  1. Features
  2. -
  3. Configuration Options
  4. -
  5. Programming Macros
  6. -
  7. Configuration Management
  8. -
  9. Examples
  10. -
- - -

Features

- -LAMA offers the following features: -
    -
  • Event handler logging of all error_logger's standard reports to - syslog
  • -
  • Setting and clearing alarms that are logged to syslog
  • -
  • Defining map between alarms and SNMP traps, so that when - an alarm is set/cleared, it will cause an associated SNMP - trap to be sent to a configured SNMP manager, logged - to syslog, and displayed on screen through a standard - error_logger's report.
  • -
  • Standard macros to report errors of various priorities
  • -
  • Functions to process application configuration options
  • -
  • A module {@link tracer} for function call tracing
  • -
-It installs two event handlers: {@link lama_alarm_h} (that -replaces SASL's standard alarm_handler), and {@link lama_syslog_h} (in -error_logger event manager). Both event handlers are fault tolerant -by being supervised by guarding processes (see {@link lama_guard}). -Module {@link lama} implements the application LAMA and its supervisor. -Note that this application will not start unless SASL is started. -

- -

Configuration Options

- -
-
{notify_name, NotifyName::string()}
-
NotifyName is a key from the SNMP's ``notify.config'' file. It - defines the host destinations for all alarms sent to an SNMP manager. - Default value is "".
-
{alarm_traps, AlarmTraps::list()}
-
A mapping between AlarmIDs and Traps. It is used to lookup a trap - when a corresponding alarm is set. ``AlarmTraps'' contains either - {AlarmID, Trap, Varbinds} tuples, or an atom: ``os_mon'' - for - setting all three OS_MON's traps (process memory / system memory / disk).
-
{syslog_host, HostName::string()}
-
Host for receiving syslog messages. Default: "localhost".
-
{syslog_indent, Indent::atom()}
-
Default indent used to identify the application in log messages. - Use application:get_applicaiton/0 in applications. Default: lama.
-
{syslog_facility, Facility::atom()}
-
Log facility used by syslog. Default: user. - Posible values: user,mail,daemon,auth,syslog,lpr,news,uucp,cron,ftp,local0-7
-
{syslog_types, Types::list()}
-
Types of messages that need to be sent to syslog. Default: [alert, error, warning]. - By default ``notice'', ``debug'' and ``info'' messages are not sent to syslog, - but printed to screen. Use this option to override the default behaviour.
-
{ignore_types, Types::list()}
-
Types of messages that will be ignored. Supported values - [alert, error, warning, notice, debug, info]. Default: []. - If you want to completely ignore some message types, use this option. This is - convenient when you want to have some debugging information printed during - development, and don't want that verbosity in production.
-
{alarm_set_priority, Priority::atom()}
-
Syslog priority to use when sending an alarm. Default: ``error''
-
{alarm_cleared_priority, Priority::atom()}
-
Syslog priority to use when clearing an alarm. Default: ``warning''
-
- -

Programming Macros

- -
-
?ALERT(Format, Args)
-
Notify error_logger handler with an event forwarded to syslog with the ``alert'' priority.
- -
?ERROR(Format, Args)
-
Notify error_logger handler with an event forwarded to syslog with the ``error'' priority.
- -
?WARNING(Format, Args)
-
Notify error_logger handler with an event forwarded to syslog with the ``warning'' priority.
- -
?INFO(Format, Args)
-
Notify error_logger handler with an ``info'' event displayed on the terminal without standard error header.
- -
?DEBUG(Format, Args)
-
Notify error_logger handler with an ``debug'' event displayed on the terminal without standard error header.
-
- -The same macros are also available with a ``DIST_'' prefix that will send the event to all -known Erlang nodes.

- -

Configuration Management

- -Lama module exports several functions (get_app_*, get_opt, -verify_config) that can be used to perform type verification of configuration -options. The following guideline is suggested: - -
    -
  • A MODULE included in an application that requires custom typed parameters exports a function - get_def_options/0. This function should return a list {@link lama:typed_options()} of - options parameters with their default values and expected types. E.g.: -
    -        get_def_options() ->
    -          %% {param_name,  def_value, expected_type}
    -            [{notify_name, "",        string},
    -             {alarm_traps, [os_mon],  fun check_altr/2}].
    -    
    -
  • -
  • The main application module that uses application behaviour calls - MODULE:get_def_options/0, and passes the result to {@link lama:get_app_options/3}, - which fetches all options in the resulting list from the application's environment, and - checks their types. It returns the list of validated paramaters ({@link lama:options()}) - that can be passed to the application's supervisor. - -
    -        start(_, Options) ->
    -            Params = lama:get_app_options(lama, Options, MODULE:get_def_options()),
    -            supervisor:start_link({local, main_sup}, ?MODULE, [Params]).
    -    
    -
  • -
- -

Examples

- -@end + + LAMA - Log and Alarm Manager overview page + +@author Serge Aleynikov +@copyright 2003 Serge Aleynikov +@version {@vsn} $Rev: 359 $ $LastChangedDate: 2006-01-11 10:28:26 -0500 (Wed, 11 Jan 2006) $ +@title LAMA - Log and Alarm Manager Overview + +@doc This application implements LAMA - Log and Alarm Manager. + +

Contents

+
    +
  1. Features
  2. +
  3. Configuration Options
  4. +
  5. Programming Macros
  6. +
  7. Configuration Management
  8. +
  9. Examples
  10. +
+ + +

Features

+ +LAMA offers the following features: +
    +
  • Event handler logging of all error_logger's standard reports to + syslog
  • +
  • Setting and clearing alarms that are logged to syslog
  • +
  • Defining map between alarms and SNMP traps, so that when + an alarm is set/cleared, it will cause an associated SNMP + trap to be sent to a configured SNMP manager, logged + to syslog, and displayed on screen through a standard + error_logger's report.
  • +
  • Standard macros to report errors of various priorities
  • +
  • Functions to process application configuration options
  • +
  • A module {@link tracer} for function call tracing
  • +
+It installs two event handlers: {@link lama_alarm_h} (that +replaces SASL's standard alarm_handler), and {@link lama_syslog_h} (in +error_logger event manager). Both event handlers are fault tolerant +by being supervised by guarding processes (see {@link lama_guard}). +Module {@link lama} implements the application LAMA and its supervisor. +Note that this application will not start unless SASL is started. +

+ +

Configuration Options

+ +
+
{notify_name, NotifyName::string()}
+
NotifyName is a key from the SNMP's ``notify.config'' file. It + defines the host destinations for all alarms sent to an SNMP manager. + Default value is "".
+
{alarm_traps, AlarmTraps::list()}
+
A mapping between AlarmIDs and Traps. It is used to lookup a trap + when a corresponding alarm is set. ``AlarmTraps'' contains either + {AlarmID, Trap, Varbinds} tuples, or an atom: ``os_mon'' - for + setting all three OS_MON's traps (process memory / system memory / disk).
+
{syslog_host, HostName::string()}
+
Host for receiving syslog messages. Default: "localhost".
+
{syslog_indent, Indent::atom()}
+
Default indent used to identify the application in log messages. + Use application:get_applicaiton/0 in applications. Default: lama.
+
{syslog_facility, Facility::atom()}
+
Log facility used by syslog. Default: user. + Posible values: user,mail,daemon,auth,syslog,lpr,news,uucp,cron,ftp,local0-7
+
{syslog_types, Types::list()}
+
Types of messages that need to be sent to syslog. Default: [alert, error, warning]. + By default ``notice'', ``debug'' and ``info'' messages are not sent to syslog, + but printed to screen. Use this option to override the default behaviour.
+
{ignore_types, Types::list()}
+
Types of messages that will be ignored. Supported values + [alert, error, warning, notice, debug, info]. Default: []. + If you want to completely ignore some message types, use this option. This is + convenient when you want to have some debugging information printed during + development, and don't want that verbosity in production.
+
{alarm_set_priority, Priority::atom()}
+
Syslog priority to use when sending an alarm. Default: ``error''
+
{alarm_cleared_priority, Priority::atom()}
+
Syslog priority to use when clearing an alarm. Default: ``warning''
+
+ +

Programming Macros

+ +
+
?ALERT(Format, Args)
+
Notify error_logger handler with an event forwarded to syslog with the ``alert'' priority.
+ +
?ERROR(Format, Args)
+
Notify error_logger handler with an event forwarded to syslog with the ``error'' priority.
+ +
?WARNING(Format, Args)
+
Notify error_logger handler with an event forwarded to syslog with the ``warning'' priority.
+ +
?INFO(Format, Args)
+
Notify error_logger handler with an ``info'' event displayed on the terminal without standard error header.
+ +
?DEBUG(Format, Args)
+
Notify error_logger handler with an ``debug'' event displayed on the terminal without standard error header.
+
+ +The same macros are also available with a ``DIST_'' prefix that will send the event to all +known Erlang nodes.

+ +

Configuration Management

+ +Lama module exports several functions (get_app_*, get_opt, +verify_config) that can be used to perform type verification of configuration +options. The following guideline is suggested: + +
    +
  • A MODULE included in an application that requires custom typed parameters exports a function + get_def_options/0. This function should return a list {@link lama:typed_options()} of + options parameters with their default values and expected types. E.g.: +
    +        get_def_options() ->
    +          %% {param_name,  def_value, expected_type}
    +            [{notify_name, "",        string},
    +             {alarm_traps, [os_mon],  fun check_altr/2}].
    +    
    +
  • +
  • The main application module that uses application behaviour calls + MODULE:get_def_options/0, and passes the result to {@link lama:get_app_options/3}, + which fetches all options in the resulting list from the application's environment, and + checks their types. It returns the list of validated paramaters ({@link lama:options()}) + that can be passed to the application's supervisor. + +
    +        start(_, Options) ->
    +            Params = lama:get_app_options(lama, Options, MODULE:get_def_options()),
    +            supervisor:start_link({local, main_sup}, ?MODULE, [Params]).
    +    
    +
  • +
+ +

Examples

+ +@end diff --git a/lib/lines/src/lines.erl b/lib/lines/src/lines.erl index 1565f49..c69c8b9 100644 --- a/lib/lines/src/lines.erl +++ b/lib/lines/src/lines.erl @@ -1,367 +1,367 @@ -%%% The contents of this file are subject to the Erlang Public License, -%%% Version 1.0, (the "License"); you may not use this file except in -%%% compliance with the License. You may obtain a copy of the License at -%%% http://www.erlang.org/license/EPL1_0.txt -%%% -%%% 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 Original Code is lines-1.0. -%%% -%%% The Initial Developer of the Original Code is Ericsson Telecom -%%% AB. Portions created by Ericsson are Copyright (C), 1998, Ericsson -%%% Telecom AB. All Rights Reserved. -%%% -%%% Contributor(s): ______________________________________. - -%%%---------------------------------------------------------------------- -%%% #0. BASIC INFORMATION -%%%---------------------------------------------------------------------- -%%% File: lines.erl -%%% Author : Ulf Wiger -%%% Description : Efficient array of lines (e.g. for text editor) -%%% Fixes: : Joe Armstrong fixed bug in replace -%%% Modules used : lists -%%% -%%%---------------------------------------------------------------------- -%%% Efficient array of lines (e.g. for text editor) -%%% allows for append, as well as insert, replace, delete in any position -%%% with reasonable access times. -%%% Rough benchmarking indicates (on a 440MHz Ultra): -%%% -%%% NoOfLines Append (uSec) Read (uSec) Delete (uSec) -%%% 100 9 7 7 -%%% 1,000 14 10 11 -%%% 10,000 22 13 15 -%%% 100,000 30 16 18 -%%% -%%% Comment on the benchmark: The times for Append and Delete are mean -%%% times for "growing file" and "shrinking file", that is, starting from -%%% an empty array and inserting 100,000 lines took ca 3 seconds; deleting -%%% them took ca 1.8 seconds. The Read test involved accessing all lines -%%% in the full array and calculating the mean time. -%%% -%%% The array doesn't care what goes into each position. In other words, -%%% it can be used for any datatype -- not just lines of text. -%%%---------------------------------------------------------------------- - --module(lines). --vsn('1.0'). --date('00-03-13'). --author('ulf.wiger@ericsson.com'). - --export([new/0, new/1, new/2, - count/1, - nth/2, - append/2, - replace/3, - insert/3, - insert_after/3, - delete/2, - convert_to_list/1, - convert_from_list/1]). - --define(BREAK, 10). % how many lines to store in each leaf - --define(dbg(Fmt, Args), ok=io:format("~p: " ++ Fmt, [?LINE|Args])). -%% new() -> line_array() -%% -%% Creates a new line array. -%% -new() -> - {0, []}. - - -%% see make_array(N, []). -%% -new(N) -> - new(N, []). - - -%% make an array of N lines. Each line will be initialized to DefaultLine. -%% This is _much_ faster and more space efficient than growing an -%% array line by line. -%% -new(N, DefaultLine) when N =< ?BREAK -> - {N, lists:duplicate(N, DefaultLine)}; -new(N, DefaultLine) when N =< 2*?BREAK -> - Left = {?BREAK, lists:duplicate(?BREAK,DefaultLine)}, - RightN = N - ?BREAK, - Right = {RightN, lists:duplicate(RightN, DefaultLine)}, - {N, {Left, Right}}; -new(N, DefaultLine) -> - {FullBuckets, RestLeaf, Height} = size_array(N), - FullBucket = - case FullBuckets > 0 of - true -> - {?BREAK, lists:duplicate(?BREAK, DefaultLine)}; - false -> - [] - end, - RestBucket = {RestLeaf, lists:duplicate(RestLeaf, DefaultLine)}, - {Tree,_,_} = grow_tree(1, Height, FullBuckets, FullBucket, RestBucket), - Tree. - -grow_tree(H, Height, TotB, FullB, RestB) when H < Height -> - NextH = H+1, - {{LSz,_}=Left, TotB1, RestB1} = - grow_tree(NextH, Height, TotB, FullB, RestB), - {{RSz,_}=Right, TotB2, RestB2} = - grow_tree(NextH, Height, TotB1, FullB, RestB1), - {{LSz+RSz, {Left,Right}},TotB2,RestB2}; -grow_tree(H, H, 0, _, {0,_}=Empty=_RestB) -> - {Empty,0,Empty}; -grow_tree(H,H,0,FullB,RestB) -> - {RestB,0,{0,[]}}; -grow_tree(H,H,1,FullB,{RestSz,_}=RestB) -> - {{?BREAK+RestSz, {FullB, RestB}}, 0, {0,[]}}; -grow_tree(H,H,TotB,FullB,RestB) when TotB > 1 -> - {{2*?BREAK, {FullB,FullB}},TotB-2,RestB}. - - -size_array(N) -> - FullBuckets = N div ?BREAK, - case N rem ?BREAK of - 0 -> - {BMax, Height} = calc_sz(FullBuckets), - {FullBuckets, 0, Height}; - RestLeaf -> - {BMax, Height} = calc_sz(FullBuckets+1), - {FullBuckets, RestLeaf, Height} - end. - -calc_sz(Buckets) -> - calc_sz(Buckets, Initial=2, Height=1). - -calc_sz(N, Sz, Height) when N =< Sz -> - {Sz, Height}; -calc_sz(N, Sz, Height) -> - calc_sz(N, Sz + (2 bsl Height), Height+1). - - -%% line_count(line_array()) -> integer() -%% -%% Returns the number of lines stored in the array -%% -count({N, _}) -> - N. - -%% nth(LineNo : integer(), Array : line_array()) -> line() -%% -%% Returns the line in position LineNo -%% -nth(L, _) when L < 1 -> - exit({out_of_range, L}); -nth(L, {LMax, _}) when L > LMax -> - exit({out_of_range, L}); -nth(L, {LMax, List}) when list(List) -> - lists:nth(L, List); -nth(L, {LMax, {Left = {LL, _}, Right}}) when L > LL -> - nth(L-LL, Right); -nth(L, {_, {Left, _}}) -> - nth(L, Left). - -%% append(Line : line(), Array : line_array()) -> line_array(). -%% -%% Appends Line to the end of Array. -%% e.g. append(x, [1,2,3,4]) -> [1,2,3,4,x]. -%% Returns the modified array. -%% -append(Line, {L, List}) when list(List), L < ?BREAK -> - {L+1, List ++ [Line]}; -append(Line, {L, List}) when list(List) -> - {L+1, {{L, List}, {1, [Line]}}}; -append(Line, {L, {Left = {LL1, L1}, Right}}) -> - NewRight = append(Line, Right), - balance_left(L+1, Left, NewRight). - -%% replace(LineNo : integer(), Array : line_array(), NewLine : line()) -> -%% line_array(). -%% -%% Replaces the line in position LineNo with NewLine. -%% e.g. replace(3, [1,2,3,4], x) -> [1,2,x,4]. -%% Returns the modified array. -%% -replace(Lno, _, _) when Lno < 1 -> - exit({out_of_range, Lno}); -replace(Lno, {L, _}, NewLine) when Lno > L -> - exit({out_of_range, Lno}); -replace(Lno, {L, List}, NewLine) when list(List) -> - {L, replace_nth(Lno, List, NewLine)}; -replace(Lno, {L, {Left={LL1, L1}, Right={LL2, L2}}}, NewLine) when Lno > LL1 -> - NewRight = replace(Lno-LL1, Right, NewLine), - {L, {Left, NewRight}}; -replace(Lno, {L, {Left={LL1,L1}, Right={LL2,L2}}}, NewLine) -> - NewLeft = replace(Lno, Left, NewLine), - {L, {NewLeft, Right}}. - -%% insert(LineNo : integer(), Array : line_array(), NewLine) -> line_array(). -%% -%% Inserts NewLine *before* the line in position LineNo. -%% e.g. insert(3, [1,2,3,4], x) -> [1,2,x,3,4]. -%% Returns the modified array. -%% -insert(Lno, _, _) when Lno < 1 -> - exit({out_of_range, Lno}); -insert(Lno, {L, _}, NewLine) when Lno > L -> - exit({out_of_range, Lno}); -insert(Lno, {L, List}, NewLine) when list(List) -> - if L < ?BREAK -> - {L+1, insert_nth(Lno, List, NewLine)}; - true -> - NewList = insert_nth(Lno, List, NewLine), - {L1, L2} = split_at(?BREAK, NewList), - NewL = L+1, - {NewL, {{?BREAK, L1}, {NewL-?BREAK, L2}}} - end; -insert(Lno, {L, {Left={LL,_}, Right}}, NewLine) when Lno > LL -> - NewRight = insert(Lno-LL, Right, NewLine), - balance_left(L+1, Left, NewRight); -insert(Lno, {L, {Left, Right}}, NewLine) -> - NewLeft = insert(Lno, Left, NewLine), - balance_right(L+1, NewLeft, Right). - -%% insert_after(LineNo : integer(), Array : line_array(), NewLine) -> -%% line_array(). -%% -%% Inserts NewLine *after* the line in position LineNo. -%% e.g. insert(3, [1,2,3,4], x) -> [1,2,3,x,4]. -%% Returns the modified array. -%% -insert_after(Lno, _, _) when Lno < 0 -> - exit({out_of_range, Lno}); -insert_after(Lno, {L, _}, NewLine) when Lno > L -> - exit({out_of_range, Lno}); -insert_after(L, {L,_}=Array, NewLine) -> - append(NewLine, Array); -insert_after(Lno, {L, List}, NewLine) when list(List) -> - if L < ?BREAK -> - {L+1, insert_after_nth(Lno, List, NewLine)}; - true -> - NewList = insert_after_nth(Lno, List, NewLine), - {L1, L2} = split_at(?BREAK, NewList), - NewL = L+1, - {NewL, {{?BREAK, L1}, {NewL-?BREAK, L2}}} - end; -insert_after(Lno, {L, {Left={LL,_}, Right}}, NewLine) when Lno > LL -> - NewRight = insert_after(Lno-LL, Right, NewLine), - balance_left(L+1, Left, NewRight); -insert_after(Lno, {L, {Left, Right}}, NewLine) -> - NewLeft = insert_after(Lno, Left, NewLine), - balance_right(L+1, NewLeft, Right). - - -%% delete(LineNo : integer(), Array : line_array()) -> line_array(). -%% -%% Deletes the line in position LineNo. -%% e.g. delete(3, [1,2,3,4]) -> [1,2,4]. -%% Returns the modified array. -%% -delete(Lno, _) when Lno < 1 -> - exit({out_of_range, Lno}); -delete(Lno, {N_Tot, _}) when Lno > N_Tot -> - exit({out_of_range, Lno}); -delete(Lno, {N, List}) when list(List) -> - {N-1, delete_nth(Lno, List)}; -delete(Lno, {N, {Left = {N_Left, _}, Right}}) when Lno > N_Left -> - case delete(Lno-N_Left, Right) of - {0, _} -> - case N-1 of N_Left -> ok end, % Assert - Left; - NewRight -> - balance_right(N-1, Left, NewRight) - end; -delete(Lno, {N, {Left, Right = {N_Right,_}}}) -> - case delete(Lno, Left) of - {0, _} -> - case N-1 of N_Right -> ok end, % Assert - Right; - NewLeft -> - balance_left(N-1, NewLeft, Right) - end. - -convert_to_list({_, List}) when list(List) -> - List; -convert_to_list({L, {Left, Right}}) -> - convert_to_list(Left) ++ convert_to_list(Right). - -convert_from_list(L) when list(L) -> - lists:foldl(fun(Ln, Lsx) -> - append(Ln, Lsx) - end, new(), L). - -%%% =========================================================== -%%% internal functions -%%% =========================================================== - -replace_nth(1, [H|T], X) -> - [X|T]; -replace_nth(N, [H|T], X) -> - [H|replace_nth(N-1, T, X)]. - -insert_nth(1, L, X) -> - [X|L]; -insert_nth(N, [H|T], X) -> - [H|insert_nth(N-1, T, X)]. - -insert_after_nth(1, [H|T], X) -> - [H,X|T]; -insert_after_nth(N, [H|T], X) -> - [H|insert_after_nth(N-1, T, X)]. - -delete_nth(1, [H|T]) -> - T; -delete_nth(N, [H|T]) -> - [H|delete_nth(N-1, T)]. - -%% split_at(Pos, List) -> {List1, List2} -%% split List into two after position Pos (List1 includes List[Pos]) -%% -split_at(Pos, L) -> - split_at(Pos, L, []). - -split_at(0, L, Acc) -> - {lists:reverse(Acc), L}; -split_at(Pos, [H|T], Acc) -> - split_at(Pos-1, T, [H|Acc]). - - -%% Balancing functions -%% Since we know whether we inserted/deleted in the right or left subtree, -%% we have explicit balancing functions for each case. -%% We rebalance if the number of elements in one sub-subtree exceeds the -%% sum of elements in the others. - -balance_left(N_Tot, - Left = {N_Left, _}, - Right = {N_Right, {RLeft = {N_RLeft, _}, - RRight = {N_RRight, _}}}) -> - NewN_Left = N_Left + N_RLeft, - if N_RRight > NewN_Left -> - NewLeft = {NewN_Left, {Left, RLeft}}, - NewRight = RRight, - {N_Tot, {NewLeft, NewRight}}; - true -> - {N_Tot, {Left, Right}} - end; -balance_left(N_Tot, Left, Right) -> - {N_Tot, {Left, Right}}. - -balance_right(N_Tot, - Left = {N_Left, {LLeft = {N_LLeft, _}, - LRight = {N_LRight, _}}}, - Right = {N_Right, _}) -> - NewN_Right = N_Right + N_LRight, - if N_LLeft > NewN_Right -> - NewLeft = LLeft, - NewRight = {NewN_Right, {LRight, Right}}, - {N_Tot, {NewLeft, NewRight}}; - true -> - {N_Tot, {Left, Right}} - end; -balance_right(N_Tot, Left, Right) -> - {N_Tot, {Left, Right}}. - - +%%% The contents of this file are subject to the Erlang Public License, +%%% Version 1.0, (the "License"); you may not use this file except in +%%% compliance with the License. You may obtain a copy of the License at +%%% http://www.erlang.org/license/EPL1_0.txt +%%% +%%% 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 Original Code is lines-1.0. +%%% +%%% The Initial Developer of the Original Code is Ericsson Telecom +%%% AB. Portions created by Ericsson are Copyright (C), 1998, Ericsson +%%% Telecom AB. All Rights Reserved. +%%% +%%% Contributor(s): ______________________________________. + +%%%---------------------------------------------------------------------- +%%% #0. BASIC INFORMATION +%%%---------------------------------------------------------------------- +%%% File: lines.erl +%%% Author : Ulf Wiger +%%% Description : Efficient array of lines (e.g. for text editor) +%%% Fixes: : Joe Armstrong fixed bug in replace +%%% Modules used : lists +%%% +%%%---------------------------------------------------------------------- +%%% Efficient array of lines (e.g. for text editor) +%%% allows for append, as well as insert, replace, delete in any position +%%% with reasonable access times. +%%% Rough benchmarking indicates (on a 440MHz Ultra): +%%% +%%% NoOfLines Append (uSec) Read (uSec) Delete (uSec) +%%% 100 9 7 7 +%%% 1,000 14 10 11 +%%% 10,000 22 13 15 +%%% 100,000 30 16 18 +%%% +%%% Comment on the benchmark: The times for Append and Delete are mean +%%% times for "growing file" and "shrinking file", that is, starting from +%%% an empty array and inserting 100,000 lines took ca 3 seconds; deleting +%%% them took ca 1.8 seconds. The Read test involved accessing all lines +%%% in the full array and calculating the mean time. +%%% +%%% The array doesn't care what goes into each position. In other words, +%%% it can be used for any datatype -- not just lines of text. +%%%---------------------------------------------------------------------- + +-module(lines). +-vsn('1.0'). +-date('00-03-13'). +-author('ulf.wiger@ericsson.com'). + +-export([new/0, new/1, new/2, + count/1, + nth/2, + append/2, + replace/3, + insert/3, + insert_after/3, + delete/2, + convert_to_list/1, + convert_from_list/1]). + +-define(BREAK, 10). % how many lines to store in each leaf + +-define(dbg(Fmt, Args), ok=io:format("~p: " ++ Fmt, [?LINE|Args])). +%% new() -> line_array() +%% +%% Creates a new line array. +%% +new() -> + {0, []}. + + +%% see make_array(N, []). +%% +new(N) -> + new(N, []). + + +%% make an array of N lines. Each line will be initialized to DefaultLine. +%% This is _much_ faster and more space efficient than growing an +%% array line by line. +%% +new(N, DefaultLine) when N =< ?BREAK -> + {N, lists:duplicate(N, DefaultLine)}; +new(N, DefaultLine) when N =< 2*?BREAK -> + Left = {?BREAK, lists:duplicate(?BREAK,DefaultLine)}, + RightN = N - ?BREAK, + Right = {RightN, lists:duplicate(RightN, DefaultLine)}, + {N, {Left, Right}}; +new(N, DefaultLine) -> + {FullBuckets, RestLeaf, Height} = size_array(N), + FullBucket = + case FullBuckets > 0 of + true -> + {?BREAK, lists:duplicate(?BREAK, DefaultLine)}; + false -> + [] + end, + RestBucket = {RestLeaf, lists:duplicate(RestLeaf, DefaultLine)}, + {Tree,_,_} = grow_tree(1, Height, FullBuckets, FullBucket, RestBucket), + Tree. + +grow_tree(H, Height, TotB, FullB, RestB) when H < Height -> + NextH = H+1, + {{LSz,_}=Left, TotB1, RestB1} = + grow_tree(NextH, Height, TotB, FullB, RestB), + {{RSz,_}=Right, TotB2, RestB2} = + grow_tree(NextH, Height, TotB1, FullB, RestB1), + {{LSz+RSz, {Left,Right}},TotB2,RestB2}; +grow_tree(H, H, 0, _, {0,_}=Empty=_RestB) -> + {Empty,0,Empty}; +grow_tree(H,H,0,FullB,RestB) -> + {RestB,0,{0,[]}}; +grow_tree(H,H,1,FullB,{RestSz,_}=RestB) -> + {{?BREAK+RestSz, {FullB, RestB}}, 0, {0,[]}}; +grow_tree(H,H,TotB,FullB,RestB) when TotB > 1 -> + {{2*?BREAK, {FullB,FullB}},TotB-2,RestB}. + + +size_array(N) -> + FullBuckets = N div ?BREAK, + case N rem ?BREAK of + 0 -> + {BMax, Height} = calc_sz(FullBuckets), + {FullBuckets, 0, Height}; + RestLeaf -> + {BMax, Height} = calc_sz(FullBuckets+1), + {FullBuckets, RestLeaf, Height} + end. + +calc_sz(Buckets) -> + calc_sz(Buckets, Initial=2, Height=1). + +calc_sz(N, Sz, Height) when N =< Sz -> + {Sz, Height}; +calc_sz(N, Sz, Height) -> + calc_sz(N, Sz + (2 bsl Height), Height+1). + + +%% line_count(line_array()) -> integer() +%% +%% Returns the number of lines stored in the array +%% +count({N, _}) -> + N. + +%% nth(LineNo : integer(), Array : line_array()) -> line() +%% +%% Returns the line in position LineNo +%% +nth(L, _) when L < 1 -> + exit({out_of_range, L}); +nth(L, {LMax, _}) when L > LMax -> + exit({out_of_range, L}); +nth(L, {LMax, List}) when list(List) -> + lists:nth(L, List); +nth(L, {LMax, {Left = {LL, _}, Right}}) when L > LL -> + nth(L-LL, Right); +nth(L, {_, {Left, _}}) -> + nth(L, Left). + +%% append(Line : line(), Array : line_array()) -> line_array(). +%% +%% Appends Line to the end of Array. +%% e.g. append(x, [1,2,3,4]) -> [1,2,3,4,x]. +%% Returns the modified array. +%% +append(Line, {L, List}) when list(List), L < ?BREAK -> + {L+1, List ++ [Line]}; +append(Line, {L, List}) when list(List) -> + {L+1, {{L, List}, {1, [Line]}}}; +append(Line, {L, {Left = {LL1, L1}, Right}}) -> + NewRight = append(Line, Right), + balance_left(L+1, Left, NewRight). + +%% replace(LineNo : integer(), Array : line_array(), NewLine : line()) -> +%% line_array(). +%% +%% Replaces the line in position LineNo with NewLine. +%% e.g. replace(3, [1,2,3,4], x) -> [1,2,x,4]. +%% Returns the modified array. +%% +replace(Lno, _, _) when Lno < 1 -> + exit({out_of_range, Lno}); +replace(Lno, {L, _}, NewLine) when Lno > L -> + exit({out_of_range, Lno}); +replace(Lno, {L, List}, NewLine) when list(List) -> + {L, replace_nth(Lno, List, NewLine)}; +replace(Lno, {L, {Left={LL1, L1}, Right={LL2, L2}}}, NewLine) when Lno > LL1 -> + NewRight = replace(Lno-LL1, Right, NewLine), + {L, {Left, NewRight}}; +replace(Lno, {L, {Left={LL1,L1}, Right={LL2,L2}}}, NewLine) -> + NewLeft = replace(Lno, Left, NewLine), + {L, {NewLeft, Right}}. + +%% insert(LineNo : integer(), Array : line_array(), NewLine) -> line_array(). +%% +%% Inserts NewLine *before* the line in position LineNo. +%% e.g. insert(3, [1,2,3,4], x) -> [1,2,x,3,4]. +%% Returns the modified array. +%% +insert(Lno, _, _) when Lno < 1 -> + exit({out_of_range, Lno}); +insert(Lno, {L, _}, NewLine) when Lno > L -> + exit({out_of_range, Lno}); +insert(Lno, {L, List}, NewLine) when list(List) -> + if L < ?BREAK -> + {L+1, insert_nth(Lno, List, NewLine)}; + true -> + NewList = insert_nth(Lno, List, NewLine), + {L1, L2} = split_at(?BREAK, NewList), + NewL = L+1, + {NewL, {{?BREAK, L1}, {NewL-?BREAK, L2}}} + end; +insert(Lno, {L, {Left={LL,_}, Right}}, NewLine) when Lno > LL -> + NewRight = insert(Lno-LL, Right, NewLine), + balance_left(L+1, Left, NewRight); +insert(Lno, {L, {Left, Right}}, NewLine) -> + NewLeft = insert(Lno, Left, NewLine), + balance_right(L+1, NewLeft, Right). + +%% insert_after(LineNo : integer(), Array : line_array(), NewLine) -> +%% line_array(). +%% +%% Inserts NewLine *after* the line in position LineNo. +%% e.g. insert(3, [1,2,3,4], x) -> [1,2,3,x,4]. +%% Returns the modified array. +%% +insert_after(Lno, _, _) when Lno < 0 -> + exit({out_of_range, Lno}); +insert_after(Lno, {L, _}, NewLine) when Lno > L -> + exit({out_of_range, Lno}); +insert_after(L, {L,_}=Array, NewLine) -> + append(NewLine, Array); +insert_after(Lno, {L, List}, NewLine) when list(List) -> + if L < ?BREAK -> + {L+1, insert_after_nth(Lno, List, NewLine)}; + true -> + NewList = insert_after_nth(Lno, List, NewLine), + {L1, L2} = split_at(?BREAK, NewList), + NewL = L+1, + {NewL, {{?BREAK, L1}, {NewL-?BREAK, L2}}} + end; +insert_after(Lno, {L, {Left={LL,_}, Right}}, NewLine) when Lno > LL -> + NewRight = insert_after(Lno-LL, Right, NewLine), + balance_left(L+1, Left, NewRight); +insert_after(Lno, {L, {Left, Right}}, NewLine) -> + NewLeft = insert_after(Lno, Left, NewLine), + balance_right(L+1, NewLeft, Right). + + +%% delete(LineNo : integer(), Array : line_array()) -> line_array(). +%% +%% Deletes the line in position LineNo. +%% e.g. delete(3, [1,2,3,4]) -> [1,2,4]. +%% Returns the modified array. +%% +delete(Lno, _) when Lno < 1 -> + exit({out_of_range, Lno}); +delete(Lno, {N_Tot, _}) when Lno > N_Tot -> + exit({out_of_range, Lno}); +delete(Lno, {N, List}) when list(List) -> + {N-1, delete_nth(Lno, List)}; +delete(Lno, {N, {Left = {N_Left, _}, Right}}) when Lno > N_Left -> + case delete(Lno-N_Left, Right) of + {0, _} -> + case N-1 of N_Left -> ok end, % Assert + Left; + NewRight -> + balance_right(N-1, Left, NewRight) + end; +delete(Lno, {N, {Left, Right = {N_Right,_}}}) -> + case delete(Lno, Left) of + {0, _} -> + case N-1 of N_Right -> ok end, % Assert + Right; + NewLeft -> + balance_left(N-1, NewLeft, Right) + end. + +convert_to_list({_, List}) when list(List) -> + List; +convert_to_list({L, {Left, Right}}) -> + convert_to_list(Left) ++ convert_to_list(Right). + +convert_from_list(L) when list(L) -> + lists:foldl(fun(Ln, Lsx) -> + append(Ln, Lsx) + end, new(), L). + +%%% =========================================================== +%%% internal functions +%%% =========================================================== + +replace_nth(1, [H|T], X) -> + [X|T]; +replace_nth(N, [H|T], X) -> + [H|replace_nth(N-1, T, X)]. + +insert_nth(1, L, X) -> + [X|L]; +insert_nth(N, [H|T], X) -> + [H|insert_nth(N-1, T, X)]. + +insert_after_nth(1, [H|T], X) -> + [H,X|T]; +insert_after_nth(N, [H|T], X) -> + [H|insert_after_nth(N-1, T, X)]. + +delete_nth(1, [H|T]) -> + T; +delete_nth(N, [H|T]) -> + [H|delete_nth(N-1, T)]. + +%% split_at(Pos, List) -> {List1, List2} +%% split List into two after position Pos (List1 includes List[Pos]) +%% +split_at(Pos, L) -> + split_at(Pos, L, []). + +split_at(0, L, Acc) -> + {lists:reverse(Acc), L}; +split_at(Pos, [H|T], Acc) -> + split_at(Pos-1, T, [H|Acc]). + + +%% Balancing functions +%% Since we know whether we inserted/deleted in the right or left subtree, +%% we have explicit balancing functions for each case. +%% We rebalance if the number of elements in one sub-subtree exceeds the +%% sum of elements in the others. + +balance_left(N_Tot, + Left = {N_Left, _}, + Right = {N_Right, {RLeft = {N_RLeft, _}, + RRight = {N_RRight, _}}}) -> + NewN_Left = N_Left + N_RLeft, + if N_RRight > NewN_Left -> + NewLeft = {NewN_Left, {Left, RLeft}}, + NewRight = RRight, + {N_Tot, {NewLeft, NewRight}}; + true -> + {N_Tot, {Left, Right}} + end; +balance_left(N_Tot, Left, Right) -> + {N_Tot, {Left, Right}}. + +balance_right(N_Tot, + Left = {N_Left, {LLeft = {N_LLeft, _}, + LRight = {N_LRight, _}}}, + Right = {N_Right, _}) -> + NewN_Right = N_Right + N_LRight, + if N_LLeft > NewN_Right -> + NewLeft = LLeft, + NewRight = {NewN_Right, {LRight, Right}}, + {N_Tot, {NewLeft, NewRight}}; + true -> + {N_Tot, {Left, Right}} + end; +balance_right(N_Tot, Left, Right) -> + {N_Tot, {Left, Right}}. + + diff --git a/lib/lisperl/Makefile b/lib/lisperl/Makefile index fbd0b91..b7eb9c3 100644 --- a/lib/lisperl/Makefile +++ b/lib/lisperl/Makefile @@ -1 +1 @@ -include ../../support/subdir.mk +include ../../support/subdir.mk diff --git a/lib/plain_fsm/doc/pots/orig/control.erl.txt b/lib/plain_fsm/doc/pots/orig/control.erl.txt index 7d408c6..d28ef79 100644 --- a/lib/plain_fsm/doc/pots/orig/control.erl.txt +++ b/lib/plain_fsm/doc/pots/orig/control.erl.txt @@ -1,163 +1,163 @@ -%%% Copyright (C) 1998 Ericsson Software Technology AB, Erlang Systems -%%% File : control.erl -%%% Created : 12 Jun 1998 by Håkan Huss - --module(control). - --export([start/0]). - -start() -> - idle(). - -idle() -> - receive - {lim, offhook} -> - lim:start_tone(dial), - getting_first_digit(); - {lim, {digit, _Digit}} -> - idle(); - {Pid, request_connection} -> - Pid ! {self(), accept}, - lim:start_ringing(), - ringing_B_side(Pid); - Other -> - io:format("Got unknown message in idle: ~p~n", [Other]), - idle() - end. - -getting_first_digit() -> - receive - {lim, onhook} -> - lim:stop_tone(), - idle(); - {lim, {digit, Digit}} -> - lim:stop_tone(), - getting_number(Digit, - number:analyse(Digit, number:valid_sequences())); - {Pid, request_connection} -> - Pid ! {self(), reject}, - getting_first_digit(); - Other -> - io:format("Got unknown message in getting_first_digit: ~p~n", - [Other]), - getting_first_digit() - end. - -getting_number(_Number, invalid) -> - lim:start_tone(fault), - wait_on_hook(true); -getting_number(Number, valid) -> - PidB = lim:pid_with_phone_number(Number), - PidB ! {self(), request_connection}, - calling_B(PidB); -getting_number(Number, {incomplete, ValidSeqs}) -> - receive - {lim, onhook} -> - idle(); - {lim, {digit, Digit}} -> - getting_number(10 * Number + Digit, - number:analyse(Digit, ValidSeqs)); - {Pid, request_connection} -> - Pid ! {self(), reject}, - getting_number(Number, {incomplete, ValidSeqs}); - Other -> - io:format("Got unknown message in getting_number: ~p~n", [Other]), - getting_number(Number, {incomplete, ValidSeqs}) - end. - -calling_B(PidB) -> - receive - {lim, onhook} -> - idle(); - {lim, {digit, _Digit}} -> - calling_B(PidB); - {PidB, accept} -> - lim:start_tone(ring), - ringing_A_side(PidB); - {PidB, reject} -> - lim:start_tone(busy), - wait_on_hook(true); - {Pid, request_connection} -> - Pid ! {self(), reject}, - calling_B(PidB); - Other -> - io:format("Got unknown message in calling_B: ~p~n", [Other]), - calling_B(PidB) - end. - -ringing_A_side(PidB) -> - receive - {PidB, connect} -> - lim:stop_tone(), - lim:connect_to(PidB), - speech(PidB); - {lim, onhook} -> - PidB ! {self(), cancel}, - lim:stop_tone(), - idle(); - {lim, {digit, _Digit}} -> - ringing_A_side(PidB); - {Pid, request_connection} -> - Pid ! {self(), reject}, - ringing_A_side(PidB); - Other -> - io:format("Got unknown message in ringing_A_side: ~p~n", [Other]), - ringing_A_side(PidB) - end. - -speech(OtherPid) -> - receive - {lim, onhook} -> - lim:disconnect_from(OtherPid), - OtherPid ! {self(), cancel}, - idle(); - {lim, {digit, _Digit}} -> - speech(OtherPid); - {OtherPid, cancel} -> - wait_on_hook(false); - {Pid, request_connection} -> - Pid ! {self(), reject}, - speech(OtherPid); - Other -> - io:format("Got unknown message in speech: ~p~n", [Other]), - speech(OtherPid) - end. - -wait_on_hook(Have_tone) -> - receive - {lim, onhook} -> - case Have_tone of - true -> - lim:stop_tone(); - _ -> - nothing - end, - idle(); - {lim, {digit, _Digit}} -> - wait_on_hook(Have_tone); - {Pid, request_connection} -> - Pid ! {self(), reject}, - wait_on_hook(Have_tone); - Other -> - io:format("Got unknown message in wait_on_hook: ~p~n", [Other]), - wait_on_hook(Have_tone) - end. - -ringing_B_side(PidA) -> - receive - {lim, offhook} -> - lim:stop_ringing(), - PidA ! {self(), connect}, - speech(PidA); - {PidA, cancel} -> - lim:stop_ringing(), - idle(); - {lim, {digit, _Digit}} -> - ringing_B_side(PidA); - {Pid, request_connection} -> - Pid ! {self(), reject}, - ringing_B_side(PidA); - Other -> - io:format("Got unknown message in ringing_B_side: ~p~n", [Other]), - ringing_B_side(PidA) - end. +%%% Copyright (C) 1998 Ericsson Software Technology AB, Erlang Systems +%%% File : control.erl +%%% Created : 12 Jun 1998 by Håkan Huss + +-module(control). + +-export([start/0]). + +start() -> + idle(). + +idle() -> + receive + {lim, offhook} -> + lim:start_tone(dial), + getting_first_digit(); + {lim, {digit, _Digit}} -> + idle(); + {Pid, request_connection} -> + Pid ! {self(), accept}, + lim:start_ringing(), + ringing_B_side(Pid); + Other -> + io:format("Got unknown message in idle: ~p~n", [Other]), + idle() + end. + +getting_first_digit() -> + receive + {lim, onhook} -> + lim:stop_tone(), + idle(); + {lim, {digit, Digit}} -> + lim:stop_tone(), + getting_number(Digit, + number:analyse(Digit, number:valid_sequences())); + {Pid, request_connection} -> + Pid ! {self(), reject}, + getting_first_digit(); + Other -> + io:format("Got unknown message in getting_first_digit: ~p~n", + [Other]), + getting_first_digit() + end. + +getting_number(_Number, invalid) -> + lim:start_tone(fault), + wait_on_hook(true); +getting_number(Number, valid) -> + PidB = lim:pid_with_phone_number(Number), + PidB ! {self(), request_connection}, + calling_B(PidB); +getting_number(Number, {incomplete, ValidSeqs}) -> + receive + {lim, onhook} -> + idle(); + {lim, {digit, Digit}} -> + getting_number(10 * Number + Digit, + number:analyse(Digit, ValidSeqs)); + {Pid, request_connection} -> + Pid ! {self(), reject}, + getting_number(Number, {incomplete, ValidSeqs}); + Other -> + io:format("Got unknown message in getting_number: ~p~n", [Other]), + getting_number(Number, {incomplete, ValidSeqs}) + end. + +calling_B(PidB) -> + receive + {lim, onhook} -> + idle(); + {lim, {digit, _Digit}} -> + calling_B(PidB); + {PidB, accept} -> + lim:start_tone(ring), + ringing_A_side(PidB); + {PidB, reject} -> + lim:start_tone(busy), + wait_on_hook(true); + {Pid, request_connection} -> + Pid ! {self(), reject}, + calling_B(PidB); + Other -> + io:format("Got unknown message in calling_B: ~p~n", [Other]), + calling_B(PidB) + end. + +ringing_A_side(PidB) -> + receive + {PidB, connect} -> + lim:stop_tone(), + lim:connect_to(PidB), + speech(PidB); + {lim, onhook} -> + PidB ! {self(), cancel}, + lim:stop_tone(), + idle(); + {lim, {digit, _Digit}} -> + ringing_A_side(PidB); + {Pid, request_connection} -> + Pid ! {self(), reject}, + ringing_A_side(PidB); + Other -> + io:format("Got unknown message in ringing_A_side: ~p~n", [Other]), + ringing_A_side(PidB) + end. + +speech(OtherPid) -> + receive + {lim, onhook} -> + lim:disconnect_from(OtherPid), + OtherPid ! {self(), cancel}, + idle(); + {lim, {digit, _Digit}} -> + speech(OtherPid); + {OtherPid, cancel} -> + wait_on_hook(false); + {Pid, request_connection} -> + Pid ! {self(), reject}, + speech(OtherPid); + Other -> + io:format("Got unknown message in speech: ~p~n", [Other]), + speech(OtherPid) + end. + +wait_on_hook(Have_tone) -> + receive + {lim, onhook} -> + case Have_tone of + true -> + lim:stop_tone(); + _ -> + nothing + end, + idle(); + {lim, {digit, _Digit}} -> + wait_on_hook(Have_tone); + {Pid, request_connection} -> + Pid ! {self(), reject}, + wait_on_hook(Have_tone); + Other -> + io:format("Got unknown message in wait_on_hook: ~p~n", [Other]), + wait_on_hook(Have_tone) + end. + +ringing_B_side(PidA) -> + receive + {lim, offhook} -> + lim:stop_ringing(), + PidA ! {self(), connect}, + speech(PidA); + {PidA, cancel} -> + lim:stop_ringing(), + idle(); + {lim, {digit, _Digit}} -> + ringing_B_side(PidA); + {Pid, request_connection} -> + Pid ! {self(), reject}, + ringing_B_side(PidA); + Other -> + io:format("Got unknown message in ringing_B_side: ~p~n", [Other]), + ringing_B_side(PidA) + end. diff --git a/lib/quickcheck/include/quickcheck.hrl b/lib/quickcheck/include/quickcheck.hrl index 5e1ab55..a9b594b 100644 --- a/lib/quickcheck/include/quickcheck.hrl +++ b/lib/quickcheck/include/quickcheck.hrl @@ -1,15 +1,15 @@ --define(LET(X,G1,G2),qc:bind(G1,fun(X)->G2 end)). --define(IMPLIES(B,T),qc:implies(B,fun(Size)->qc:test(T,Size) end)). --define(FORALL(X,G,T),qc:forall((G),fun(X)->T end)). --define(SIZED(S,G),qc:sized(fun(S)->G end)). --define(TRACE(T,P),qc:trace(T,fun()->P end)). --import(qc,[two/1,int/0,nat/0,bool/0,list/1,function/1,oneof/1,frequency/1,return/1,resize/2,collect/2,within/2,sample/1,eval/1,sample_traces/1,sample_traces/3,trace/2,event/1,pause/0,rename_pids/1,nowaits/1,next/1,empty/0,always/1,always/2,eventually/1,eventually/2,until/2,tnot/1,tand/2,tor/2,timplies/2,matches/1,satisfies/2,mortal/0,killer/3,killer/4]). - -% macros for trace properties --define(MATCHES(P),qc:matches(fun(P)->true end)). --define(NOW(Pat,P),qc:matches(fun(Pat)->P end)). --define(TIMPLIES(P,Q),fun(Trace)->case P(Trace) of true -> Q(Trace); _ -> true end end). --define(TAND(P,Q),fun(Trace)->case P(Trace) of true->Q(Trace); _ -> false end end). --define(TOR(P,Q),fun(Trace)->case P(Trace) of true->true; _ -> Q(Trace) end end). --define(TNOT(P),fun(Trace)->not P(Trace) end). +-define(LET(X,G1,G2),qc:bind(G1,fun(X)->G2 end)). +-define(IMPLIES(B,T),qc:implies(B,fun(Size)->qc:test(T,Size) end)). +-define(FORALL(X,G,T),qc:forall((G),fun(X)->T end)). +-define(SIZED(S,G),qc:sized(fun(S)->G end)). +-define(TRACE(T,P),qc:trace(T,fun()->P end)). +-import(qc,[two/1,int/0,nat/0,bool/0,list/1,function/1,oneof/1,frequency/1,return/1,resize/2,collect/2,within/2,sample/1,eval/1,sample_traces/1,sample_traces/3,trace/2,event/1,pause/0,rename_pids/1,nowaits/1,next/1,empty/0,always/1,always/2,eventually/1,eventually/2,until/2,tnot/1,tand/2,tor/2,timplies/2,matches/1,satisfies/2,mortal/0,killer/3,killer/4]). + +% macros for trace properties +-define(MATCHES(P),qc:matches(fun(P)->true end)). +-define(NOW(Pat,P),qc:matches(fun(Pat)->P end)). +-define(TIMPLIES(P,Q),fun(Trace)->case P(Trace) of true -> Q(Trace); _ -> true end end). +-define(TAND(P,Q),fun(Trace)->case P(Trace) of true->Q(Trace); _ -> false end end). +-define(TOR(P,Q),fun(Trace)->case P(Trace) of true->true; _ -> Q(Trace) end end). +-define(TNOT(P),fun(Trace)->not P(Trace) end). -define(AFTER(Pat,P),qc:tafter(fun(Pat)->P end)). \ No newline at end of file diff --git a/lib/rpc/CHANGELOG b/lib/rpc/CHANGELOG index 405ebda..5c7220d 100644 --- a/lib/rpc/CHANGELOG +++ b/lib/rpc/CHANGELOG @@ -1,3 +1,7 @@ +1.1 - 120730 - beta1 - Rui Xie, Alcatel-Lucent, Inc: + - fix xdr parsing of enum, union + - add feature random encoding for XDR encoding/decoding. + 1.1 - 010903 - release - Martin Björklund, Alteon WebSystems: - timeout fix. the timeout specified is now RPC timeout, as it's diff --git a/lib/rpc/LICENSE b/lib/rpc/LICENSE index 1e9aaf2..d2c2380 100644 --- a/lib/rpc/LICENSE +++ b/lib/rpc/LICENSE @@ -53,4 +53,4 @@ each of the following conditions is met: ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -$Revision$, Last updated $Date$ +$Revision: 1.2.4.2 $, Last updated $Date: 2001/05/04 20:13:21 $ diff --git a/lib/rpc/doc/README b/lib/rpc/doc/README index 8a43b33..9146985 100644 --- a/lib/rpc/doc/README +++ b/lib/rpc/doc/README @@ -106,14 +106,23 @@ callback module of behaviour 'rpc_server'. This means that a RPC CALL maps to a gen_server:call (see rpc/stack.erl for an example), or directly to a call to a user-defined module (see API.txt for more details). +5. Usage of random encoding function +------------------------ -5. Examples +The generated _xdr.erl file is used to encode/decode the XDR defined +data structure. Each data structure has it's encode/decode function. +To use the random encoding function, just need pass "{}" to encode function. + As in the test case for test.x, + call encode function as enc_t_primitive_struct({}) + + +6. Examples ----------- There are some working examples in the examples/ directory. -6. TODO +7. TODO -------- * The only supported authentication methods are AUTH_NULL and @@ -138,5 +147,5 @@ There are some working examples in the examples/ directory. * strings should be represented as lists, not binaries. -7. HAVE FUN +8. HAVE FUN ----------- diff --git a/lib/rpc/rpc.pub b/lib/rpc/rpc.pub index 7f0a723..948f4dc 100644 --- a/lib/rpc/rpc.pub +++ b/lib/rpc/rpc.pub @@ -5,6 +5,7 @@ {author, "Scott Fritchie", "scott@sendmail.com", "000815"}. {author, "Jim Larson", "jim@sendmail.com", "000815"}. {author, "Martin Bjorklund", "mbj@bluetail.com", "001110"}. +{author, "Rui Xie", "rui.xie@anansimobile.org", "120730" {keywords, ["ONC/RPC", "stub generator", "XDR", "RPC", "portmapper"]}. {needs, []}. {abstract,"This is a stub generator for the ONC/RPC protocol. Given a diff --git a/lib/rpc/src/Makefile b/lib/rpc/src/Makefile index e7ce779..d74b511 100644 --- a/lib/rpc/src/Makefile +++ b/lib/rpc/src/Makefile @@ -1,11 +1,21 @@ # Copyright (c) 2000, 2001 Sendmail, Inc. All rights reserved. # This Makefile may require GNU make. -include ../../../support/include.mk include ../vsn.mk -ERLC_FLAGS += -I ../.. - +# Override these as necessary for your Erlang environment. +#KERNEL_VSN=2.6.1.2.1 +#STDLIB_VSN=1.9.1.1 +#ERTS_VSN=5.0.1.1.b3 +KERNEL_VSN=2.15.1 +STDLIB_VSN=1.18.1 +ERTS_VSN=5.9.1 +EMULATOR = beam +ERLC = erlc +ERL = erl +# + +EBIN=../ebin ESRC=. ERPCGEN = ../priv/erpcgen ERPCGEN_OPTS = @@ -18,6 +28,10 @@ RPC_MODULES = rpc_client rpc_xdr rpc_server \ MODULES = $(RPC_MODULES) $(ERPCGEN_MODULES) +# This is a Perl script for producing .app files from a template +# +APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/%VSN%/$$vsn/; s/%MODULES%/$$mods/; print; }' + ERPCGEN_TARGET_FILES= $(ERPCGEN_MODULES:%=../ebin/%.$(EMULATOR)) RPC_TARGET_FILES= $(RPC_MODULES:%=../ebin/%.$(EMULATOR)) TARGET_FILES= $(MODULES:%=../ebin/%.$(EMULATOR)) $(ERPCGEN) @@ -28,16 +42,32 @@ TARGET_FILES= $(MODULES:%=../ebin/%.$(EMULATOR)) $(ERPCGEN) %_clnt.erl: %.x $(ERPCGEN) $(ERPCGEN) -a '[clnt]' $* -# $(EBIN)/%.$(EMULATOR): $(ESRC)/%.erl -# $(ERLC) $(ERLC_FLAGS) -o$(EBIN) $< +$(EBIN)/%.$(EMULATOR): $(ESRC)/%.erl + $(ERLC) -b$(EMULATOR) $(ERL_FLAGS) $(ERL_COMPILE_FLAGS) -o$(EBIN) $< -all: $(TARGET_FILES) +all: $(TARGET_FILES) erpcgen.boot erpcgen.script ../ebin/rpc.app -$(ERPCGEN): erpcgen.src $(ERPCGEN_TARGET_FILES) +$(ERPCGEN): erpcgen.boot erpcgen.script sed -e 's;%ERL%;$(ERL);' \ erpcgen.src > $(ERPCGEN) chmod u+x $(ERPCGEN) +erpcgen.boot erpcgen.script: ../ebin/erpcgen.app erpcgen.rel $(ERPCGEN_TARGET_FILES) + $(ERLC) -pa ../ebin erpcgen.rel + +erpcgen.rel: erpcgen.rel.src + sed -e 's;%ERTS_VSN%;$(ERTS_VSN);' \ + -e 's;%KERNEL_VSN%;$(KERNEL_VSN);' \ + -e 's;%STDLIB_VSN%;$(STDLIB_VSN);' \ + -e 's;%ERPCGEN_VSN%;$(ERPCGEN_VSN);' \ + erpcgen.rel.src > erpcgen.rel + +../ebin/erpcgen.app: erpcgen.app.src + perl -e $(APPSCRIPT) "$(ERPCGEN_VSN)" $(ERPCGEN_MODULES) < $< > $@ + +../ebin/rpc.app: rpc.app.src + perl -e $(APPSCRIPT) "$(RPC_VSN)" $(RPC_MODULES) < $< > $@ + xdr_parse.erl: xdr.yrl $(ERLC) -o xdr_parse.erl xdr.yrl diff --git a/lib/rpc/src/erpcgen.erl b/lib/rpc/src/erpcgen.erl index feb8195..f68b0d1 100644 --- a/lib/rpc/src/erpcgen.erl +++ b/lib/rpc/src/erpcgen.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2000 Sendmail, Inc. All rights reserved. +%% Copyright (c) 2000, 2001 Sendmail, Inc. All rights reserved. %% %% Compile xdr files into erlang modules %% @@ -250,6 +250,9 @@ gen_xdr_base(Fd, Base, Spec, Type) -> gen_map_elem(get(map_elem), Fd), gen_io_list_len(get(io_list_len), Fd), gen_enc_align(get(enc_align), Fd), + gen_enc_random(get(enc_random), Fd), + gen_enc_random_bytes(get(enc_random_bytes), Fd), + gen_enc_random_string(get(enc_random_string), Fd), gen_align(get(align), Fd). @@ -274,11 +277,11 @@ gen_io_list_len(true, Fd) -> "io_list_len([H|T], N) ->\n" " if\n" " H >= 0, H =< 255 -> io_list_len(T, N+1);\n" - " list(H) -> io_list_len(T, io_list_len(H,N));\n" - " binary(H) -> io_list_len(T, size(H) + N);\n" + " is_list(H) -> io_list_len(T, io_list_len(H,N));\n" + " is_binary(H) -> io_list_len(T, size(H) + N);\n" " true -> exit({xdr, opaque})\n" " end;\n" - "io_list_len(H, N) when binary(H) ->\n" + "io_list_len(H, N) when is_binary(H) ->\n" " size(H) + N;\n" "io_list_len([], N) ->\n" "N.\n", []); @@ -298,6 +301,32 @@ gen_enc_align(true, Fd) -> gen_enc_align(_, _Fd) -> ok. +gen_enc_random(true, Fd) -> + io:format(Fd, + "\nenc_random(Roof,Offset) ->\n" + " random:uniform(Roof) + Offset.\n",[]); +gen_enc_random(_, _Fd) -> + ok. + +gen_enc_random_bytes(true, Fd) -> + io:format(Fd, + "\nenc_random_bytes(Len) ->\n" + " [<<(random:uniform(256) - 1):8/unsigned>> || _H <- lists:seq(1,Len)] ++\n" + " [enc_align(Len)]. \n" + ,[]); +gen_enc_random_bytes(_,_Fd) -> + ok. + +gen_enc_random_string(true, Fd) -> + io:format(Fd, + "\nenc_random_string(Len) ->\n" + " [<<(random:uniform(93) + 31):8/unsigned>> || _H <- lists:seq(1,Len)] ++\n" + " [enc_align(Len)]. \n" + ,[]); +gen_enc_random_string(_,_Fd) -> + ok. + + gen_align(true, Fd) -> io:format(Fd, "\nalign(Len) ->\n" @@ -686,6 +715,21 @@ trans_struct_elems([], _, _) -> []. %% Check union elements %% The Tag is translated as Tag -> {Tag,Value} %% +%% by Rui Xie +%% 1. Firstly change the restriction of Id to {Tag,Id} pair. Same Id can be existed in one union but should be distinct under one tag. +%% 2. Add specical case of multi case for one definition. +%% 3. Add void case for union. +%% Example: +%% union Trace_MgtTrace_t switch (Trace_MgtCause_t type) +%%{ +%% case TRACE_FIRST_RECORD : +%% case TRACE_LAST_RECORD : +%% case TRACE_EMERGENCY_CALL_END: +%% Trace_firstAndlastRecordParams_t firstAndlastRecord; +%% case TRACE_CN_INVOKE_TRACE : +%% Trace_CnInvokeParams_t cnInvTrace; +%%} + trans_union_elems([{Tag,Line,{Id,_,Type}} | Elems],Tags,Ids,Vals,Env,Disc) -> Tag1 = trans_tag(Tag), case member(Tag1, Tags) of @@ -695,10 +739,35 @@ trans_union_elems([{Tag,Line,{Id,_,Type}} | Elems],Tags,Ids,Vals,Env,Disc) -> Ids1 = if Id == [] -> Ids; true -> - case member(Id, Ids) of - true -> error(Line, "union id ~s multiply defined", [Id]), + case member({Tag1,Id}, Ids) of + true -> error(Line, "union id ~s multiply defined", [{Tag1,Id}]), + Ids; + false -> [{Tag1,Id} | Ids] + end + end, + Type1 = trans_type(Type, Env), + Tag2 = {_,Val} = trans_tag_type(Tag1, Line, Env, Disc), + Vals1 = case member(Val, Vals) of + true -> error(Line, "case ~w multiply defined", [Val]), Vals; + false -> [Val | Vals] + end, + [{ Tag2, {Id, Type1}} | + trans_union_elems(Elems, [Tag|Tags], Ids1, Vals1, Env, Disc)]; + +trans_union_elems([{Tag,Line} | Elems],Tags,Ids,Vals,Env,Disc) -> + Tag1 = trans_tag(Tag), + case member(Tag1, Tags) of + true -> error(Line, "union tag ~w multiply defined", [Tag1]); + false -> true + end, + {Id,Type} = gets_union_elems_id(Elems), + Ids1 = + if Id == [] -> Ids; + true -> + case member({Tag1,Id}, Ids) of + true -> error(Line, "union id ~s multiply defined", [{Tag1,Id}]), Ids; - false -> [Id | Ids] + false -> [{Tag1,Id} | Ids] end end, Type1 = trans_type(Type, Env), @@ -711,6 +780,19 @@ trans_union_elems([{Tag,Line,{Id,_,Type}} | Elems],Tags,Ids,Vals,Env,Disc) -> trans_union_elems(Elems, [Tag|Tags], Ids1, Vals1, Env, Disc)]; trans_union_elems([], _, _, _, _,_) -> []. +gets_union_elems_id([{Tag,Line,{Id,_,Type}} | Elems]) -> +%% io:format("Debug: ~p, ~p, ~p, ~p~n",[Tag,Line,Id,Type]), +%% {Id1,Type1}= +%% if Id == [] -> error(Line, "union definition is incorrect!"), +%% {Id,Type}; +%% true -> {Id,Type} +%% end, +%% {Id1,Type1}; + {Id,Type}; +gets_union_elems_id([{Tag,Line} | Elems]) -> + gets_union_elems_id(Elems). + + trans_tag({identifier,_,Id}) -> Id; trans_tag({integer,_,Value}) -> Value; trans_tag(default) -> default. @@ -763,17 +845,47 @@ trans_disc_type(T, Line, Env) -> %% i.e exactly one of each identifier %% exactly one of each value %% +%% Add special case for enums: +%% enum t_enum { +%% T_ENUM_0 = 0, +%% T_ENUM_1, +%% T_ENUM_2 +%%}; +%% Add context dependence. +%% ValueInit means the current initial value based on previous enum item value. + trans_enum(Enums, Env) -> - trans_enums(Enums, Env, []). + trans_enums(Enums, Env, [],{integer,"hello",0}). -trans_enums([{Tag,Line,Value} | Es], Env, Ids) -> +trans_enums([{Tag,Line,Value} | Es], Env, Ids, ValueInit) -> V = trans_value(Value, Env), case member(Tag, Ids) of true -> error(Line, "enumeration ~s multiply defined", [Tag]); false -> true end, - [{Tag,V} | trans_enums(Es, Env, [Tag|Ids])]; -trans_enums([], _, _) -> []. + [{Tag,V} | trans_enums(Es, Env, [Tag|Ids],{integer,"hello",V+1})]; +trans_enums([{Tag,Line} | Es], Env, Ids, ValueInit) -> + %Value={integer,"hello",ValueInit}, +%% Value=ValueInit, +%% io:format("Enter 2 col enum fun.~n"), + V = trans_value(ValueInit, Env), + case member(Tag, Ids) of + true -> error(Line, "enumeration ~s multiply defined", [Tag]); + false -> true + end, + [{Tag,V} | trans_enums(Es, Env, [Tag|Ids], {integer,"hello",V+1})]; + +%%trans_enums([{Tag,Line} | Es], Env, Ids, Value) -> +%% V = trans_value(Value, Env), +%%io:format("Enter 4 parameter trans_enums.~n"), +%% case member(Tag, Ids) of +%% true -> error(Line, "enumeration ~s multiply defined", [Tag]); +%% false -> true +%% end, +%%PV=V+1, +%% [{Tag,V} | trans_enums(Es, Env, [Tag|Ids], {integer,"hello",PV})]; + +trans_enums([], _, _, _) -> []. trans_value({integer,_,Value}, Env) -> Value; diff --git a/lib/rpc/src/erpcgen.src b/lib/rpc/src/erpcgen.src index 6846ac2..4023de1 100644 --- a/lib/rpc/src/erpcgen.src +++ b/lib/rpc/src/erpcgen.src @@ -64,8 +64,8 @@ fi noxinfile=`echo $infile | sed 's;.x$;;'` -if [ ! -f $noxinfile.x ]; then - echo "Sorry, file $noxinfile.x does not exist" +if [ ! -f $xfile ]; then + echo "Sorry, file $xfile does not exist" exit 1 fi @@ -82,7 +82,7 @@ esac noxoutfile=`echo $outfile | sed 's;.x$;;'` -%ERL% -pa $lib_path -noshell \ +%ERL% -boot $erpcgen_boot -pa $lib_path -noshell \ -s erpcgen start -s erlang halt -- \ -infile $noxinfile -outfile $noxoutfile -options $optarg diff --git a/lib/rpc/src/pmap.erl b/lib/rpc/src/pmap.erl index 4687986..e094d62 100644 --- a/lib/rpc/src/pmap.erl +++ b/lib/rpc/src/pmap.erl @@ -2,7 +2,7 @@ %%% Author : Tony Rogvall %%% Purpose : Port mapper interface %%% Created : 14 Aug 1997 by Tony Rogvall -%%% Copyright (c) 2000 Sendmail, Inc. All rights reserved. +%%% Copyright (c) 2000, 2001 Sendmail, Inc. All rights reserved. -module(pmap). -compile([verbose, report_errors, report_warnings, trace]). diff --git a/lib/rpc/src/rpc_client.erl b/lib/rpc/src/rpc_client.erl index 1737c8b..1d08384 100644 --- a/lib/rpc/src/rpc_client.erl +++ b/lib/rpc/src/rpc_client.erl @@ -1,4 +1,4 @@ -%%% Copyright (c) 2000 Sendmail, Inc. All rights reserved. +%%% Copyright (c) 2000, 2001 Sendmail, Inc. All rights reserved. %%% ONC/RPC client-side server: takes RPC requests with XDR-encoded %%% arguments, transmits them over the network, and receives the reply. @@ -448,24 +448,16 @@ make_call2(From, Size, Call, Timeout, S, Procedure, Timers0) -> case Tm of infinity -> Timers0; - 0 -> - Timers0; _ -> Timer = erlang:send_after(Tm, self(), {timeout, S#state.xid}), [Timer | Timers0] end, - case Tm of - 0 -> - {reply, {error, timeout}, S#state{xid = S#state.xid+1}}; - _ -> - Pnew = #pending{from = From, start_time = now(), - timers = Timers1, - bytes_out = Size, - xid = S#state.xid, packet = Call}, - S1 = S#state{xid = S#state.xid+1, pending = [Pnew|Ps], - pendinglen = Plen + 1}, - {noreply, incr_call_stats(S1, Procedure)} - end. + Pnew = #pending{from = From, start_time = now(), + timers = Timers1, + bytes_out = Size, xid = S#state.xid, packet = Call}, + S1 = S#state{xid = S#state.xid+1, pending = [Pnew|Ps], + pendinglen = Plen + 1}, + {noreply, incr_call_stats(S1, Procedure)}. %%% Process an RPC reply by extracting caller from pending queue, decoding %%% the reply RPC header, and updating the pending queue and statistics. diff --git a/lib/rpc/src/rpc_server.erl b/lib/rpc/src/rpc_server.erl index ce1ba4a..cc0bcf6 100644 --- a/lib/rpc/src/rpc_server.erl +++ b/lib/rpc/src/rpc_server.erl @@ -1,3 +1,4 @@ +%%% Copyright (c) 2000, 2001 Sendmail, Inc. All rights reserved. %%%---------------------------------------------------------------------- %%% File : rpc_server.erl %%% Author : Martin Bjorklund diff --git a/lib/rpc/src/xdr.yrl b/lib/rpc/src/xdr.yrl index fdeeb48..81bf01b 100644 --- a/lib/rpc/src/xdr.yrl +++ b/lib/rpc/src/xdr.yrl @@ -1,4 +1,4 @@ -%% Copyright (c) 2000 Sendmail, Inc. All rights reserved. +%% Copyright (c) 2000, 2001 Sendmail, Inc. All rights reserved. %% %% XDR + RPC grammar file %% @@ -106,6 +106,10 @@ enum_decls -> identifier '=' value ',' enum_decls : [{val('$1'), line('$1'), '$3'} | '$5']. enum_decls -> identifier '=' value : [{val('$1'), line('$1'), '$3'}]. +enum_decls -> identifier ',' enum_decls : + [{val('$1'), line('$1')} | '$3']. +enum_decls -> identifier : + [{val('$1'), line('$1')}]. struct_type_spec -> 'struct' struct_body : {struct, line('$1'), '$2'}. @@ -123,6 +127,8 @@ union_body -> 'switch' '(' declaration ')' '{' case_decls default_decl '}' : case_decls -> 'case' value ':' declaration ';' case_decls : [{'$2', line('$1'), '$4'} | '$6']. +case_decls -> 'case' value ':' case_decls : + [{'$2', line('$1')} | '$4']. case_decls -> 'case' value ':' declaration ';' : [{'$2', line('$1'), '$4'}]. diff --git a/lib/rpc/src/xdr_auth.erl b/lib/rpc/src/xdr_auth.erl index 5c6a33a..3a5e973 100644 --- a/lib/rpc/src/xdr_auth.erl +++ b/lib/rpc/src/xdr_auth.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2000 Sendmail, Inc. All rights reserved. +%% Copyright (c) 2000, 2001 Sendmail, Inc. All rights reserved. %% %% RCP authentication module %% diff --git a/lib/rpc/src/xdr_scan.erl b/lib/rpc/src/xdr_scan.erl index 2bff9f0..d24c43c 100644 --- a/lib/rpc/src/xdr_scan.erl +++ b/lib/rpc/src/xdr_scan.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2000 Sendmail, Inc. All rights reserved. +%% Copyright (c) 2000, 2001 Sendmail, Inc. All rights reserved. %% %% Scanner for XDR specifications %% diff --git a/lib/rpc/src/xdrgen.erl b/lib/rpc/src/xdrgen.erl index e0cc81f..00aba6a 100644 --- a/lib/rpc/src/xdrgen.erl +++ b/lib/rpc/src/xdrgen.erl @@ -50,6 +50,7 @@ mkblock(Es) -> {block,0,Es}. mkmodule(M) -> {attribute,0,module,M}. mkexport(F,A) -> {attribute,0,export,[{F,A}]}. mkfunction(Name,Arity,CL) -> {function,0,Name,Arity,CL}. +mkstring(X) -> {string,0,X}. mkbin(Elems) -> {bin, 0, Elems}. mkbinelem(Expr, Sz, Types) -> {bin_element, 0, Expr, Sz, Types}. @@ -111,32 +112,64 @@ encode({type,Id,Type}, Fs0) -> %% <> enc_prim_type(int, V, R) -> - {mkbin([mkbinelem(V, mkint(32), default)]), R}; + put(enc_random, true), + case V of + {_,_,'{}'} -> +%%io:format("{} found.~n"), + {mkbin([mkbinelem(mkcall(enc_random,[mkint(65535),mkint(0)]),mkint(32), default)]),R}; + + _ -> + {mkbin([mkbinelem(V, mkint(32), default)]), R} + end; enc_prim_type(unsigned_int, V, R) -> enc_prim_type(int, V, R); %% <> enc_prim_type(hyper, V, R) -> - {mkbin([mkbinelem(V, mkint(64), default)]), R}; + put(enc_random, true), + case V of + {_,_,'{}'} -> + {mkbin([mkbinelem(mkcall(enc_random,[mkint(65535),mkint(0)]),mkint(64), default)]),R}; + _ -> + {mkbin([mkbinelem(V, mkint(64), default)]), R} + end; enc_prim_type(unsigned_hyper, V, R) -> enc_prim_type(hyper, V, R); %% <> enc_prim_type(float, V, R) -> - {mkbin([mkbinelem(V, mkint(32), [float])]), R}; + put(enc_random, true), + case V of + {_,_,'{}'} -> + {mkbin([mkbinelem(mkcall(enc_random,[mkint(65535),mkint(0)]),mkint(32), [float])]),R}; + _ -> + {mkbin([mkbinelem(V, mkint(32), [float])]), R} + end; %% <> enc_prim_type(double, V, R) -> - {mkbin([mkbinelem(V, mkint(64), [float])]), R}; + put(enc_random, true), + case V of + {_,_,'{}'} -> + {mkbin([mkbinelem(mkcall(enc_random,[mkint(65535),mkint(0)]),mkint(64), [float])]),R}; + _ -> + {mkbin([mkbinelem(V, mkint(64), [float])]), R} + end; %% if V == true -> <<1:32>>; %% V == false -> <<0:32>>; %% end enc_prim_type(bool, V, R) -> - {mkif([mkclause([], - [mkop('==', V, mkatom(true))], - [mkbin([mkbinelem(mkint(1), mkint(32), default)])]), - mkclause([], - [mkop('==', V, mkatom(false))], - [mkbin([mkbinelem(mkint(0), mkint(32), default)])])]), - R}; + put(enc_random, true), + case V of + {_,_,'{}'} -> + {mkbin([mkbinelem(mkcall(enc_random,[mkint(2),mkint(-1)]),mkint(32), default)]),R}; + _ -> + {mkif([mkclause([], + [mkop('==', V, mkatom(true))], + [mkbin([mkbinelem(mkint(1), mkint(32), default)])]), + mkclause([], + [mkop('==', V, mkatom(false))], + [mkbin([mkbinelem(mkint(0), mkint(32), default)])])]), + R} + end; %% case io_list_len(V) of %% N -> V; % when N rem 4 == 0 @@ -145,18 +178,33 @@ enc_prim_type(bool, V, R) -> %% end enc_prim_type({array, N, opaque}, V, R) -> put(io_list_len, true), - Ret = if (N rem 4) == 0 -> V; - true -> - mklist([V, enc_align(N)]) - end, - {mkcase(mkcall(io_list_len, [V]), - [mkclause([mkint(N)], - [], - [Ret]), - mkclause([mkvar('_')], - [], - [mkexitlimit()])]), - R}; + put(enc_align, true), + put(enc_random_bytes, true), + {Sz, R1} = genvar(R), +%% Ret = if (N rem 4) == 0 -> V; +%% true -> +%% mklist([V, enc_align(N)]) +%% end, +%% By ruix 2012-06-20 + case V of + {_,_,'{}'} -> + {mkcall(enc_random_bytes, [mkint(N)]), R1}; + _ -> + Ret = mklist([V, mkcall(enc_align,[Sz])]), + {mkblock([mkmatch(Sz, + mkcall(io_list_len, + [V])), + mkcase(Sz, + [mkclause([mkint(N)], + [], + [Ret]), + mkclause([mkvar('_')], + [], + [mkexitlimit()]) + ]) + ]), + R1} + end; %% If Max /= infinity: %% begin @@ -174,18 +222,37 @@ enc_prim_type({array, N, opaque}, V, R) -> enc_prim_type({varray, Max, opaque}, V, R) -> put(enc_align, true), put(io_list_len, true), + put(enc_random, true), + put(enc_random_bytes, true), + put(enc_random_string, true), {Sz, R1} = genvar(R), + {Sz1, R2} = genvar(R1), + case V of + {_,_,'{}'} -> + if Max == infinity -> + Ret1 = mkmatch(Sz1,mkcall(enc_random, [mkint(1024),mkint(0)])); + true -> + Ret1 = mkmatch(Sz1, mkint(Max)) + end, + LL0 = mkbin([mkbinelem(Sz1, mkint(32), [unsigned])]), + %LL1 = mkcall(enc_random_bytes,[Sz1]), + LL1 = mkcall(enc_random_string,[Sz1]), + {mkblock([Ret1, mklist([LL0, LL1])]), R2}; + _ -> + Ret = mklist([mkbin([mkbinelem(Sz, mkint(32), [unsigned])]), V, mkcall(enc_align, [Sz])]), +%%io:format("enc_prim_type, varray, Ret:~p~n",[Ret]), if Max == infinity -> {mkblock([mkmatch(Sz, mkcall(io_list_len, [V])), - Ret]), R1}; + Ret]), R2}; true -> {mkblock([mkmatch(Sz, mkcall(io_list_len, [V])), mkif([mkclause([], [mkop('=<', Sz, mkint(Max))], [Ret]), mkclause([], [mkatom(true)], [mkexitlimit()])])]), - R1} + R2} + end end; enc_prim_type({varray,Max,string}, V, R) -> enc_prim_type({varray, Max, opaque}, V, R). @@ -219,13 +286,30 @@ enc_type({type,Id}, V, R) -> %% TagN -> Valn %% end %% +%% Rui Xie 2012-06-26 enc_type({enum,Nums},V,R) -> + {L, R1} = genvar(R), + {V0, R2} = genvar(R1), + ETags = foldr(fun({Tag,Val},Tags) -> + ETag = + if integer(Tag) -> mkint(Tag); + true -> mkatom(Tag) + end, + [ETag|Tags] end, [], Nums), + CL0 = mkmatch(L,mklist(ETags)), + CL1 = mkcall(lists,nth,[mkcall(enc_random,[mkcall(erlang,length,[L]),mkint(0)]),L]), + CL2 = mkmatch(V0,CL1), + + CL3 = mkmatch(V0,V), + CL = map( - fun({Tag,Val}) -> - mkclause([mkatom(Tag)],[], - [mkbin([mkbinelem(mkint(Val),mkint(32), default)])]) - end, Nums), - {mkcase(V, CL), R}; + fun({Tag,Val}) -> + mkclause([mkatom(Tag)],[], + [mkbin([mkbinelem(mkint(Val),mkint(32), default)])]) + end, Nums), + CL4 = mkcase(V, [mkclause([mkvar('{}')],[],[CL0,CL2]), mkclause([mkvar('_')],[],[CL3])]), + + {mkblock([CL4, mkcase(V0, CL)]), R2}; %% %% array: @@ -240,13 +324,20 @@ enc_type({array,N,Type}, V, R) -> {V1,R1} = genvar(R), {E1,R2} = enc_type(Type,V1,R1), CL = [mkclause([V1], [], [E1])], - E3 = mkcall(lists, map, [mkfun(CL), V]), - E4 = mkif([mkclause([], + + case V of + {_,_,'{}'} -> + E3 = mkcall(lists, map, [mkfun(CL), mkcall(lists, duplicate, [mkint(N), {var,0,'{}'}])]), + { E3, R2}; + _ -> + E3 = mkcall(lists, map, [mkfun(CL), V]), + E4 = mkif([mkclause([], [mkop('==', mkcall(length,[V]), mkint(N))], [ E3 ])]), - { E4, R2}; + { E4, R2} + end; %% %% varaible array %% @@ -275,9 +366,25 @@ enc_type({varray,Max,string}, V, R) -> %% end %% enc_type({varray,Max,Type}, V, R0) -> + put(enc_random, true), {V1, R1} = genvar(R0), {Len, R2} = genvar(R1), - {E1, R3} = enc_type(Type,V1,R2), + {Len1, R3} = genvar(R2), + case V of + {_,_,'{}'} -> + if Max == infinity -> + Ret1 = mkmatch(Len1,mkcall(enc_random,[mkint(1024),mkint(0)])); + true -> + Ret1 = mkmatch(Len1,mkint(Max)) + end, + LL = mkcall(lists, duplicate,[Len1,{var,0,'{}'}]), + {E1, R4} = enc_type(Type,mkvar('{}'),R3), + CL = [mkclause([V1], [], [E1])], + E2 = mkcall(lists, map, [mkfun(CL), LL]), + E3 = mkbin([mkbinelem(Len1, mkint(32), [unsigned])]), + {mkblock([Ret1,mklist([E3,E2])]), R4}; + _ -> + {E1, R4} = enc_type(Type,V1,R3), Match = mkmatch(Len, mkcall(length, [V])), E2 = mkbin([mkbinelem(Len, mkint(32), [unsigned])]), CL = [mkclause([V1], [], [E1])], @@ -294,7 +401,8 @@ enc_type({varray,Max,Type}, V, R0) -> [mkatom(true)], [mkexitlimit()])])]) end, - {E4, R3}; + {E4, R4} + end; %% structures are encoded recursively for each member as: %% @@ -303,6 +411,10 @@ enc_type({varray,Max,Type}, V, R0) -> %% [enc_T1(E1), enc_T2(E2), ..., enc_T3(E3)] %% end %% +%% Add default case for encode struct. +%% Default case is empty input. for incorrect input,it will fail. +%% +%% Rui Xie 2012-06-26 enc_type({struct, Elems}, V, R) -> {EL,VL,R1} = foldr( fun({Id,T}, {Enc0, VL, RR0}) -> @@ -310,7 +422,16 @@ enc_type({struct, Elems}, V, R) -> {Enc1,RR2} = enc_type(T, VV, RR1), {mkcons(Enc1,Enc0), [VV|VL], RR2} end, {mknil(),[],R}, Elems), - { mkcase(V, [mkclause([mktuple(VL)], [], [EL])]), R1}; + CL1 = mkclause([mktuple(VL)],[],[EL]), +{EL1,VL1,R1} = foldr( + fun({Id,T}, {Enc0, VL, RR0}) -> + {VV1,RR1} = genvar(RR0), + VV=mkvar('{}'), + {Enc1,RR2} = enc_type(T, VV, RR1), + {mkcons(Enc1,Enc0), [VV|VL], RR2} + end, {mknil(),[],R}, Elems), + CL2 = mkclause([mkvar('{}')],[],[EL1]), + { mkcase(V, [CL1,CL2]), R1}; %% %% union are encoded recursively for each arm as: @@ -325,11 +446,31 @@ enc_type({struct, Elems}, V, R) -> %% end] %% end. %% +%% Add default function for encode union. +%% Rui Xie 2012-06-26 enc_type({union, {{DId,DT}, Elems}}, V, R) -> + put(enc_random,true), {V0,R1} = genvar(R), {V1,R2} = genvar(R1), - {DEnc,R3} = enc_type(DT, V0, R2), - {CL1,R4} = foldr( + {V2,R3} = genvar(R2), + {L,R4} = genvar(R3), +%First to get all enum list for this union. + ETags = foldr(fun({{Tag,_},_}, Tags) -> TAG = + if integer(Tag) -> mkint(Tag); + true -> mkatom(Tag) + end, + [TAG | Tags] end, [], Elems), + %LL = [mkvar('[')] ++ [mkvar(X) || X <- ETags] ++ [mkvar(']')], + LL = mklist(ETags), +%io:format("~p\n",[LL]), + + %CLL0 = mkmatch(L, LL), + %CLL1 = mkcall(lists,nth,[mkcall(enc_random,[mkcall(erlang,length,[L]),mkint(0)]),L]), + %CLL2 = mkcase(V, [mkclause([mkvar('{}')],[],[mkmatch(V2,mktuple([CLL1,mkvar('{}')]))]), mkclause([mkvar('_')],[],[mkmatch(V2,V)])]), + +% normal case + {DEnc,R5} = enc_type(DT, V0, R4), + {CL1,R6} = foldr( fun ({{default,_},{_,T}}, {CL0, R0}) -> {Enc,RR} = enc_type(T, V1, R0), {[mkclause([mkvar('_')],[],[Enc]) | CL0], RR}; @@ -341,11 +482,38 @@ enc_type({union, {{DId,DT}, Elems}}, V, R) -> true -> mkatom(Tag) end, {[mkclause([ETag],[],[Enc]) | CL0], RR} - end, {[],R3}, Elems), + end, {[],R5}, Elems), Case1 = mkcase(V0, CL1), - CL2 = [mkclause([mktuple([V0, V1])], - [], [mklist([DEnc, Case1])])], - { mkcase(V, CL2), R4}; + CL2 = mkclause([mktuple([V0, V1])], [], [mklist([DEnc, Case1])]), + %CL3 = mkcase(V, CL2), + +% {} case + {DEnc1,R7} = enc_type(DT, V2, R6), + {CL11,R8} = foldr( + fun ({{default,_},{_,T}}, {CL0, R0}) -> + {Enc,RR} = enc_type(T, mkvar('{}'), R0), + {[mkclause([mkvar('_')],[],[Enc]) | CL0], RR}; + ({{Tag,Val},{Uid,T}}, {CL0, R0}) -> + {Enc,RR} = enc_type(T, mkvar('{}'), R0), + ETag = + if + integer(Tag) -> mkint(Tag); + true -> mkatom(Tag) + end, + {[mkclause([ETag],[],[Enc]) | CL0], RR} + end, {[],R7}, Elems), + Case11 = mkcase(V2, CL11), + CL21 = mklist([DEnc1, Case11]), + + CLL0 = mkmatch(L, LL), + CLL1 = mkcall(lists,nth,[mkcall(enc_random,[mkcall(erlang,length,[L]),mkint(0)]),L]), + + CL31 = mkmatch(V2, CLL1), + %CL4 = mkmatch(V2,V0), + + CLL2 = mkcase(V, [mkclause([mkvar('{}')],[],[CL31,CL21]), CL2]), + + {mkblock([CLL0,CLL2]), R8}; %% %% void is used to mark that data is not present !!! %% @@ -519,7 +687,7 @@ dec_compound({type,Id}, I_Bin, I_Off, R) -> dec_compound({enum,Nums}, I_Bin, I_Off, R0) -> {Enum,R1} = genvar(R0), Match = mkmatch(mkbin([mkbinoff(I_Off), - mkbinelem(Enum, mkint(32), default), + mkbinelem(Enum, mkint(32), [signed]), mkbintail()]), I_Bin), CL = map( @@ -1017,6 +1185,18 @@ svc_call_rs(Name,Proc,Args,Ret,ProgId,Serv,Ver,Bin,Off,R0) -> mkclause([mkvar('Else')], [], [mkvar('Else')])]), mkclause([mkint(Proc)], [], reverse(DL) ++ [E1]). +%% Generate random data. +%% List all related functions here for referrence. +enc_random(Roof,Offset) -> + random:uniform(Roof) + Offset. + +enc_random_bytes(Len) -> + [<<(random:uniform(256) - 1):8/unsigned>> || _H <- lists:seq(1,Len)] ++ + [enc_align(Len)]. + +enc_random_string(Len) -> + [<<(random:uniform(10) + 47):8/unsigned>> || _H <- lists:seq(1,Len)] ++ + [enc_align(Len)]. enc_align(Len) -> case Len rem 4 of diff --git a/lib/xmerl/priv/testdata/all_well.xml b/lib/xmerl/priv/testdata/all_well.xml index 58b824d..d03b0e5 100755 --- a/lib/xmerl/priv/testdata/all_well.xml +++ b/lib/xmerl/priv/testdata/all_well.xml @@ -1,7023 +1,7023 @@ - - - - -All's Well That Ends Well - - -

ASCII text placed in the public domain by Moby Lexical Tools, 1992.

-

SGML markup by Jon Bosak, 1992-1994.

-

XML version by Jon Bosak, 1996-1999.

-

The XML markup in this version is Copyright © 1999 Jon Bosak. -This work may freely be distributed on condition that it not be -modified or altered in any way.

-
- - -Dramatis Personae - -KING OF FRANCE -DUKE OF FLORENCE -BERTRAM, Count of Rousillon. -LAFEU, an old lord. -PAROLLES, a follower of Bertram. - - -Steward -Clown -servants to the Countess of Rousillon. - - -A Page. -COUNTESS OF ROUSILLON, mother to Bertram. -HELENA, a gentlewoman protected by the Countess. -An old Widow of Florence. -DIANA, daughter to the Widow. - - -VIOLENTA -MARIANA -neighbours and friends to the Widow. - - -Lords, Officers, Soldiers, &c., French and Florentine. - - -SCENE Rousillon; Paris; Florence; Marseilles. - -ALL'S WELL THAT ENDS WELL - -ACT I - -SCENE I. Rousillon. The COUNT's palace. -Enter BERTRAM, the COUNTESS of Rousillon, HELENA, -and LAFEU, all in black - - -COUNTESS -In delivering my son from me, I bury a second husband. - - - -BERTRAM -And I in going, madam, weep o'er my father's death -anew: but I must attend his majesty's command, to -whom I am now in ward, evermore in subjection. - - - -LAFEU -You shall find of the king a husband, madam; you, -sir, a father: he that so generally is at all times -good must of necessity hold his virtue to you; whose -worthiness would stir it up where it wanted rather -than lack it where there is such abundance. - - - -COUNTESS -What hope is there of his majesty's amendment? - - - -LAFEU -He hath abandoned his physicians, madam; under whose -practises he hath persecuted time with hope, and -finds no other advantage in the process but only the -losing of hope by time. - - - -COUNTESS -This young gentlewoman had a father,--O, that -'had'! how sad a passage 'tis!--whose skill was -almost as great as his honesty; had it stretched so -far, would have made nature immortal, and death -should have play for lack of work. Would, for the -king's sake, he were living! I think it would be -the death of the king's disease. - - - -LAFEU -How called you the man you speak of, madam? - - - -COUNTESS -He was famous, sir, in his profession, and it was -his great right to be so: Gerard de Narbon. - - - -LAFEU -He was excellent indeed, madam: the king very -lately spoke of him admiringly and mourningly: he -was skilful enough to have lived still, if knowledge -could be set up against mortality. - - - -BERTRAM -What is it, my good lord, the king languishes of? - - - -LAFEU -A fistula, my lord. - - - -BERTRAM -I heard not of it before. - - - -LAFEU -I would it were not notorious. Was this gentlewoman -the daughter of Gerard de Narbon? - - - -COUNTESS -His sole child, my lord, and bequeathed to my -overlooking. I have those hopes of her good that -her education promises; her dispositions she -inherits, which makes fair gifts fairer; for where -an unclean mind carries virtuous qualities, there -commendations go with pity; they are virtues and -traitors too; in her they are the better for their -simpleness; she derives her honesty and achieves her goodness. - - - -LAFEU -Your commendations, madam, get from her tears. - - - -COUNTESS -'Tis the best brine a maiden can season her praise -in. The remembrance of her father never approaches -her heart but the tyranny of her sorrows takes all -livelihood from her cheek. No more of this, Helena; -go to, no more; lest it be rather thought you affect -a sorrow than have it. - - - -HELENA -I do affect a sorrow indeed, but I have it too. - - - -LAFEU -Moderate lamentation is the right of the dead, -excessive grief the enemy to the living. - - - -COUNTESS -If the living be enemy to the grief, the excess -makes it soon mortal. - - - -BERTRAM -Madam, I desire your holy wishes. - - - -LAFEU -How understand we that? - - - -COUNTESS -Be thou blest, Bertram, and succeed thy father -In manners, as in shape! thy blood and virtue -Contend for empire in thee, and thy goodness -Share with thy birthright! Love all, trust a few, -Do wrong to none: be able for thine enemy -Rather in power than use, and keep thy friend -Under thy own life's key: be cheque'd for silence, -But never tax'd for speech. What heaven more will, -That thee may furnish and my prayers pluck down, -Fall on thy head! Farewell, my lord; -'Tis an unseason'd courtier; good my lord, -Advise him. - - - -LAFEU -He cannot want the best -That shall attend his love. - - - -COUNTESS -Heaven bless him! Farewell, Bertram. - - -Exit - - -BERTRAM -To HELENA The best wishes that can be forged in -your thoughts be servants to you! Be comfortable -to my mother, your mistress, and make much of her. - - - -LAFEU -Farewell, pretty lady: you must hold the credit of -your father. - - -Exeunt BERTRAM and LAFEU - - -HELENA -O, were that all! I think not on my father; -And these great tears grace his remembrance more -Than those I shed for him. What was he like? -I have forgot him: my imagination -Carries no favour in't but Bertram's. -I am undone: there is no living, none, -If Bertram be away. 'Twere all one -That I should love a bright particular star -And think to wed it, he is so above me: -In his bright radiance and collateral light -Must I be comforted, not in his sphere. -The ambition in my love thus plagues itself: -The hind that would be mated by the lion -Must die for love. 'Twas pretty, though plague, -To see him every hour; to sit and draw -His arched brows, his hawking eye, his curls, -In our heart's table; heart too capable -Of every line and trick of his sweet favour: -But now he's gone, and my idolatrous fancy -Must sanctify his reliques. Who comes here? -Enter PAROLLES -Aside -One that goes with him: I love him for his sake; -And yet I know him a notorious liar, -Think him a great way fool, solely a coward; -Yet these fixed evils sit so fit in him, -That they take place, when virtue's steely bones -Look bleak i' the cold wind: withal, full oft we see -Cold wisdom waiting on superfluous folly. - - - -PAROLLES -Save you, fair queen! - - - -HELENA -And you, monarch! - - - -PAROLLES -No. - - - -HELENA -And no. - - - -PAROLLES -Are you meditating on virginity? - - - -HELENA -Ay. You have some stain of soldier in you: let me -ask you a question. Man is enemy to virginity; how -may we barricado it against him? - - - -PAROLLES -Keep him out. - - - -HELENA -But he assails; and our virginity, though valiant, -in the defence yet is weak: unfold to us some -warlike resistance. - - - -PAROLLES -There is none: man, sitting down before you, will -undermine you and blow you up. - - - -HELENA -Bless our poor virginity from underminers and -blowers up! Is there no military policy, how -virgins might blow up men? - - - -PAROLLES -Virginity being blown down, man will quicklier be -blown up: marry, in blowing him down again, with -the breach yourselves made, you lose your city. It -is not politic in the commonwealth of nature to -preserve virginity. Loss of virginity is rational -increase and there was never virgin got till -virginity was first lost. That you were made of is -metal to make virgins. Virginity by being once lost -may be ten times found; by being ever kept, it is -ever lost: 'tis too cold a companion; away with 't! - - - -HELENA -I will stand for 't a little, though therefore I die a virgin. - - - -PAROLLES -There's little can be said in 't; 'tis against the -rule of nature. To speak on the part of virginity, -is to accuse your mothers; which is most infallible -disobedience. He that hangs himself is a virgin: -virginity murders itself and should be buried in -highways out of all sanctified limit, as a desperate -offendress against nature. Virginity breeds mites, -much like a cheese; consumes itself to the very -paring, and so dies with feeding his own stomach. -Besides, virginity is peevish, proud, idle, made of -self-love, which is the most inhibited sin in the -canon. Keep it not; you cannot choose but loose -by't: out with 't! within ten year it will make -itself ten, which is a goodly increase; and the -principal itself not much the worse: away with 't! - - - -HELENA -How might one do, sir, to lose it to her own liking? - - - -PAROLLES -Let me see: marry, ill, to like him that ne'er it -likes. 'Tis a commodity will lose the gloss with -lying; the longer kept, the less worth: off with 't -while 'tis vendible; answer the time of request. -Virginity, like an old courtier, wears her cap out -of fashion: richly suited, but unsuitable: just -like the brooch and the tooth-pick, which wear not -now. Your date is better in your pie and your -porridge than in your cheek; and your virginity, -your old virginity, is like one of our French -withered pears, it looks ill, it eats drily; marry, -'tis a withered pear; it was formerly better; -marry, yet 'tis a withered pear: will you anything with it? - - - -HELENA -Not my virginity yet -There shall your master have a thousand loves, -A mother and a mistress and a friend, -A phoenix, captain and an enemy, -A guide, a goddess, and a sovereign, -A counsellor, a traitress, and a dear; -His humble ambition, proud humility, -His jarring concord, and his discord dulcet, -His faith, his sweet disaster; with a world -Of pretty, fond, adoptious christendoms, -That blinking Cupid gossips. Now shall he-- -I know not what he shall. God send him well! -The court's a learning place, and he is one-- - - - -PAROLLES -What one, i' faith? - - - -HELENA -That I wish well. 'Tis pity-- - - - -PAROLLES -What's pity? - - - -HELENA -That wishing well had not a body in't, -Which might be felt; that we, the poorer born, -Whose baser stars do shut us up in wishes, -Might with effects of them follow our friends, -And show what we alone must think, which never -Return us thanks. - - -Enter Page - - -Page -Monsieur Parolles, my lord calls for you. - - -Exit - - -PAROLLES -Little Helen, farewell; if I can remember thee, I -will think of thee at court. - - - -HELENA -Monsieur Parolles, you were born under a charitable star. - - - -PAROLLES -Under Mars, I. - - - -HELENA -I especially think, under Mars. - - - -PAROLLES -Why under Mars? - - - -HELENA -The wars have so kept you under that you must needs -be born under Mars. - - - -PAROLLES -When he was predominant. - - - -HELENA -When he was retrograde, I think, rather. - - - -PAROLLES -Why think you so? - - - -HELENA -You go so much backward when you fight. - - - -PAROLLES -That's for advantage. - - - -HELENA -So is running away, when fear proposes the safety; -but the composition that your valour and fear makes -in you is a virtue of a good wing, and I like the wear well. - - - -PAROLLES -I am so full of businesses, I cannot answer thee -acutely. I will return perfect courtier; in the -which, my instruction shall serve to naturalize -thee, so thou wilt be capable of a courtier's -counsel and understand what advice shall thrust upon -thee; else thou diest in thine unthankfulness, and -thine ignorance makes thee away: farewell. When -thou hast leisure, say thy prayers; when thou hast -none, remember thy friends; get thee a good husband, -and use him as he uses thee; so, farewell. - - -Exit - - -HELENA -Our remedies oft in ourselves do lie, -Which we ascribe to heaven: the fated sky -Gives us free scope, only doth backward pull -Our slow designs when we ourselves are dull. -What power is it which mounts my love so high, -That makes me see, and cannot feed mine eye? -The mightiest space in fortune nature brings -To join like likes and kiss like native things. -Impossible be strange attempts to those -That weigh their pains in sense and do suppose -What hath been cannot be: who ever strove -So show her merit, that did miss her love? -The king's disease--my project may deceive me, -But my intents are fix'd and will not leave me. - - -Exit - - -SCENE II. Paris. The KING's palace. -Flourish of cornets. Enter the KING of France, -with letters, and divers Attendants - - -KING -The Florentines and Senoys are by the ears; -Have fought with equal fortune and continue -A braving war. - - - -First Lord -So 'tis reported, sir. - - - -KING -Nay, 'tis most credible; we here received it -A certainty, vouch'd from our cousin Austria, -With caution that the Florentine will move us -For speedy aid; wherein our dearest friend -Prejudicates the business and would seem -To have us make denial. - - - -First Lord -His love and wisdom, -Approved so to your majesty, may plead -For amplest credence. - - - -KING -He hath arm'd our answer, -And Florence is denied before he comes: -Yet, for our gentlemen that mean to see -The Tuscan service, freely have they leave -To stand on either part. - - - -Second Lord -It well may serve -A nursery to our gentry, who are sick -For breathing and exploit. - - - -KING -What's he comes here? - - -Enter BERTRAM, LAFEU, and PAROLLES - - -First Lord -It is the Count Rousillon, my good lord, -Young Bertram. - - - -KING -Youth, thou bear'st thy father's face; -Frank nature, rather curious than in haste, -Hath well composed thee. Thy father's moral parts -Mayst thou inherit too! Welcome to Paris. - - - -BERTRAM -My thanks and duty are your majesty's. - - - -KING -I would I had that corporal soundness now, -As when thy father and myself in friendship -First tried our soldiership! He did look far -Into the service of the time and was -Discipled of the bravest: he lasted long; -But on us both did haggish age steal on -And wore us out of act. It much repairs me -To talk of your good father. In his youth -He had the wit which I can well observe -To-day in our young lords; but they may jest -Till their own scorn return to them unnoted -Ere they can hide their levity in honour; -So like a courtier, contempt nor bitterness -Were in his pride or sharpness; if they were, -His equal had awaked them, and his honour, -Clock to itself, knew the true minute when -Exception bid him speak, and at this time -His tongue obey'd his hand: who were below him -He used as creatures of another place -And bow'd his eminent top to their low ranks, -Making them proud of his humility, -In their poor praise he humbled. Such a man -Might be a copy to these younger times; -Which, follow'd well, would demonstrate them now -But goers backward. - - - -BERTRAM -His good remembrance, sir, -Lies richer in your thoughts than on his tomb; -So in approof lives not his epitaph -As in your royal speech. - - - -KING -Would I were with him! He would always say-- -Methinks I hear him now; his plausive words -He scatter'd not in ears, but grafted them, -To grow there and to bear,--'Let me not live,'-- -This his good melancholy oft began, -On the catastrophe and heel of pastime, -When it was out,--'Let me not live,' quoth he, -'After my flame lacks oil, to be the snuff -Of younger spirits, whose apprehensive senses -All but new things disdain; whose judgments are -Mere fathers of their garments; whose constancies -Expire before their fashions.' This he wish'd; -I after him do after him wish too, -Since I nor wax nor honey can bring home, -I quickly were dissolved from my hive, -To give some labourers room. - - - -Second Lord -You are loved, sir: -They that least lend it you shall lack you first. - - - -KING -I fill a place, I know't. How long is't, count, -Since the physician at your father's died? -He was much famed. - - - -BERTRAM -Some six months since, my lord. - - - -KING -If he were living, I would try him yet. -Lend me an arm; the rest have worn me out -With several applications; nature and sickness -Debate it at their leisure. Welcome, count; -My son's no dearer. - - - -BERTRAM -Thank your majesty. - - -Exeunt. Flourish - - -SCENE III. Rousillon. The COUNT's palace. -Enter COUNTESS, Steward, and Clown - - -COUNTESS -I will now hear; what say you of this gentlewoman? - - - -Steward -Madam, the care I have had to even your content, I -wish might be found in the calendar of my past -endeavours; for then we wound our modesty and make -foul the clearness of our deservings, when of -ourselves we publish them. - - - -COUNTESS -What does this knave here? Get you gone, sirrah: -the complaints I have heard of you I do not all -believe: 'tis my slowness that I do not; for I know -you lack not folly to commit them, and have ability -enough to make such knaveries yours. - - - -Clown -'Tis not unknown to you, madam, I am a poor fellow. - - - -COUNTESS -Well, sir. - - - -Clown -No, madam, 'tis not so well that I am poor, though -many of the rich are damned: but, if I may have -your ladyship's good will to go to the world, Isbel -the woman and I will do as we may. - - - -COUNTESS -Wilt thou needs be a beggar? - - - -Clown -I do beg your good will in this case. - - - -COUNTESS -In what case? - - - -Clown -In Isbel's case and mine own. Service is no -heritage: and I think I shall never have the -blessing of God till I have issue o' my body; for -they say barnes are blessings. - - - -COUNTESS -Tell me thy reason why thou wilt marry. - - - -Clown -My poor body, madam, requires it: I am driven on -by the flesh; and he must needs go that the devil drives. - - - -COUNTESS -Is this all your worship's reason? - - - -Clown -Faith, madam, I have other holy reasons such as they -are. - - - -COUNTESS -May the world know them? - - - -Clown -I have been, madam, a wicked creature, as you and -all flesh and blood are; and, indeed, I do marry -that I may repent. - - - -COUNTESS -Thy marriage, sooner than thy wickedness. - - - -Clown -I am out o' friends, madam; and I hope to have -friends for my wife's sake. - - - -COUNTESS -Such friends are thine enemies, knave. - - - -Clown -You're shallow, madam, in great friends; for the -knaves come to do that for me which I am aweary of. -He that ears my land spares my team and gives me -leave to in the crop; if I be his cuckold, he's my -drudge: he that comforts my wife is the cherisher -of my flesh and blood; he that cherishes my flesh -and blood loves my flesh and blood; he that loves my -flesh and blood is my friend: ergo, he that kisses -my wife is my friend. If men could be contented to -be what they are, there were no fear in marriage; -for young Charbon the Puritan and old Poysam the -Papist, howsome'er their hearts are severed in -religion, their heads are both one; they may jowl -horns together, like any deer i' the herd. - - - -COUNTESS -Wilt thou ever be a foul-mouthed and calumnious knave? - - - -Clown -A prophet I, madam; and I speak the truth the next -way: -For I the ballad will repeat, -Which men full true shall find; -Your marriage comes by destiny, -Your cuckoo sings by kind. - - - -COUNTESS -Get you gone, sir; I'll talk with you more anon. - - - -Steward -May it please you, madam, that he bid Helen come to -you: of her I am to speak. - - - -COUNTESS -Sirrah, tell my gentlewoman I would speak with her; -Helen, I mean. - - - -Clown -Was this fair face the cause, quoth she, -Why the Grecians sacked Troy? -Fond done, done fond, -Was this King Priam's joy? -With that she sighed as she stood, -With that she sighed as she stood, -And gave this sentence then; -Among nine bad if one be good, -Among nine bad if one be good, -There's yet one good in ten. - - - -COUNTESS -What, one good in ten? you corrupt the song, sirrah. - - - -Clown -One good woman in ten, madam; which is a purifying -o' the song: would God would serve the world so all -the year! we'ld find no fault with the tithe-woman, -if I were the parson. One in ten, quoth a'! An we -might have a good woman born but one every blazing -star, or at an earthquake, 'twould mend the lottery -well: a man may draw his heart out, ere a' pluck -one. - - - -COUNTESS -You'll be gone, sir knave, and do as I command you. - - - -Clown -That man should be at woman's command, and yet no -hurt done! Though honesty be no puritan, yet it -will do no hurt; it will wear the surplice of -humility over the black gown of a big heart. I am -going, forsooth: the business is for Helen to come hither. - - -Exit - - -COUNTESS -Well, now. - - - -Steward -I know, madam, you love your gentlewoman entirely. - - - -COUNTESS -Faith, I do: her father bequeathed her to me; and -she herself, without other advantage, may lawfully -make title to as much love as she finds: there is -more owing her than is paid; and more shall be paid -her than she'll demand. - - - -Steward -Madam, I was very late more near her than I think -she wished me: alone she was, and did communicate -to herself her own words to her own ears; she -thought, I dare vow for her, they touched not any -stranger sense. Her matter was, she loved your son: -Fortune, she said, was no goddess, that had put -such difference betwixt their two estates; Love no -god, that would not extend his might, only where -qualities were level; Dian no queen of virgins, that -would suffer her poor knight surprised, without -rescue in the first assault or ransom afterward. -This she delivered in the most bitter touch of -sorrow that e'er I heard virgin exclaim in: which I -held my duty speedily to acquaint you withal; -sithence, in the loss that may happen, it concerns -you something to know it. - - - -COUNTESS -You have discharged this honestly; keep it to -yourself: many likelihoods informed me of this -before, which hung so tottering in the balance that -I could neither believe nor misdoubt. Pray you, -leave me: stall this in your bosom; and I thank you -for your honest care: I will speak with you further anon. -Exit Steward -Enter HELENA -Even so it was with me when I was young: -If ever we are nature's, these are ours; this thorn -Doth to our rose of youth rightly belong; -Our blood to us, this to our blood is born; -It is the show and seal of nature's truth, -Where love's strong passion is impress'd in youth: -By our remembrances of days foregone, -Such were our faults, or then we thought them none. -Her eye is sick on't: I observe her now. - - - -HELENA -What is your pleasure, madam? - - - -COUNTESS -You know, Helen, -I am a mother to you. - - - -HELENA -Mine honourable mistress. - - - -COUNTESS -Nay, a mother: -Why not a mother? When I said 'a mother,' -Methought you saw a serpent: what's in 'mother,' -That you start at it? I say, I am your mother; -And put you in the catalogue of those -That were enwombed mine: 'tis often seen -Adoption strives with nature and choice breeds -A native slip to us from foreign seeds: -You ne'er oppress'd me with a mother's groan, -Yet I express to you a mother's care: -God's mercy, maiden! does it curd thy blood -To say I am thy mother? What's the matter, -That this distemper'd messenger of wet, -The many-colour'd Iris, rounds thine eye? -Why? that you are my daughter? - - - -HELENA -That I am not. - - - -COUNTESS -I say, I am your mother. - - - -HELENA -Pardon, madam; -The Count Rousillon cannot be my brother: -I am from humble, he from honour'd name; -No note upon my parents, his all noble: -My master, my dear lord he is; and I -His servant live, and will his vassal die: -He must not be my brother. - - - -COUNTESS -Nor I your mother? - - - -HELENA -You are my mother, madam; would you were,-- -So that my lord your son were not my brother,-- -Indeed my mother! or were you both our mothers, -I care no more for than I do for heaven, -So I were not his sister. Can't no other, -But, I your daughter, he must be my brother? - - - -COUNTESS -Yes, Helen, you might be my daughter-in-law: -God shield you mean it not! daughter and mother -So strive upon your pulse. What, pale again? -My fear hath catch'd your fondness: now I see -The mystery of your loneliness, and find -Your salt tears' head: now to all sense 'tis gross -You love my son; invention is ashamed, -Against the proclamation of thy passion, -To say thou dost not: therefore tell me true; -But tell me then, 'tis so; for, look thy cheeks -Confess it, th' one to th' other; and thine eyes -See it so grossly shown in thy behaviors -That in their kind they speak it: only sin -And hellish obstinacy tie thy tongue, -That truth should be suspected. Speak, is't so? -If it be so, you have wound a goodly clew; -If it be not, forswear't: howe'er, I charge thee, -As heaven shall work in me for thine avail, -Tell me truly. - - - -HELENA -Good madam, pardon me! - - - -COUNTESS -Do you love my son? - - - -HELENA -Your pardon, noble mistress! - - - -COUNTESS -Love you my son? - - - -HELENA -Do not you love him, madam? - - - -COUNTESS -Go not about; my love hath in't a bond, -Whereof the world takes note: come, come, disclose -The state of your affection; for your passions -Have to the full appeach'd. - - - -HELENA -Then, I confess, -Here on my knee, before high heaven and you, -That before you, and next unto high heaven, -I love your son. -My friends were poor, but honest; so's my love: -Be not offended; for it hurts not him -That he is loved of me: I follow him not -By any token of presumptuous suit; -Nor would I have him till I do deserve him; -Yet never know how that desert should be. -I know I love in vain, strive against hope; -Yet in this captious and intenible sieve -I still pour in the waters of my love -And lack not to lose still: thus, Indian-like, -Religious in mine error, I adore -The sun, that looks upon his worshipper, -But knows of him no more. My dearest madam, -Let not your hate encounter with my love -For loving where you do: but if yourself, -Whose aged honour cites a virtuous youth, -Did ever in so true a flame of liking -Wish chastely and love dearly, that your Dian -Was both herself and love: O, then, give pity -To her, whose state is such that cannot choose -But lend and give where she is sure to lose; -That seeks not to find that her search implies, -But riddle-like lives sweetly where she dies! - - - -COUNTESS -Had you not lately an intent,--speak truly,-- -To go to Paris? - - - -HELENA -Madam, I had. - - - -COUNTESS -Wherefore? tell true. - - - -HELENA -I will tell truth; by grace itself I swear. -You know my father left me some prescriptions -Of rare and proved effects, such as his reading -And manifest experience had collected -For general sovereignty; and that he will'd me -In heedfull'st reservation to bestow them, -As notes whose faculties inclusive were -More than they were in note: amongst the rest, -There is a remedy, approved, set down, -To cure the desperate languishings whereof -The king is render'd lost. - - - -COUNTESS -This was your motive -For Paris, was it? speak. - - - -HELENA -My lord your son made me to think of this; -Else Paris and the medicine and the king -Had from the conversation of my thoughts -Haply been absent then. - - - -COUNTESS -But think you, Helen, -If you should tender your supposed aid, -He would receive it? he and his physicians -Are of a mind; he, that they cannot help him, -They, that they cannot help: how shall they credit -A poor unlearned virgin, when the schools, -Embowell'd of their doctrine, have left off -The danger to itself? - - - -HELENA -There's something in't, -More than my father's skill, which was the greatest -Of his profession, that his good receipt -Shall for my legacy be sanctified -By the luckiest stars in heaven: and, would your honour -But give me leave to try success, I'ld venture -The well-lost life of mine on his grace's cure -By such a day and hour. - - - -COUNTESS -Dost thou believe't? - - - -HELENA -Ay, madam, knowingly. - - - -COUNTESS -Why, Helen, thou shalt have my leave and love, -Means and attendants and my loving greetings -To those of mine in court: I'll stay at home -And pray God's blessing into thy attempt: -Be gone to-morrow; and be sure of this, -What I can help thee to thou shalt not miss. - - -Exeunt - - - - -ACT II - -SCENE I. Paris. The KING's palace. -Flourish of cornets. Enter the KING, attended -with divers young Lords taking leave for the -Florentine war; BERTRAM, and PAROLLES - - -KING -Farewell, young lords; these warlike principles -Do not throw from you: and you, my lords, farewell: -Share the advice betwixt you; if both gain, all -The gift doth stretch itself as 'tis received, -And is enough for both. - - - -First Lord -'Tis our hope, sir, -After well enter'd soldiers, to return -And find your grace in health. - - - -KING -No, no, it cannot be; and yet my heart -Will not confess he owes the malady -That doth my life besiege. Farewell, young lords; -Whether I live or die, be you the sons -Of worthy Frenchmen: let higher Italy,-- -Those bated that inherit but the fall -Of the last monarchy,--see that you come -Not to woo honour, but to wed it; when -The bravest questant shrinks, find what you seek, -That fame may cry you loud: I say, farewell. - - - -Second Lord -Health, at your bidding, serve your majesty! - - - -KING -Those girls of Italy, take heed of them: -They say, our French lack language to deny, -If they demand: beware of being captives, -Before you serve. - - - -Both -Our hearts receive your warnings. - - - -KING -Farewell. Come hither to me. - - -Exit, attended - - -First Lord -O, my sweet lord, that you will stay behind us! - - - -PAROLLES -'Tis not his fault, the spark. - - - -Second Lord -O, 'tis brave wars! - - - -PAROLLES -Most admirable: I have seen those wars. - - - -BERTRAM -I am commanded here, and kept a coil with -'Too young' and 'the next year' and ''tis too early.' - - - -PAROLLES -An thy mind stand to't, boy, steal away bravely. - - - -BERTRAM -I shall stay here the forehorse to a smock, -Creaking my shoes on the plain masonry, -Till honour be bought up and no sword worn -But one to dance with! By heaven, I'll steal away. - - - -First Lord -There's honour in the theft. - - - -PAROLLES -Commit it, count. - - - -Second Lord -I am your accessary; and so, farewell. - - - -BERTRAM -I grow to you, and our parting is a tortured body. - - - -First Lord -Farewell, captain. - - - -Second Lord -Sweet Monsieur Parolles! - - - -PAROLLES -Noble heroes, my sword and yours are kin. Good -sparks and lustrous, a word, good metals: you shall -find in the regiment of the Spinii one Captain -Spurio, with his cicatrice, an emblem of war, here -on his sinister cheek; it was this very sword -entrenched it: say to him, I live; and observe his -reports for me. - - - -First Lord -We shall, noble captain. - - -Exeunt Lords - - -PAROLLES -Mars dote on you for his novices! what will ye do? - - - -BERTRAM -Stay: the king. - - -Re-enter KING. BERTRAM and PAROLLES retire - - -PAROLLES -To BERTRAM Use a more spacious ceremony to the -noble lords; you have restrained yourself within the -list of too cold an adieu: be more expressive to -them: for they wear themselves in the cap of the -time, there do muster true gait, eat, speak, and -move under the influence of the most received star; -and though the devil lead the measure, such are to -be followed: after them, and take a more dilated farewell. - - - -BERTRAM -And I will do so. - - - -PAROLLES -Worthy fellows; and like to prove most sinewy sword-men. - - -Exeunt BERTRAM and PAROLLES -Enter LAFEU - - -LAFEU -Kneeling Pardon, my lord, for me and for my tidings. - - - -KING -I'll fee thee to stand up. - - - -LAFEU -Then here's a man stands, that has brought his pardon. -I would you had kneel'd, my lord, to ask me mercy, -And that at my bidding you could so stand up. - - - -KING -I would I had; so I had broke thy pate, -And ask'd thee mercy for't. - - - -LAFEU -Good faith, across: but, my good lord 'tis thus; -Will you be cured of your infirmity? - - - -KING -No. - - - -LAFEU -O, will you eat no grapes, my royal fox? -Yes, but you will my noble grapes, an if -My royal fox could reach them: I have seen a medicine -That's able to breathe life into a stone, -Quicken a rock, and make you dance canary -With spritely fire and motion; whose simple touch, -Is powerful to araise King Pepin, nay, -To give great Charlemain a pen in's hand, -And write to her a love-line. - - - -KING -What 'her' is this? - - - -LAFEU -Why, Doctor She: my lord, there's one arrived, -If you will see her: now, by my faith and honour, -If seriously I may convey my thoughts -In this my light deliverance, I have spoke -With one that, in her sex, her years, profession, -Wisdom and constancy, hath amazed me more -Than I dare blame my weakness: will you see her -For that is her demand, and know her business? -That done, laugh well at me. - - - -KING -Now, good Lafeu, -Bring in the admiration; that we with thee -May spend our wonder too, or take off thine -By wondering how thou took'st it. - - - -LAFEU -Nay, I'll fit you, -And not be all day neither. - - -Exit - - -KING -Thus he his special nothing ever prologues. - - -Re-enter LAFEU, with HELENA - - -LAFEU -Nay, come your ways. - - - -KING -This haste hath wings indeed. - - - -LAFEU -Nay, come your ways: -This is his majesty; say your mind to him: -A traitor you do look like; but such traitors -His majesty seldom fears: I am Cressid's uncle, -That dare leave two together; fare you well. - - -Exit - - -KING -Now, fair one, does your business follow us? - - - -HELENA -Ay, my good lord. -Gerard de Narbon was my father; -In what he did profess, well found. - - - -KING -I knew him. - - - -HELENA -The rather will I spare my praises towards him: -Knowing him is enough. On's bed of death -Many receipts he gave me: chiefly one. -Which, as the dearest issue of his practise, -And of his old experience the oily darling, -He bade me store up, as a triple eye, -Safer than mine own two, more dear; I have so; -And hearing your high majesty is touch'd -With that malignant cause wherein the honour -Of my dear father's gift stands chief in power, -I come to tender it and my appliance -With all bound humbleness. - - - -KING -We thank you, maiden; -But may not be so credulous of cure, -When our most learned doctors leave us and -The congregated college have concluded -That labouring art can never ransom nature -From her inaidible estate; I say we must not -So stain our judgment, or corrupt our hope, -To prostitute our past-cure malady -To empirics, or to dissever so -Our great self and our credit, to esteem -A senseless help when help past sense we deem. - - - -HELENA -My duty then shall pay me for my pains: -I will no more enforce mine office on you. -Humbly entreating from your royal thoughts -A modest one, to bear me back a again. - - - -KING -I cannot give thee less, to be call'd grateful: -Thou thought'st to help me; and such thanks I give -As one near death to those that wish him live: -But what at full I know, thou know'st no part, -I knowing all my peril, thou no art. - - - -HELENA -What I can do can do no hurt to try, -Since you set up your rest 'gainst remedy. -He that of greatest works is finisher -Oft does them by the weakest minister: -So holy writ in babes hath judgment shown, -When judges have been babes; great floods have flown -From simple sources, and great seas have dried -When miracles have by the greatest been denied. -Oft expectation fails and most oft there -Where most it promises, and oft it hits -Where hope is coldest and despair most fits. - - - -KING -I must not hear thee; fare thee well, kind maid; -Thy pains not used must by thyself be paid: -Proffers not took reap thanks for their reward. - - - -HELENA -Inspired merit so by breath is barr'd: -It is not so with Him that all things knows -As 'tis with us that square our guess by shows; -But most it is presumption in us when -The help of heaven we count the act of men. -Dear sir, to my endeavours give consent; -Of heaven, not me, make an experiment. -I am not an impostor that proclaim -Myself against the level of mine aim; -But know I think and think I know most sure -My art is not past power nor you past cure. - - - -KING -Are thou so confident? within what space -Hopest thou my cure? - - - -HELENA -The great'st grace lending grace -Ere twice the horses of the sun shall bring -Their fiery torcher his diurnal ring, -Ere twice in murk and occidental damp -Moist Hesperus hath quench'd his sleepy lamp, -Or four and twenty times the pilot's glass -Hath told the thievish minutes how they pass, -What is infirm from your sound parts shall fly, -Health shall live free and sickness freely die. - - - -KING -Upon thy certainty and confidence -What darest thou venture? - - - -HELENA -Tax of impudence, -A strumpet's boldness, a divulged shame -Traduced by odious ballads: my maiden's name -Sear'd otherwise; nay, worse--if worse--extended -With vilest torture let my life be ended. - - - -KING -Methinks in thee some blessed spirit doth speak -His powerful sound within an organ weak: -And what impossibility would slay -In common sense, sense saves another way. -Thy life is dear; for all that life can rate -Worth name of life in thee hath estimate, -Youth, beauty, wisdom, courage, all -That happiness and prime can happy call: -Thou this to hazard needs must intimate -Skill infinite or monstrous desperate. -Sweet practiser, thy physic I will try, -That ministers thine own death if I die. - - - -HELENA -If I break time, or flinch in property -Of what I spoke, unpitied let me die, -And well deserved: not helping, death's my fee; -But, if I help, what do you promise me? - - - -KING -Make thy demand. - - - -HELENA -But will you make it even? - - - -KING -Ay, by my sceptre and my hopes of heaven. - - - -HELENA -Then shalt thou give me with thy kingly hand -What husband in thy power I will command: -Exempted be from me the arrogance -To choose from forth the royal blood of France, -My low and humble name to propagate -With any branch or image of thy state; -But such a one, thy vassal, whom I know -Is free for me to ask, thee to bestow. - - - -KING -Here is my hand; the premises observed, -Thy will by my performance shall be served: -So make the choice of thy own time, for I, -Thy resolved patient, on thee still rely. -More should I question thee, and more I must, -Though more to know could not be more to trust, -From whence thou camest, how tended on: but rest -Unquestion'd welcome and undoubted blest. -Give me some help here, ho! If thou proceed -As high as word, my deed shall match thy meed. - - -Flourish. Exeunt - - -SCENE II. Rousillon. The COUNT's palace. -Enter COUNTESS and Clown - - -COUNTESS -Come on, sir; I shall now put you to the height of -your breeding. - - - -Clown -I will show myself highly fed and lowly taught: I -know my business is but to the court. - - - -COUNTESS -To the court! why, what place make you special, -when you put off that with such contempt? But to the court! - - - -Clown -Truly, madam, if God have lent a man any manners, he -may easily put it off at court: he that cannot make -a leg, put off's cap, kiss his hand and say nothing, -has neither leg, hands, lip, nor cap; and indeed -such a fellow, to say precisely, were not for the -court; but for me, I have an answer will serve all -men. - - - -COUNTESS -Marry, that's a bountiful answer that fits all -questions. - - - -Clown -It is like a barber's chair that fits all buttocks, -the pin-buttock, the quatch-buttock, the brawn -buttock, or any buttock. - - - -COUNTESS -Will your answer serve fit to all questions? - - - -Clown -As fit as ten groats is for the hand of an attorney, -as your French crown for your taffeta punk, as Tib's -rush for Tom's forefinger, as a pancake for Shrove -Tuesday, a morris for May-day, as the nail to his -hole, the cuckold to his horn, as a scolding queen -to a wrangling knave, as the nun's lip to the -friar's mouth, nay, as the pudding to his skin. - - - -COUNTESS -Have you, I say, an answer of such fitness for all -questions? - - - -Clown -From below your duke to beneath your constable, it -will fit any question. - - - -COUNTESS -It must be an answer of most monstrous size that -must fit all demands. - - - -Clown -But a trifle neither, in good faith, if the learned -should speak truth of it: here it is, and all that -belongs to't. Ask me if I am a courtier: it shall -do you no harm to learn. - - - -COUNTESS -To be young again, if we could: I will be a fool in -question, hoping to be the wiser by your answer. I -pray you, sir, are you a courtier? - - - -Clown -O Lord, sir! There's a simple putting off. More, -more, a hundred of them. - - - -COUNTESS -Sir, I am a poor friend of yours, that loves you. - - - -Clown -O Lord, sir! Thick, thick, spare not me. - - - -COUNTESS -I think, sir, you can eat none of this homely meat. - - - -Clown -O Lord, sir! Nay, put me to't, I warrant you. - - - -COUNTESS -You were lately whipped, sir, as I think. - - - -Clown -O Lord, sir! spare not me. - - - -COUNTESS -Do you cry, 'O Lord, sir!' at your whipping, and -'spare not me?' Indeed your 'O Lord, sir!' is very -sequent to your whipping: you would answer very well -to a whipping, if you were but bound to't. - - - -Clown -I ne'er had worse luck in my life in my 'O Lord, -sir!' I see things may serve long, but not serve ever. - - - -COUNTESS -I play the noble housewife with the time -To entertain't so merrily with a fool. - - - -Clown -O Lord, sir! why, there't serves well again. - - - -COUNTESS -An end, sir; to your business. Give Helen this, -And urge her to a present answer back: -Commend me to my kinsmen and my son: -This is not much. - - - -Clown -Not much commendation to them. - - - -COUNTESS -Not much employment for you: you understand me? - - - -Clown -Most fruitfully: I am there before my legs. - - - -COUNTESS -Haste you again. - - -Exeunt severally - - -SCENE III. Paris. The KING's palace. -Enter BERTRAM, LAFEU, and PAROLLES - - -LAFEU -They say miracles are past; and we have our -philosophical persons, to make modern and familiar, -things supernatural and causeless. Hence is it that -we make trifles of terrors, ensconcing ourselves -into seeming knowledge, when we should submit -ourselves to an unknown fear. - - - -PAROLLES -Why, 'tis the rarest argument of wonder that hath -shot out in our latter times. - - - -BERTRAM -And so 'tis. - - - -LAFEU -To be relinquish'd of the artists,-- - - - -PAROLLES -So I say. - - - -LAFEU -Both of Galen and Paracelsus. - - - -PAROLLES -So I say. - - - -LAFEU -Of all the learned and authentic fellows,-- - - - -PAROLLES -Right; so I say. - - - -LAFEU -That gave him out incurable,-- - - - -PAROLLES -Why, there 'tis; so say I too. - - - -LAFEU -Not to be helped,-- - - - -PAROLLES -Right; as 'twere, a man assured of a-- - - - -LAFEU -Uncertain life, and sure death. - - - -PAROLLES -Just, you say well; so would I have said. - - - -LAFEU -I may truly say, it is a novelty to the world. - - - -PAROLLES -It is, indeed: if you will have it in showing, you -shall read it in--what do you call there? - - - -LAFEU -A showing of a heavenly effect in an earthly actor. - - - -PAROLLES -That's it; I would have said the very same. - - - -LAFEU -Why, your dolphin is not lustier: 'fore me, -I speak in respect-- - - - -PAROLLES -Nay, 'tis strange, 'tis very strange, that is the -brief and the tedious of it; and he's of a most -facinerious spirit that will not acknowledge it to be the-- - - - -LAFEU -Very hand of heaven. - - - -PAROLLES -Ay, so I say. - - - -LAFEU -In a most weak-- -pausing -and debile minister, great power, great -transcendence: which should, indeed, give us a -further use to be made than alone the recovery of -the king, as to be-- -pausing -generally thankful. - - - -PAROLLES -I would have said it; you say well. Here comes the king. - - -Enter KING, HELENA, and Attendants. LAFEU and -PAROLLES retire - - -LAFEU -Lustig, as the Dutchman says: I'll like a maid the -better, whilst I have a tooth in my head: why, he's -able to lead her a coranto. - - - -PAROLLES -Mort du vinaigre! is not this Helen? - - - -LAFEU -'Fore God, I think so. - - - -KING -Go, call before me all the lords in court. -Sit, my preserver, by thy patient's side; -And with this healthful hand, whose banish'd sense -Thou hast repeal'd, a second time receive -The confirmation of my promised gift, -Which but attends thy naming. -Enter three or four Lords -Fair maid, send forth thine eye: this youthful parcel -Of noble bachelors stand at my bestowing, -O'er whom both sovereign power and father's voice -I have to use: thy frank election make; -Thou hast power to choose, and they none to forsake. - - - -HELENA -To each of you one fair and virtuous mistress -Fall, when Love please! marry, to each, but one! - - - -LAFEU -I'ld give bay Curtal and his furniture, -My mouth no more were broken than these boys', -And writ as little beard. - - - -KING -Peruse them well: -Not one of those but had a noble father. - - - -HELENA -Gentlemen, -Heaven hath through me restored the king to health. - - - -All -We understand it, and thank heaven for you. - - - -HELENA -I am a simple maid, and therein wealthiest, -That I protest I simply am a maid. -Please it your majesty, I have done already: -The blushes in my cheeks thus whisper me, -'We blush that thou shouldst choose; but, be refused, -Let the white death sit on thy cheek for ever; -We'll ne'er come there again.' - - - -KING -Make choice; and, see, -Who shuns thy love shuns all his love in me. - - - -HELENA -Now, Dian, from thy altar do I fly, -And to imperial Love, that god most high, -Do my sighs stream. Sir, will you hear my suit? - - - -First Lord -And grant it. - - - -HELENA -Thanks, sir; all the rest is mute. - - - -LAFEU -I had rather be in this choice than throw ames-ace -for my life. - - - -HELENA -The honour, sir, that flames in your fair eyes, -Before I speak, too threateningly replies: -Love make your fortunes twenty times above -Her that so wishes and her humble love! - - - -Second Lord -No better, if you please. - - - -HELENA -My wish receive, -Which great Love grant! and so, I take my leave. - - - -LAFEU -Do all they deny her? An they were sons of mine, -I'd have them whipped; or I would send them to the -Turk, to make eunuchs of. - - - -HELENA -Be not afraid that I your hand should take; -I'll never do you wrong for your own sake: -Blessing upon your vows! and in your bed -Find fairer fortune, if you ever wed! - - - -LAFEU -These boys are boys of ice, they'll none have her: -sure, they are bastards to the English; the French -ne'er got 'em. - - - -HELENA -You are too young, too happy, and too good, -To make yourself a son out of my blood. - - - -Fourth Lord -Fair one, I think not so. - - - -LAFEU -There's one grape yet; I am sure thy father drunk -wine: but if thou be'st not an ass, I am a youth -of fourteen; I have known thee already. - - - -HELENA -To BERTRAM I dare not say I take you; but I give -Me and my service, ever whilst I live, -Into your guiding power. This is the man. - - - -KING -Why, then, young Bertram, take her; she's thy wife. - - - -BERTRAM -My wife, my liege! I shall beseech your highness, -In such a business give me leave to use -The help of mine own eyes. - - - -KING -Know'st thou not, Bertram, -What she has done for me? - - - -BERTRAM -Yes, my good lord; -But never hope to know why I should marry her. - - - -KING -Thou know'st she has raised me from my sickly bed. - - - -BERTRAM -But follows it, my lord, to bring me down -Must answer for your raising? I know her well: -She had her breeding at my father's charge. -A poor physician's daughter my wife! Disdain -Rather corrupt me ever! - - - -KING -'Tis only title thou disdain'st in her, the which -I can build up. Strange is it that our bloods, -Of colour, weight, and heat, pour'd all together, -Would quite confound distinction, yet stand off -In differences so mighty. If she be -All that is virtuous, save what thou dislikest, -A poor physician's daughter, thou dislikest -Of virtue for the name: but do not so: -From lowest place when virtuous things proceed, -The place is dignified by the doer's deed: -Where great additions swell's, and virtue none, -It is a dropsied honour. Good alone -Is good without a name. Vileness is so: -The property by what it is should go, -Not by the title. She is young, wise, fair; -In these to nature she's immediate heir, -And these breed honour: that is honour's scorn, -Which challenges itself as honour's born -And is not like the sire: honours thrive, -When rather from our acts we them derive -Than our foregoers: the mere word's a slave -Debosh'd on every tomb, on every grave -A lying trophy, and as oft is dumb -Where dust and damn'd oblivion is the tomb -Of honour'd bones indeed. What should be said? -If thou canst like this creature as a maid, -I can create the rest: virtue and she -Is her own dower; honour and wealth from me. - - - -BERTRAM -I cannot love her, nor will strive to do't. - - - -KING -Thou wrong'st thyself, if thou shouldst strive to choose. - - - -HELENA -That you are well restored, my lord, I'm glad: -Let the rest go. - - - -KING -My honour's at the stake; which to defeat, -I must produce my power. Here, take her hand, -Proud scornful boy, unworthy this good gift; -That dost in vile misprision shackle up -My love and her desert; that canst not dream, -We, poising us in her defective scale, -Shall weigh thee to the beam; that wilt not know, -It is in us to plant thine honour where -We please to have it grow. Cheque thy contempt: -Obey our will, which travails in thy good: -Believe not thy disdain, but presently -Do thine own fortunes that obedient right -Which both thy duty owes and our power claims; -Or I will throw thee from my care for ever -Into the staggers and the careless lapse -Of youth and ignorance; both my revenge and hate -Loosing upon thee, in the name of justice, -Without all terms of pity. Speak; thine answer. - - - -BERTRAM -Pardon, my gracious lord; for I submit -My fancy to your eyes: when I consider -What great creation and what dole of honour -Flies where you bid it, I find that she, which late -Was in my nobler thoughts most base, is now -The praised of the king; who, so ennobled, -Is as 'twere born so. - - - -KING -Take her by the hand, -And tell her she is thine: to whom I promise -A counterpoise, if not to thy estate -A balance more replete. - - - -BERTRAM -I take her hand. - - - -KING -Good fortune and the favour of the king -Smile upon this contract; whose ceremony -Shall seem expedient on the now-born brief, -And be perform'd to-night: the solemn feast -Shall more attend upon the coming space, -Expecting absent friends. As thou lovest her, -Thy love's to me religious; else, does err. - - -Exeunt all but LAFEU and PAROLLES - - -LAFEU -Advancing Do you hear, monsieur? a word with you. - - - -PAROLLES -Your pleasure, sir? - - - -LAFEU -Your lord and master did well to make his -recantation. - - - -PAROLLES -Recantation! My lord! my master! - - - -LAFEU -Ay; is it not a language I speak? - - - -PAROLLES -A most harsh one, and not to be understood without -bloody succeeding. My master! - - - -LAFEU -Are you companion to the Count Rousillon? - - - -PAROLLES -To any count, to all counts, to what is man. - - - -LAFEU -To what is count's man: count's master is of -another style. - - - -PAROLLES -You are too old, sir; let it satisfy you, you are too old. - - - -LAFEU -I must tell thee, sirrah, I write man; to which -title age cannot bring thee. - - - -PAROLLES -What I dare too well do, I dare not do. - - - -LAFEU -I did think thee, for two ordinaries, to be a pretty -wise fellow; thou didst make tolerable vent of thy -travel; it might pass: yet the scarfs and the -bannerets about thee did manifoldly dissuade me from -believing thee a vessel of too great a burthen. I -have now found thee; when I lose thee again, I care -not: yet art thou good for nothing but taking up; and -that thou't scarce worth. - - - -PAROLLES -Hadst thou not the privilege of antiquity upon thee,-- - - - -LAFEU -Do not plunge thyself too far in anger, lest thou -hasten thy trial; which if--Lord have mercy on thee -for a hen! So, my good window of lattice, fare thee -well: thy casement I need not open, for I look -through thee. Give me thy hand. - - - -PAROLLES -My lord, you give me most egregious indignity. - - - -LAFEU -Ay, with all my heart; and thou art worthy of it. - - - -PAROLLES -I have not, my lord, deserved it. - - - -LAFEU -Yes, good faith, every dram of it; and I will not -bate thee a scruple. - - - -PAROLLES -Well, I shall be wiser. - - - -LAFEU -Even as soon as thou canst, for thou hast to pull at -a smack o' the contrary. If ever thou be'st bound -in thy scarf and beaten, thou shalt find what it is -to be proud of thy bondage. I have a desire to hold -my acquaintance with thee, or rather my knowledge, -that I may say in the default, he is a man I know. - - - -PAROLLES -My lord, you do me most insupportable vexation. - - - -LAFEU -I would it were hell-pains for thy sake, and my poor -doing eternal: for doing I am past: as I will by -thee, in what motion age will give me leave. - - -Exit - - -PAROLLES -Well, thou hast a son shall take this disgrace off -me; scurvy, old, filthy, scurvy lord! Well, I must -be patient; there is no fettering of authority. -I'll beat him, by my life, if I can meet him with -any convenience, an he were double and double a -lord. I'll have no more pity of his age than I -would of--I'll beat him, an if I could but meet him again. - - -Re-enter LAFEU - - -LAFEU -Sirrah, your lord and master's married; there's news -for you: you have a new mistress. - - - -PAROLLES -I most unfeignedly beseech your lordship to make -some reservation of your wrongs: he is my good -lord: whom I serve above is my master. - - - -LAFEU -Who? God? - - - -PAROLLES -Ay, sir. - - - -LAFEU -The devil it is that's thy master. Why dost thou -garter up thy arms o' this fashion? dost make hose of -sleeves? do other servants so? Thou wert best set -thy lower part where thy nose stands. By mine -honour, if I were but two hours younger, I'ld beat -thee: methinks, thou art a general offence, and -every man should beat thee: I think thou wast -created for men to breathe themselves upon thee. - - - -PAROLLES -This is hard and undeserved measure, my lord. - - - -LAFEU -Go to, sir; you were beaten in Italy for picking a -kernel out of a pomegranate; you are a vagabond and -no true traveller: you are more saucy with lords -and honourable personages than the commission of your -birth and virtue gives you heraldry. You are not -worth another word, else I'ld call you knave. I leave you. - - -Exit - - -PAROLLES -Good, very good; it is so then: good, very good; -let it be concealed awhile. - - -Re-enter BERTRAM - - -BERTRAM -Undone, and forfeited to cares for ever! - - - -PAROLLES -What's the matter, sweet-heart? - - - -BERTRAM -Although before the solemn priest I have sworn, -I will not bed her. - - - -PAROLLES -What, what, sweet-heart? - - - -BERTRAM -O my Parolles, they have married me! -I'll to the Tuscan wars, and never bed her. - - - -PAROLLES -France is a dog-hole, and it no more merits -The tread of a man's foot: to the wars! - - - -BERTRAM -There's letters from my mother: what the import is, -I know not yet. - - - -PAROLLES -Ay, that would be known. To the wars, my boy, to the wars! -He wears his honour in a box unseen, -That hugs his kicky-wicky here at home, -Spending his manly marrow in her arms, -Which should sustain the bound and high curvet -Of Mars's fiery steed. To other regions -France is a stable; we that dwell in't jades; -Therefore, to the war! - - - -BERTRAM -It shall be so: I'll send her to my house, -Acquaint my mother with my hate to her, -And wherefore I am fled; write to the king -That which I durst not speak; his present gift -Shall furnish me to those Italian fields, -Where noble fellows strike: war is no strife -To the dark house and the detested wife. - - - -PAROLLES -Will this capriccio hold in thee? art sure? - - - -BERTRAM -Go with me to my chamber, and advise me. -I'll send her straight away: to-morrow -I'll to the wars, she to her single sorrow. - - - -PAROLLES -Why, these balls bound; there's noise in it. 'Tis hard: -A young man married is a man that's marr'd: -Therefore away, and leave her bravely; go: -The king has done you wrong: but, hush, 'tis so. - - -Exeunt - - -SCENE IV. Paris. The KING's palace. -Enter HELENA and Clown - - -HELENA -My mother greets me kindly; is she well? - - - -Clown -She is not well; but yet she has her health: she's -very merry; but yet she is not well: but thanks be -given, she's very well and wants nothing i', the -world; but yet she is not well. - - - -HELENA -If she be very well, what does she ail, that she's -not very well? - - - -Clown -Truly, she's very well indeed, but for two things. - - - -HELENA -What two things? - - - -Clown -One, that she's not in heaven, whither God send her -quickly! the other that she's in earth, from whence -God send her quickly! - - -Enter PAROLLES - - -PAROLLES -Bless you, my fortunate lady! - - - -HELENA -I hope, sir, I have your good will to have mine own -good fortunes. - - - -PAROLLES -You had my prayers to lead them on; and to keep them -on, have them still. O, my knave, how does my old lady? - - - -Clown -So that you had her wrinkles and I her money, -I would she did as you say. - - - -PAROLLES -Why, I say nothing. - - - -Clown -Marry, you are the wiser man; for many a man's -tongue shakes out his master's undoing: to say -nothing, to do nothing, to know nothing, and to have -nothing, is to be a great part of your title; which -is within a very little of nothing. - - - -PAROLLES -Away! thou'rt a knave. - - - -Clown -You should have said, sir, before a knave thou'rt a -knave; that's, before me thou'rt a knave: this had -been truth, sir. - - - -PAROLLES -Go to, thou art a witty fool; I have found thee. - - - -Clown -Did you find me in yourself, sir? or were you -taught to find me? The search, sir, was profitable; -and much fool may you find in you, even to the -world's pleasure and the increase of laughter. - - - -PAROLLES -A good knave, i' faith, and well fed. -Madam, my lord will go away to-night; -A very serious business calls on him. -The great prerogative and rite of love, -Which, as your due, time claims, he does acknowledge; -But puts it off to a compell'd restraint; -Whose want, and whose delay, is strew'd with sweets, -Which they distil now in the curbed time, -To make the coming hour o'erflow with joy -And pleasure drown the brim. - - - -HELENA -What's his will else? - - - -PAROLLES -That you will take your instant leave o' the king -And make this haste as your own good proceeding, -Strengthen'd with what apology you think -May make it probable need. - - - -HELENA -What more commands he? - - - -PAROLLES -That, having this obtain'd, you presently -Attend his further pleasure. - - - -HELENA -In every thing I wait upon his will. - - - -PAROLLES -I shall report it so. - - - -HELENA -I pray you. -Exit PAROLLES -Come, sirrah. - - -Exeunt - - -SCENE V. Paris. The KING's palace. -Enter LAFEU and BERTRAM - - -LAFEU -But I hope your lordship thinks not him a soldier. - - - -BERTRAM -Yes, my lord, and of very valiant approof. - - - -LAFEU -You have it from his own deliverance. - - - -BERTRAM -And by other warranted testimony. - - - -LAFEU -Then my dial goes not true: I took this lark for a bunting. - - - -BERTRAM -I do assure you, my lord, he is very great in -knowledge and accordingly valiant. - - - -LAFEU -I have then sinned against his experience and -transgressed against his valour; and my state that -way is dangerous, since I cannot yet find in my -heart to repent. Here he comes: I pray you, make -us friends; I will pursue the amity. - - -Enter PAROLLES - - -PAROLLES -To BERTRAM These things shall be done, sir. - - - -LAFEU -Pray you, sir, who's his tailor? - - - -PAROLLES -Sir? - - - -LAFEU -O, I know him well, I, sir; he, sir, 's a good -workman, a very good tailor. - - - -BERTRAM -Aside to PAROLLES Is she gone to the king? - - - -PAROLLES -She is. - - - -BERTRAM -Will she away to-night? - - - -PAROLLES -As you'll have her. - - - -BERTRAM -I have writ my letters, casketed my treasure, -Given order for our horses; and to-night, -When I should take possession of the bride, -End ere I do begin. - - - -LAFEU -A good traveller is something at the latter end of a -dinner; but one that lies three thirds and uses a -known truth to pass a thousand nothings with, should -be once heard and thrice beaten. God save you, captain. - - - -BERTRAM -Is there any unkindness between my lord and you, monsieur? - - - -PAROLLES -I know not how I have deserved to run into my lord's -displeasure. - - - -LAFEU -You have made shift to run into 't, boots and spurs -and all, like him that leaped into the custard; and -out of it you'll run again, rather than suffer -question for your residence. - - - -BERTRAM -It may be you have mistaken him, my lord. - - - -LAFEU -And shall do so ever, though I took him at 's -prayers. Fare you well, my lord; and believe this -of me, there can be no kernel in this light nut; the -soul of this man is his clothes. Trust him not in -matter of heavy consequence; I have kept of them -tame, and know their natures. Farewell, monsieur: -I have spoken better of you than you have or will to -deserve at my hand; but we must do good against evil. - - -Exit - - -PAROLLES -An idle lord. I swear. - - - -BERTRAM -I think so. - - - -PAROLLES -Why, do you not know him? - - - -BERTRAM -Yes, I do know him well, and common speech -Gives him a worthy pass. Here comes my clog. - - -Enter HELENA - - -HELENA -I have, sir, as I was commanded from you, -Spoke with the king and have procured his leave -For present parting; only he desires -Some private speech with you. - - - -BERTRAM -I shall obey his will. -You must not marvel, Helen, at my course, -Which holds not colour with the time, nor does -The ministration and required office -On my particular. Prepared I was not -For such a business; therefore am I found -So much unsettled: this drives me to entreat you -That presently you take our way for home; -And rather muse than ask why I entreat you, -For my respects are better than they seem -And my appointments have in them a need -Greater than shows itself at the first view -To you that know them not. This to my mother: -Giving a letter -'Twill be two days ere I shall see you, so -I leave you to your wisdom. - - - -HELENA -Sir, I can nothing say, -But that I am your most obedient servant. - - - -BERTRAM -Come, come, no more of that. - - - -HELENA -And ever shall -With true observance seek to eke out that -Wherein toward me my homely stars have fail'd -To equal my great fortune. - - - -BERTRAM -Let that go: -My haste is very great: farewell; hie home. - - - -HELENA -Pray, sir, your pardon. - - - -BERTRAM -Well, what would you say? - - - -HELENA -I am not worthy of the wealth I owe, -Nor dare I say 'tis mine, and yet it is; -But, like a timorous thief, most fain would steal -What law does vouch mine own. - - - -BERTRAM -What would you have? - - - -HELENA -Something; and scarce so much: nothing, indeed. -I would not tell you what I would, my lord: -Faith yes; -Strangers and foes do sunder, and not kiss. - - - -BERTRAM -I pray you, stay not, but in haste to horse. - - - -HELENA -I shall not break your bidding, good my lord. - - - -BERTRAM -Where are my other men, monsieur? Farewell. -Exit HELENA -Go thou toward home; where I will never come -Whilst I can shake my sword or hear the drum. -Away, and for our flight. - - - -PAROLLES -Bravely, coragio! - - -Exeunt - - - - -ACT III - -SCENE I. Florence. The DUKE's palace. -Flourish. Enter the DUKE of Florence attended; -the two Frenchmen, with a troop of soldiers. - - -DUKE -So that from point to point now have you heard -The fundamental reasons of this war, -Whose great decision hath much blood let forth -And more thirsts after. - - - -First Lord -Holy seems the quarrel -Upon your grace's part; black and fearful -On the opposer. - - - -DUKE -Therefore we marvel much our cousin France -Would in so just a business shut his bosom -Against our borrowing prayers. - - - -Second Lord -Good my lord, -The reasons of our state I cannot yield, -But like a common and an outward man, -That the great figure of a council frames -By self-unable motion: therefore dare not -Say what I think of it, since I have found -Myself in my incertain grounds to fail -As often as I guess'd. - - - -DUKE -Be it his pleasure. - - - -First Lord -But I am sure the younger of our nature, -That surfeit on their ease, will day by day -Come here for physic. - - - -DUKE -Welcome shall they be; -And all the honours that can fly from us -Shall on them settle. You know your places well; -When better fall, for your avails they fell: -To-morrow to the field. - - -Flourish. Exeunt - - -SCENE II. Rousillon. The COUNT's palace. -Enter COUNTESS and Clown - - -COUNTESS -It hath happened all as I would have had it, save -that he comes not along with her. - - - -Clown -By my troth, I take my young lord to be a very -melancholy man. - - - -COUNTESS -By what observance, I pray you? - - - -Clown -Why, he will look upon his boot and sing; mend the -ruff and sing; ask questions and sing; pick his -teeth and sing. I know a man that had this trick of -melancholy sold a goodly manor for a song. - - - -COUNTESS -Let me see what he writes, and when he means to come. - - -Opening a letter - - -Clown -I have no mind to Isbel since I was at court: our -old ling and our Isbels o' the country are nothing -like your old ling and your Isbels o' the court: -the brains of my Cupid's knocked out, and I begin to -love, as an old man loves money, with no stomach. - - - -COUNTESS -What have we here? - - - -Clown -E'en that you have there. - - -Exit - - -COUNTESS -Reads I have sent you a daughter-in-law: she hath -recovered the king, and undone me. I have wedded -her, not bedded her; and sworn to make the 'not' -eternal. You shall hear I am run away: know it -before the report come. If there be breadth enough -in the world, I will hold a long distance. My duty -to you. Your unfortunate son, -BERTRAM. -This is not well, rash and unbridled boy. -To fly the favours of so good a king; -To pluck his indignation on thy head -By the misprising of a maid too virtuous -For the contempt of empire. - - -Re-enter Clown - - -Clown -O madam, yonder is heavy news within between two -soldiers and my young lady! - - - -COUNTESS -What is the matter? - - - -Clown -Nay, there is some comfort in the news, some -comfort; your son will not be killed so soon as I -thought he would. - - - -COUNTESS -Why should he be killed? - - - -Clown -So say I, madam, if he run away, as I hear he does: -the danger is in standing to't; that's the loss of -men, though it be the getting of children. Here -they come will tell you more: for my part, I only -hear your son was run away. - - -Exit -Enter HELENA, and two Gentlemen - - -First Gentleman -Save you, good madam. - - - -HELENA -Madam, my lord is gone, for ever gone. - - - -Second Gentleman -Do not say so. - - - -COUNTESS -Think upon patience. Pray you, gentlemen, -I have felt so many quirks of joy and grief, -That the first face of neither, on the start, -Can woman me unto't: where is my son, I pray you? - - - -Second Gentleman -Madam, he's gone to serve the duke of Florence: -We met him thitherward; for thence we came, -And, after some dispatch in hand at court, -Thither we bend again. - - - -HELENA -Look on his letter, madam; here's my passport. -Reads -When thou canst get the ring upon my finger which -never shall come off, and show me a child begotten -of thy body that I am father to, then call me -husband: but in such a 'then' I write a 'never.' -This is a dreadful sentence. - - - -COUNTESS -Brought you this letter, gentlemen? - - - -First Gentleman -Ay, madam; -And for the contents' sake are sorry for our pain. - - - -COUNTESS -I prithee, lady, have a better cheer; -If thou engrossest all the griefs are thine, -Thou robb'st me of a moiety: he was my son; -But I do wash his name out of my blood, -And thou art all my child. Towards Florence is he? - - - -Second Gentleman -Ay, madam. - - - -COUNTESS -And to be a soldier? - - - -Second Gentleman -Such is his noble purpose; and believe 't, -The duke will lay upon him all the honour -That good convenience claims. - - - -COUNTESS -Return you thither? - - - -First Gentleman -Ay, madam, with the swiftest wing of speed. - - - -HELENA -Reads Till I have no wife I have nothing in France. -'Tis bitter. - - - -COUNTESS -Find you that there? - - - -HELENA -Ay, madam. - - - -First Gentleman -'Tis but the boldness of his hand, haply, which his -heart was not consenting to. - - - -COUNTESS -Nothing in France, until he have no wife! -There's nothing here that is too good for him -But only she; and she deserves a lord -That twenty such rude boys might tend upon -And call her hourly mistress. Who was with him? - - - -First Gentleman -A servant only, and a gentleman -Which I have sometime known. - - - -COUNTESS -Parolles, was it not? - - - -First Gentleman -Ay, my good lady, he. - - - -COUNTESS -A very tainted fellow, and full of wickedness. -My son corrupts a well-derived nature -With his inducement. - - - -First Gentleman -Indeed, good lady, -The fellow has a deal of that too much, -Which holds him much to have. - - - -COUNTESS -You're welcome, gentlemen. -I will entreat you, when you see my son, -To tell him that his sword can never win -The honour that he loses: more I'll entreat you -Written to bear along. - - - -Second Gentleman -We serve you, madam, -In that and all your worthiest affairs. - - - -COUNTESS -Not so, but as we change our courtesies. -Will you draw near! - - -Exeunt COUNTESS and Gentlemen - - -HELENA -'Till I have no wife, I have nothing in France.' -Nothing in France, until he has no wife! -Thou shalt have none, Rousillon, none in France; -Then hast thou all again. Poor lord! is't I -That chase thee from thy country and expose -Those tender limbs of thine to the event -Of the none-sparing war? and is it I -That drive thee from the sportive court, where thou -Wast shot at with fair eyes, to be the mark -Of smoky muskets? O you leaden messengers, -That ride upon the violent speed of fire, -Fly with false aim; move the still-peering air, -That sings with piercing; do not touch my lord. -Whoever shoots at him, I set him there; -Whoever charges on his forward breast, -I am the caitiff that do hold him to't; -And, though I kill him not, I am the cause -His death was so effected: better 'twere -I met the ravin lion when he roar'd -With sharp constraint of hunger; better 'twere -That all the miseries which nature owes -Were mine at once. No, come thou home, Rousillon, -Whence honour but of danger wins a scar, -As oft it loses all: I will be gone; -My being here it is that holds thee hence: -Shall I stay here to do't? no, no, although -The air of paradise did fan the house -And angels officed all: I will be gone, -That pitiful rumour may report my flight, -To consolate thine ear. Come, night; end, day! -For with the dark, poor thief, I'll steal away. - - -Exit - - -SCENE III. Florence. Before the DUKE's palace. -Flourish. Enter the DUKE of Florence, BERTRAM, -PAROLLES, Soldiers, Drum, and Trumpets - - -DUKE -The general of our horse thou art; and we, -Great in our hope, lay our best love and credence -Upon thy promising fortune. - - - -BERTRAM -Sir, it is -A charge too heavy for my strength, but yet -We'll strive to bear it for your worthy sake -To the extreme edge of hazard. - - - -DUKE -Then go thou forth; -And fortune play upon thy prosperous helm, -As thy auspicious mistress! - - - -BERTRAM -This very day, -Great Mars, I put myself into thy file: -Make me but like my thoughts, and I shall prove -A lover of thy drum, hater of love. - - -Exeunt - - -SCENE IV. Rousillon. The COUNT's palace. -Enter COUNTESS and Steward - - -COUNTESS -Alas! and would you take the letter of her? -Might you not know she would do as she has done, -By sending me a letter? Read it again. - - - -Steward -Reads -I am Saint Jaques' pilgrim, thither gone: -Ambitious love hath so in me offended, -That barefoot plod I the cold ground upon, -With sainted vow my faults to have amended. -Write, write, that from the bloody course of war -My dearest master, your dear son, may hie: -Bless him at home in peace, whilst I from far -His name with zealous fervor sanctify: -His taken labours bid him me forgive; -I, his despiteful Juno, sent him forth -From courtly friends, with camping foes to live, -Where death and danger dogs the heels of worth: -He is too good and fair for death and me: -Whom I myself embrace, to set him free. - - - -COUNTESS -Ah, what sharp stings are in her mildest words! -Rinaldo, you did never lack advice so much, -As letting her pass so: had I spoke with her, -I could have well diverted her intents, -Which thus she hath prevented. - - - -Steward -Pardon me, madam: -If I had given you this at over-night, -She might have been o'erta'en; and yet she writes, -Pursuit would be but vain. - - - -COUNTESS -What angel shall -Bless this unworthy husband? he cannot thrive, -Unless her prayers, whom heaven delights to hear -And loves to grant, reprieve him from the wrath -Of greatest justice. Write, write, Rinaldo, -To this unworthy husband of his wife; -Let every word weigh heavy of her worth -That he does weigh too light: my greatest grief. -Though little he do feel it, set down sharply. -Dispatch the most convenient messenger: -When haply he shall hear that she is gone, -He will return; and hope I may that she, -Hearing so much, will speed her foot again, -Led hither by pure love: which of them both -Is dearest to me. I have no skill in sense -To make distinction: provide this messenger: -My heart is heavy and mine age is weak; -Grief would have tears, and sorrow bids me speak. - - -Exeunt - - -SCENE V. Florence. Without the walls. A tucket afar off. -Enter an old Widow of Florence, DIANA, VIOLENTA, -and MARIANA, with other Citizens - - -Widow -Nay, come; for if they do approach the city, we -shall lose all the sight. - - - -DIANA -They say the French count has done most honourable service. - - - -Widow -It is reported that he has taken their greatest -commander; and that with his own hand he slew the -duke's brother. -Tucket -We have lost our labour; they are gone a contrary -way: hark! you may know by their trumpets. - - - -MARIANA -Come, let's return again, and suffice ourselves with -the report of it. Well, Diana, take heed of this -French earl: the honour of a maid is her name; and -no legacy is so rich as honesty. - - - -Widow -I have told my neighbour how you have been solicited -by a gentleman his companion. - - - -MARIANA -I know that knave; hang him! one Parolles: a -filthy officer he is in those suggestions for the -young earl. Beware of them, Diana; their promises, -enticements, oaths, tokens, and all these engines of -lust, are not the things they go under: many a maid -hath been seduced by them; and the misery is, -example, that so terrible shows in the wreck of -maidenhood, cannot for all that dissuade succession, -but that they are limed with the twigs that threaten -them. I hope I need not to advise you further; but -I hope your own grace will keep you where you are, -though there were no further danger known but the -modesty which is so lost. - - - -DIANA -You shall not need to fear me. - - - -Widow -I hope so. -Enter HELENA, disguised like a Pilgrim -Look, here comes a pilgrim: I know she will lie at -my house; thither they send one another: I'll -question her. God save you, pilgrim! whither are you bound? - - - -HELENA -To Saint Jaques le Grand. -Where do the palmers lodge, I do beseech you? - - - -Widow -At the Saint Francis here beside the port. - - - -HELENA -Is this the way? - - - -Widow -Ay, marry, is't. -A march afar -Hark you! they come this way. -If you will tarry, holy pilgrim, -But till the troops come by, -I will conduct you where you shall be lodged; -The rather, for I think I know your hostess -As ample as myself. - - - -HELENA -Is it yourself? - - - -Widow -If you shall please so, pilgrim. - - - -HELENA -I thank you, and will stay upon your leisure. - - - -Widow -You came, I think, from France? - - - -HELENA -I did so. - - - -Widow -Here you shall see a countryman of yours -That has done worthy service. - - - -HELENA -His name, I pray you. - - - -DIANA -The Count Rousillon: know you such a one? - - - -HELENA -But by the ear, that hears most nobly of him: -His face I know not. - - - -DIANA -Whatsome'er he is, -He's bravely taken here. He stole from France, -As 'tis reported, for the king had married him -Against his liking: think you it is so? - - - -HELENA -Ay, surely, mere the truth: I know his lady. - - - -DIANA -There is a gentleman that serves the count -Reports but coarsely of her. - - - -HELENA -What's his name? - - - -DIANA -Monsieur Parolles. - - - -HELENA -O, I believe with him, -In argument of praise, or to the worth -Of the great count himself, she is too mean -To have her name repeated: all her deserving -Is a reserved honesty, and that -I have not heard examined. - - - -DIANA -Alas, poor lady! -'Tis a hard bondage to become the wife -Of a detesting lord. - - - -Widow -I warrant, good creature, wheresoe'er she is, -Her heart weighs sadly: this young maid might do her -A shrewd turn, if she pleased. - - - -HELENA -How do you mean? -May be the amorous count solicits her -In the unlawful purpose. - - - -Widow -He does indeed; -And brokes with all that can in such a suit -Corrupt the tender honour of a maid: -But she is arm'd for him and keeps her guard -In honestest defence. - - - -MARIANA -The gods forbid else! - - - -Widow -So, now they come: -Drum and Colours -Enter BERTRAM, PAROLLES, and the whole army -That is Antonio, the duke's eldest son; -That, Escalus. - - - -HELENA -Which is the Frenchman? - - - -DIANA -He; -That with the plume: 'tis a most gallant fellow. -I would he loved his wife: if he were honester -He were much goodlier: is't not a handsome gentleman? - - - -HELENA -I like him well. - - - -DIANA -'Tis pity he is not honest: yond's that same knave -That leads him to these places: were I his lady, -I would Poison that vile rascal. - - - -HELENA -Which is he? - - - -DIANA -That jack-an-apes with scarfs: why is he melancholy? - - - -HELENA -Perchance he's hurt i' the battle. - - - -PAROLLES -Lose our drum! well. - - - -MARIANA -He's shrewdly vexed at something: look, he has spied us. - - - -Widow -Marry, hang you! - - - -MARIANA -And your courtesy, for a ring-carrier! - - -Exeunt BERTRAM, PAROLLES, and army - - -Widow -The troop is past. Come, pilgrim, I will bring you -Where you shall host: of enjoin'd penitents -There's four or five, to great Saint Jaques bound, -Already at my house. - - - -HELENA -I humbly thank you: -Please it this matron and this gentle maid -To eat with us to-night, the charge and thanking -Shall be for me; and, to requite you further, -I will bestow some precepts of this virgin -Worthy the note. - - - -BOTH -We'll take your offer kindly. - - -Exeunt - - -SCENE VI. Camp before Florence. -Enter BERTRAM and the two French Lords - - -Second Lord -Nay, good my lord, put him to't; let him have his -way. - - - -First Lord -If your lordship find him not a hilding, hold me no -more in your respect. - - - -Second Lord -On my life, my lord, a bubble. - - - -BERTRAM -Do you think I am so far deceived in him? - - - -Second Lord -Believe it, my lord, in mine own direct knowledge, -without any malice, but to speak of him as my -kinsman, he's a most notable coward, an infinite and -endless liar, an hourly promise-breaker, the owner -of no one good quality worthy your lordship's -entertainment. - - - -First Lord -It were fit you knew him; lest, reposing too far in -his virtue, which he hath not, he might at some -great and trusty business in a main danger fail you. - - - -BERTRAM -I would I knew in what particular action to try him. - - - -First Lord -None better than to let him fetch off his drum, -which you hear him so confidently undertake to do. - - - -Second Lord -I, with a troop of Florentines, will suddenly -surprise him; such I will have, whom I am sure he -knows not from the enemy: we will bind and hoodwink -him so, that he shall suppose no other but that he -is carried into the leaguer of the adversaries, when -we bring him to our own tents. Be but your lordship -present at his examination: if he do not, for the -promise of his life and in the highest compulsion of -base fear, offer to betray you and deliver all the -intelligence in his power against you, and that with -the divine forfeit of his soul upon oath, never -trust my judgment in any thing. - - - -First Lord -O, for the love of laughter, let him fetch his drum; -he says he has a stratagem for't: when your -lordship sees the bottom of his success in't, and to -what metal this counterfeit lump of ore will be -melted, if you give him not John Drum's -entertainment, your inclining cannot be removed. -Here he comes. - - -Enter PAROLLES - - -Second Lord -Aside to BERTRAM O, for the love of laughter, -hinder not the honour of his design: let him fetch -off his drum in any hand. - - - -BERTRAM -How now, monsieur! this drum sticks sorely in your -disposition. - - - -First Lord -A pox on't, let it go; 'tis but a drum. - - - -PAROLLES -'But a drum'! is't 'but a drum'? A drum so lost! -There was excellent command,--to charge in with our -horse upon our own wings, and to rend our own soldiers! - - - -First Lord -That was not to be blamed in the command of the -service: it was a disaster of war that Caesar -himself could not have prevented, if he had been -there to command. - - - -BERTRAM -Well, we cannot greatly condemn our success: some -dishonour we had in the loss of that drum; but it is -not to be recovered. - - - -PAROLLES -It might have been recovered. - - - -BERTRAM -It might; but it is not now. - - - -PAROLLES -It is to be recovered: but that the merit of -service is seldom attributed to the true and exact -performer, I would have that drum or another, or -'hic jacet.' - - - -BERTRAM -Why, if you have a stomach, to't, monsieur: if you -think your mystery in stratagem can bring this -instrument of honour again into his native quarter, -be magnanimous in the enterprise and go on; I will -grace the attempt for a worthy exploit: if you -speed well in it, the duke shall both speak of it. -and extend to you what further becomes his -greatness, even to the utmost syllable of your -worthiness. - - - -PAROLLES -By the hand of a soldier, I will undertake it. - - - -BERTRAM -But you must not now slumber in it. - - - -PAROLLES -I'll about it this evening: and I will presently -pen down my dilemmas, encourage myself in my -certainty, put myself into my mortal preparation; -and by midnight look to hear further from me. - - - -BERTRAM -May I be bold to acquaint his grace you are gone about it? - - - -PAROLLES -I know not what the success will be, my lord; but -the attempt I vow. - - - -BERTRAM -I know thou'rt valiant; and, to the possibility of -thy soldiership, will subscribe for thee. Farewell. - - - -PAROLLES -I love not many words. - - -Exit - - -Second Lord -No more than a fish loves water. Is not this a -strange fellow, my lord, that so confidently seems -to undertake this business, which he knows is not to -be done; damns himself to do and dares better be -damned than to do't? - - - -First Lord -You do not know him, my lord, as we do: certain it -is that he will steal himself into a man's favour and -for a week escape a great deal of discoveries; but -when you find him out, you have him ever after. - - - -BERTRAM -Why, do you think he will make no deed at all of -this that so seriously he does address himself unto? - - - -Second Lord -None in the world; but return with an invention and -clap upon you two or three probable lies: but we -have almost embossed him; you shall see his fall -to-night; for indeed he is not for your lordship's respect. - - - -First Lord -We'll make you some sport with the fox ere we case -him. He was first smoked by the old lord Lafeu: -when his disguise and he is parted, tell me what a -sprat you shall find him; which you shall see this -very night. - - - -Second Lord -I must go look my twigs: he shall be caught. - - - -BERTRAM -Your brother he shall go along with me. - - - -Second Lord -As't please your lordship: I'll leave you. - - -Exit - - -BERTRAM -Now will I lead you to the house, and show you -The lass I spoke of. - - - -First Lord -But you say she's honest. - - - -BERTRAM -That's all the fault: I spoke with her but once -And found her wondrous cold; but I sent to her, -By this same coxcomb that we have i' the wind, -Tokens and letters which she did re-send; -And this is all I have done. She's a fair creature: -Will you go see her? - - - -First Lord -With all my heart, my lord. - - -Exeunt - - -SCENE VII. Florence. The Widow's house. -Enter HELENA and Widow - - -HELENA -If you misdoubt me that I am not she, -I know not how I shall assure you further, -But I shall lose the grounds I work upon. - - - -Widow -Though my estate be fallen, I was well born, -Nothing acquainted with these businesses; -And would not put my reputation now -In any staining act. - - - -HELENA -Nor would I wish you. -First, give me trust, the count he is my husband, -And what to your sworn counsel I have spoken -Is so from word to word; and then you cannot, -By the good aid that I of you shall borrow, -Err in bestowing it. - - - -Widow -I should believe you: -For you have show'd me that which well approves -You're great in fortune. - - - -HELENA -Take this purse of gold, -And let me buy your friendly help thus far, -Which I will over-pay and pay again -When I have found it. The count he wooes your daughter, -Lays down his wanton siege before her beauty, -Resolved to carry her: let her in fine consent, -As we'll direct her how 'tis best to bear it. -Now his important blood will nought deny -That she'll demand: a ring the county wears, -That downward hath succeeded in his house -From son to son, some four or five descents -Since the first father wore it: this ring he holds -In most rich choice; yet in his idle fire, -To buy his will, it would not seem too dear, -Howe'er repented after. - - - -Widow -Now I see -The bottom of your purpose. - - - -HELENA -You see it lawful, then: it is no more, -But that your daughter, ere she seems as won, -Desires this ring; appoints him an encounter; -In fine, delivers me to fill the time, -Herself most chastely absent: after this, -To marry her, I'll add three thousand crowns -To what is passed already. - - - -Widow -I have yielded: -Instruct my daughter how she shall persever, -That time and place with this deceit so lawful -May prove coherent. Every night he comes -With musics of all sorts and songs composed -To her unworthiness: it nothing steads us -To chide him from our eaves; for he persists -As if his life lay on't. - - - -HELENA -Why then to-night -Let us assay our plot; which, if it speed, -Is wicked meaning in a lawful deed -And lawful meaning in a lawful act, -Where both not sin, and yet a sinful fact: -But let's about it. - - -Exeunt - - - - -ACT IV - -SCENE I. Without the Florentine camp. -Enter Second French Lord, with five or six other -Soldiers in ambush - - -Second Lord -He can come no other way but by this hedge-corner. -When you sally upon him, speak what terrible -language you will: though you understand it not -yourselves, no matter; for we must not seem to -understand him, unless some one among us whom we -must produce for an interpreter. - - - -First Soldier -Good captain, let me be the interpreter. - - - -Second Lord -Art not acquainted with him? knows he not thy voice? - - - -First Soldier -No, sir, I warrant you. - - - -Second Lord -But what linsey-woolsey hast thou to speak to us again? - - - -First Soldier -E'en such as you speak to me. - - - -Second Lord -He must think us some band of strangers i' the -adversary's entertainment. Now he hath a smack of -all neighbouring languages; therefore we must every -one be a man of his own fancy, not to know what we -speak one to another; so we seem to know, is to -know straight our purpose: choughs' language, -gabble enough, and good enough. As for you, -interpreter, you must seem very politic. But couch, -ho! here he comes, to beguile two hours in a sleep, -and then to return and swear the lies he forges. - - -Enter PAROLLES - - -PAROLLES -Ten o'clock: within these three hours 'twill be -time enough to go home. What shall I say I have -done? It must be a very plausive invention that -carries it: they begin to smoke me; and disgraces -have of late knocked too often at my door. I find -my tongue is too foolhardy; but my heart hath the -fear of Mars before it and of his creatures, not -daring the reports of my tongue. - - - -Second Lord -This is the first truth that e'er thine own tongue -was guilty of. - - - -PAROLLES -What the devil should move me to undertake the -recovery of this drum, being not ignorant of the -impossibility, and knowing I had no such purpose? I -must give myself some hurts, and say I got them in -exploit: yet slight ones will not carry it; they -will say, 'Came you off with so little?' and great -ones I dare not give. Wherefore, what's the -instance? Tongue, I must put you into a -butter-woman's mouth and buy myself another of -Bajazet's mule, if you prattle me into these perils. - - - -Second Lord -Is it possible he should know what he is, and be -that he is? - - - -PAROLLES -I would the cutting of my garments would serve the -turn, or the breaking of my Spanish sword. - - - -Second Lord -We cannot afford you so. - - - -PAROLLES -Or the baring of my beard; and to say it was in -stratagem. - - - -Second Lord -'Twould not do. - - - -PAROLLES -Or to drown my clothes, and say I was stripped. - - - -Second Lord -Hardly serve. - - - -PAROLLES -Though I swore I leaped from the window of the citadel. - - - -Second Lord -How deep? - - - -PAROLLES -Thirty fathom. - - - -Second Lord -Three great oaths would scarce make that be believed. - - - -PAROLLES -I would I had any drum of the enemy's: I would swear -I recovered it. - - - -Second Lord -You shall hear one anon. - - - -PAROLLES -A drum now of the enemy's,-- - - -Alarum within - - -Second Lord -Throca movousus, cargo, cargo, cargo. - - - -All -Cargo, cargo, cargo, villiando par corbo, cargo. - - - -PAROLLES -O, ransom, ransom! do not hide mine eyes. - - -They seize and blindfold him - - -First Soldier -Boskos thromuldo boskos. - - - -PAROLLES -I know you are the Muskos' regiment: -And I shall lose my life for want of language; -If there be here German, or Dane, low Dutch, -Italian, or French, let him speak to me; I'll -Discover that which shall undo the Florentine. - - - -First Soldier -Boskos vauvado: I understand thee, and can speak -thy tongue. Kerely bonto, sir, betake thee to thy -faith, for seventeen poniards are at thy bosom. - - - -PAROLLES -O! - - - -First Soldier -O, pray, pray, pray! Manka revania dulche. - - - -Second Lord -Oscorbidulchos volivorco. - - - -First Soldier -The general is content to spare thee yet; -And, hoodwink'd as thou art, will lead thee on -To gather from thee: haply thou mayst inform -Something to save thy life. - - - -PAROLLES -O, let me live! -And all the secrets of our camp I'll show, -Their force, their purposes; nay, I'll speak that -Which you will wonder at. - - - -First Soldier -But wilt thou faithfully? - - - -PAROLLES -If I do not, damn me. - - - -First Soldier -Acordo linta. -Come on; thou art granted space. - - -Exit, with PAROLLES guarded. A short alarum within - - -Second Lord -Go, tell the Count Rousillon, and my brother, -We have caught the woodcock, and will keep him muffled -Till we do hear from them. - - - -Second Soldier -Captain, I will. - - - -Second Lord -A' will betray us all unto ourselves: -Inform on that. - - - -Second Soldier -So I will, sir. - - - -Second Lord -Till then I'll keep him dark and safely lock'd. - - -Exeunt - - -SCENE II. Florence. The Widow's house. -Enter BERTRAM and DIANA - - -BERTRAM -They told me that your name was Fontibell. - - - -DIANA -No, my good lord, Diana. - - - -BERTRAM -Titled goddess; -And worth it, with addition! But, fair soul, -In your fine frame hath love no quality? -If quick fire of youth light not your mind, -You are no maiden, but a monument: -When you are dead, you should be such a one -As you are now, for you are cold and stem; -And now you should be as your mother was -When your sweet self was got. - - - -DIANA -She then was honest. - - - -BERTRAM -So should you be. - - - -DIANA -No: -My mother did but duty; such, my lord, -As you owe to your wife. - - - -BERTRAM -No more o' that; -I prithee, do not strive against my vows: -I was compell'd to her; but I love thee -By love's own sweet constraint, and will for ever -Do thee all rights of service. - - - -DIANA -Ay, so you serve us -Till we serve you; but when you have our roses, -You barely leave our thorns to prick ourselves -And mock us with our bareness. - - - -BERTRAM -How have I sworn! - - - -DIANA -'Tis not the many oaths that makes the truth, -But the plain single vow that is vow'd true. -What is not holy, that we swear not by, -But take the High'st to witness: then, pray you, tell me, -If I should swear by God's great attributes, -I loved you dearly, would you believe my oaths, -When I did love you ill? This has no holding, -To swear by him whom I protest to love, -That I will work against him: therefore your oaths -Are words and poor conditions, but unseal'd, -At least in my opinion. - - - -BERTRAM -Change it, change it; -Be not so holy-cruel: love is holy; -And my integrity ne'er knew the crafts -That you do charge men with. Stand no more off, -But give thyself unto my sick desires, -Who then recover: say thou art mine, and ever -My love as it begins shall so persever. - - - -DIANA -I see that men make ropes in such a scarre -That we'll forsake ourselves. Give me that ring. - - - -BERTRAM -I'll lend it thee, my dear; but have no power -To give it from me. - - - -DIANA -Will you not, my lord? - - - -BERTRAM -It is an honour 'longing to our house, -Bequeathed down from many ancestors; -Which were the greatest obloquy i' the world -In me to lose. - - - -DIANA -Mine honour's such a ring: -My chastity's the jewel of our house, -Bequeathed down from many ancestors; -Which were the greatest obloquy i' the world -In me to lose: thus your own proper wisdom -Brings in the champion Honour on my part, -Against your vain assault. - - - -BERTRAM -Here, take my ring: -My house, mine honour, yea, my life, be thine, -And I'll be bid by thee. - - - -DIANA -When midnight comes, knock at my chamber-window: -I'll order take my mother shall not hear. -Now will I charge you in the band of truth, -When you have conquer'd my yet maiden bed, -Remain there but an hour, nor speak to me: -My reasons are most strong; and you shall know them -When back again this ring shall be deliver'd: -And on your finger in the night I'll put -Another ring, that what in time proceeds -May token to the future our past deeds. -Adieu, till then; then, fail not. You have won -A wife of me, though there my hope be done. - - - -BERTRAM -A heaven on earth I have won by wooing thee. - - -Exit - - -DIANA -For which live long to thank both heaven and me! -You may so in the end. -My mother told me just how he would woo, -As if she sat in 's heart; she says all men -Have the like oaths: he had sworn to marry me -When his wife's dead; therefore I'll lie with him -When I am buried. Since Frenchmen are so braid, -Marry that will, I live and die a maid: -Only in this disguise I think't no sin -To cozen him that would unjustly win. - - -Exit - - -SCENE III. The Florentine camp. -Enter the two French Lords and some two or three Soldiers - - -First Lord -You have not given him his mother's letter? - - - -Second Lord -I have delivered it an hour since: there is -something in't that stings his nature; for on the -reading it he changed almost into another man. - - - -First Lord -He has much worthy blame laid upon him for shaking -off so good a wife and so sweet a lady. - - - -Second Lord -Especially he hath incurred the everlasting -displeasure of the king, who had even tuned his -bounty to sing happiness to him. I will tell you a -thing, but you shall let it dwell darkly with you. - - - -First Lord -When you have spoken it, 'tis dead, and I am the -grave of it. - - - -Second Lord -He hath perverted a young gentlewoman here in -Florence, of a most chaste renown; and this night he -fleshes his will in the spoil of her honour: he hath -given her his monumental ring, and thinks himself -made in the unchaste composition. - - - -First Lord -Now, God delay our rebellion! as we are ourselves, -what things are we! - - - -Second Lord -Merely our own traitors. And as in the common course -of all treasons, we still see them reveal -themselves, till they attain to their abhorred ends, -so he that in this action contrives against his own -nobility, in his proper stream o'erflows himself. - - - -First Lord -Is it not meant damnable in us, to be trumpeters of -our unlawful intents? We shall not then have his -company to-night? - - - -Second Lord -Not till after midnight; for he is dieted to his hour. - - - -First Lord -That approaches apace; I would gladly have him see -his company anatomized, that he might take a measure -of his own judgments, wherein so curiously he had -set this counterfeit. - - - -Second Lord -We will not meddle with him till he come; for his -presence must be the whip of the other. - - - -First Lord -In the mean time, what hear you of these wars? - - - -Second Lord -I hear there is an overture of peace. - - - -First Lord -Nay, I assure you, a peace concluded. - - - -Second Lord -What will Count Rousillon do then? will he travel -higher, or return again into France? - - - -First Lord -I perceive, by this demand, you are not altogether -of his council. - - - -Second Lord -Let it be forbid, sir; so should I be a great deal -of his act. - - - -First Lord -Sir, his wife some two months since fled from his -house: her pretence is a pilgrimage to Saint Jaques -le Grand; which holy undertaking with most austere -sanctimony she accomplished; and, there residing the -tenderness of her nature became as a prey to her -grief; in fine, made a groan of her last breath, and -now she sings in heaven. - - - -Second Lord -How is this justified? - - - -First Lord -The stronger part of it by her own letters, which -makes her story true, even to the point of her -death: her death itself, which could not be her -office to say is come, was faithfully confirmed by -the rector of the place. - - - -Second Lord -Hath the count all this intelligence? - - - -First Lord -Ay, and the particular confirmations, point from -point, so to the full arming of the verity. - - - -Second Lord -I am heartily sorry that he'll be glad of this. - - - -First Lord -How mightily sometimes we make us comforts of our losses! - - - -Second Lord -And how mightily some other times we drown our gain -in tears! The great dignity that his valour hath -here acquired for him shall at home be encountered -with a shame as ample. - - - -First Lord -The web of our life is of a mingled yarn, good and -ill together: our virtues would be proud, if our -faults whipped them not; and our crimes would -despair, if they were not cherished by our virtues. -Enter a Messenger -How now! where's your master? - - - -Servant -He met the duke in the street, sir, of whom he hath -taken a solemn leave: his lordship will next -morning for France. The duke hath offered him -letters of commendations to the king. - - - -Second Lord -They shall be no more than needful there, if they -were more than they can commend. - - - -First Lord -They cannot be too sweet for the king's tartness. -Here's his lordship now. -Enter BERTRAM -How now, my lord! is't not after midnight? - - - -BERTRAM -I have to-night dispatched sixteen businesses, a -month's length a-piece, by an abstract of success: -I have congied with the duke, done my adieu with his -nearest; buried a wife, mourned for her; writ to my -lady mother I am returning; entertained my convoy; -and between these main parcels of dispatch effected -many nicer needs; the last was the greatest, but -that I have not ended yet. - - - -Second Lord -If the business be of any difficulty, and this -morning your departure hence, it requires haste of -your lordship. - - - -BERTRAM -I mean, the business is not ended, as fearing to -hear of it hereafter. But shall we have this -dialogue between the fool and the soldier? Come, -bring forth this counterfeit module, he has deceived -me, like a double-meaning prophesier. - - - -Second Lord -Bring him forth: has sat i' the stocks all night, -poor gallant knave. - - - -BERTRAM -No matter: his heels have deserved it, in usurping -his spurs so long. How does he carry himself? - - - -Second Lord -I have told your lordship already, the stocks carry -him. But to answer you as you would be understood; -he weeps like a wench that had shed her milk: he -hath confessed himself to Morgan, whom he supposes -to be a friar, from the time of his remembrance to -this very instant disaster of his setting i' the -stocks: and what think you he hath confessed? - - - -BERTRAM -Nothing of me, has a'? - - - -Second Lord -His confession is taken, and it shall be read to his -face: if your lordship be in't, as I believe you -are, you must have the patience to hear it. - - -Enter PAROLLES guarded, and First Soldier - - -BERTRAM -A plague upon him! muffled! he can say nothing of -me: hush, hush! - - - -First Lord -Hoodman comes! Portotartarosa - - - -First Soldier -He calls for the tortures: what will you say -without 'em? - - - -PAROLLES -I will confess what I know without constraint: if -ye pinch me like a pasty, I can say no more. - - - -First Soldier -Bosko chimurcho. - - - -First Lord -Boblibindo chicurmurco. - - - -First Soldier -You are a merciful general. Our general bids you -answer to what I shall ask you out of a note. - - - -PAROLLES -And truly, as I hope to live. - - - -First Soldier -Reads 'First demand of him how many horse the -duke is strong.' What say you to that? - - - -PAROLLES -Five or six thousand; but very weak and -unserviceable: the troops are all scattered, and -the commanders very poor rogues, upon my reputation -and credit and as I hope to live. - - - -First Soldier -Shall I set down your answer so? - - - -PAROLLES -Do: I'll take the sacrament on't, how and which way you will. - - - -BERTRAM -All's one to him. What a past-saving slave is this! - - - -First Lord -You're deceived, my lord: this is Monsieur -Parolles, the gallant militarist,--that was his own -phrase,--that had the whole theoric of war in the -knot of his scarf, and the practise in the chape of -his dagger. - - - -Second Lord -I will never trust a man again for keeping his sword -clean. nor believe he can have every thing in him -by wearing his apparel neatly. - - - -First Soldier -Well, that's set down. - - - -PAROLLES -Five or six thousand horse, I said,-- I will say -true,--or thereabouts, set down, for I'll speak truth. - - - -First Lord -He's very near the truth in this. - - - -BERTRAM -But I con him no thanks for't, in the nature he -delivers it. - - - -PAROLLES -Poor rogues, I pray you, say. - - - -First Soldier -Well, that's set down. - - - -PAROLLES -I humbly thank you, sir: a truth's a truth, the -rogues are marvellous poor. - - - -First Soldier -Reads 'Demand of him, of what strength they are -a-foot.' What say you to that? - - - -PAROLLES -By my troth, sir, if I were to live this present -hour, I will tell true. Let me see: Spurio, a -hundred and fifty; Sebastian, so many; Corambus, so -many; Jaques, so many; Guiltian, Cosmo, Lodowick, -and Gratii, two hundred and fifty each; mine own -company, Chitopher, Vaumond, Bentii, two hundred and -fifty each: so that the muster-file, rotten and -sound, upon my life, amounts not to fifteen thousand -poll; half of the which dare not shake snow from off -their cassocks, lest they shake themselves to pieces. - - - -BERTRAM -What shall be done to him? - - - -First Lord -Nothing, but let him have thanks. Demand of him my -condition, and what credit I have with the duke. - - - -First Soldier -Well, that's set down. -Reads -'You shall demand of him, whether one Captain Dumain -be i' the camp, a Frenchman; what his reputation is -with the duke; what his valour, honesty, and -expertness in wars; or whether he thinks it were not -possible, with well-weighing sums of gold, to -corrupt him to revolt.' What say you to this? what -do you know of it? - - - -PAROLLES -I beseech you, let me answer to the particular of -the inter'gatories: demand them singly. - - - -First Soldier -Do you know this Captain Dumain? - - - -PAROLLES -I know him: a' was a botcher's 'prentice in Paris, -from whence he was whipped for getting the shrieve's -fool with child,--a dumb innocent, that could not -say him nay. - - - -BERTRAM -Nay, by your leave, hold your hands; though I know -his brains are forfeit to the next tile that falls. - - - -First Soldier -Well, is this captain in the duke of Florence's camp? - - - -PAROLLES -Upon my knowledge, he is, and lousy. - - - -First Lord -Nay look not so upon me; we shall hear of your -lordship anon. - - - -First Soldier -What is his reputation with the duke? - - - -PAROLLES -The duke knows him for no other but a poor officer -of mine; and writ to me this other day to turn him -out o' the band: I think I have his letter in my pocket. - - - -First Soldier -Marry, we'll search. - - - -PAROLLES -In good sadness, I do not know; either it is there, -or it is upon a file with the duke's other letters -in my tent. - - - -First Soldier -Here 'tis; here's a paper: shall I read it to you? - - - -PAROLLES -I do not know if it be it or no. - - - -BERTRAM -Our interpreter does it well. - - - -First Lord -Excellently. - - - -First Soldier -Reads 'Dian, the count's a fool, and full of gold,'-- - - - -PAROLLES -That is not the duke's letter, sir; that is an -advertisement to a proper maid in Florence, one -Diana, to take heed of the allurement of one Count -Rousillon, a foolish idle boy, but for all that very -ruttish: I pray you, sir, put it up again. - - - -First Soldier -Nay, I'll read it first, by your favour. - - - -PAROLLES -My meaning in't, I protest, was very honest in the -behalf of the maid; for I knew the young count to be -a dangerous and lascivious boy, who is a whale to -virginity and devours up all the fry it finds. - - - -BERTRAM -Damnable both-sides rogue! - - - -First Soldier -Reads 'When he swears oaths, bid him drop gold, and take it; -After he scores, he never pays the score: -Half won is match well made; match, and well make it; -He ne'er pays after-debts, take it before; -And say a soldier, Dian, told thee this, -Men are to mell with, boys are not to kiss: -For count of this, the count's a fool, I know it, -Who pays before, but not when he does owe it. -Thine, as he vowed to thee in thine ear, -PAROLLES.' - - - -BERTRAM -He shall be whipped through the army with this rhyme -in's forehead. - - - -Second Lord -This is your devoted friend, sir, the manifold -linguist and the armipotent soldier. - - - -BERTRAM -I could endure any thing before but a cat, and now -he's a cat to me. - - - -First Soldier -I perceive, sir, by the general's looks, we shall be -fain to hang you. - - - -PAROLLES -My life, sir, in any case: not that I am afraid to -die; but that, my offences being many, I would -repent out the remainder of nature: let me live, -sir, in a dungeon, i' the stocks, or any where, so I may live. - - - -First Soldier -We'll see what may be done, so you confess freely; -therefore, once more to this Captain Dumain: you -have answered to his reputation with the duke and to -his valour: what is his honesty? - - - -PAROLLES -He will steal, sir, an egg out of a cloister: for -rapes and ravishments he parallels Nessus: he -professes not keeping of oaths; in breaking 'em he -is stronger than Hercules: he will lie, sir, with -such volubility, that you would think truth were a -fool: drunkenness is his best virtue, for he will -be swine-drunk; and in his sleep he does little -harm, save to his bed-clothes about him; but they -know his conditions and lay him in straw. I have but -little more to say, sir, of his honesty: he has -every thing that an honest man should not have; what -an honest man should have, he has nothing. - - - -First Lord -I begin to love him for this. - - - -BERTRAM -For this description of thine honesty? A pox upon -him for me, he's more and more a cat. - - - -First Soldier -What say you to his expertness in war? - - - -PAROLLES -Faith, sir, he has led the drum before the English -tragedians; to belie him, I will not, and more of -his soldiership I know not; except, in that country -he had the honour to be the officer at a place there -called Mile-end, to instruct for the doubling of -files: I would do the man what honour I can, but of -this I am not certain. - - - -First Lord -He hath out-villained villany so far, that the -rarity redeems him. - - - -BERTRAM -A pox on him, he's a cat still. - - - -First Soldier -His qualities being at this poor price, I need not -to ask you if gold will corrupt him to revolt. - - - -PAROLLES -Sir, for a quart d'ecu he will sell the fee-simple -of his salvation, the inheritance of it; and cut the -entail from all remainders, and a perpetual -succession for it perpetually. - - - -First Soldier -What's his brother, the other Captain Dumain? - - - -Second Lord -Why does be ask him of me? - - - -First Soldier -What's he? - - - -PAROLLES -E'en a crow o' the same nest; not altogether so -great as the first in goodness, but greater a great -deal in evil: he excels his brother for a coward, -yet his brother is reputed one of the best that is: -in a retreat he outruns any lackey; marry, in coming -on he has the cramp. - - - -First Soldier -If your life be saved, will you undertake to betray -the Florentine? - - - -PAROLLES -Ay, and the captain of his horse, Count Rousillon. - - - -First Soldier -I'll whisper with the general, and know his pleasure. - - - -PAROLLES -Aside I'll no more drumming; a plague of all -drums! Only to seem to deserve well, and to -beguile the supposition of that lascivious young boy -the count, have I run into this danger. Yet who -would have suspected an ambush where I was taken? - - - -First Soldier -There is no remedy, sir, but you must die: the -general says, you that have so traitorously -discovered the secrets of your army and made such -pestiferous reports of men very nobly held, can -serve the world for no honest use; therefore you -must die. Come, headsman, off with his head. - - - -PAROLLES -O Lord, sir, let me live, or let me see my death! - - - -First Lord -That shall you, and take your leave of all your friends. -Unblinding him -So, look about you: know you any here? - - - -BERTRAM -Good morrow, noble captain. - - - -Second Lord -God bless you, Captain Parolles. - - - -First Lord -God save you, noble captain. - - - -Second Lord -Captain, what greeting will you to my Lord Lafeu? -I am for France. - - - -First Lord -Good captain, will you give me a copy of the sonnet -you writ to Diana in behalf of the Count Rousillon? -an I were not a very coward, I'ld compel it of you: -but fare you well. - - -Exeunt BERTRAM and Lords - - -First Soldier -You are undone, captain, all but your scarf; that -has a knot on't yet - - - -PAROLLES -Who cannot be crushed with a plot? - - - -First Soldier -If you could find out a country where but women were -that had received so much shame, you might begin an -impudent nation. Fare ye well, sir; I am for France -too: we shall speak of you there. - - -Exit with Soldiers - - -PAROLLES -Yet am I thankful: if my heart were great, -'Twould burst at this. Captain I'll be no more; -But I will eat and drink, and sleep as soft -As captain shall: simply the thing I am -Shall make me live. Who knows himself a braggart, -Let him fear this, for it will come to pass -that every braggart shall be found an ass. -Rust, sword? cool, blushes! and, Parolles, live -Safest in shame! being fool'd, by foolery thrive! -There's place and means for every man alive. -I'll after them. - - -Exit - - -SCENE IV. Florence. The Widow's house. -Enter HELENA, Widow, and DIANA - - -HELENA -That you may well perceive I have not wrong'd you, -One of the greatest in the Christian world -Shall be my surety; 'fore whose throne 'tis needful, -Ere I can perfect mine intents, to kneel: -Time was, I did him a desired office, -Dear almost as his life; which gratitude -Through flinty Tartar's bosom would peep forth, -And answer, thanks: I duly am inform'd -His grace is at Marseilles; to which place -We have convenient convoy. You must know -I am supposed dead: the army breaking, -My husband hies him home; where, heaven aiding, -And by the leave of my good lord the king, -We'll be before our welcome. - - - -Widow -Gentle madam, -You never had a servant to whose trust -Your business was more welcome. - - - -HELENA -Nor you, mistress, -Ever a friend whose thoughts more truly labour -To recompense your love: doubt not but heaven -Hath brought me up to be your daughter's dower, -As it hath fated her to be my motive -And helper to a husband. But, O strange men! -That can such sweet use make of what they hate, -When saucy trusting of the cozen'd thoughts -Defiles the pitchy night: so lust doth play -With what it loathes for that which is away. -But more of this hereafter. You, Diana, -Under my poor instructions yet must suffer -Something in my behalf. - - - -DIANA -Let death and honesty -Go with your impositions, I am yours -Upon your will to suffer. - - - -HELENA -Yet, I pray you: -But with the word the time will bring on summer, -When briers shall have leaves as well as thorns, -And be as sweet as sharp. We must away; -Our wagon is prepared, and time revives us: -All's well that ends well; still the fine's the crown; -Whate'er the course, the end is the renown. - - -Exeunt - - -SCENE V. Rousillon. The COUNT's palace. -Enter COUNTESS, LAFEU, and Clown - - -LAFEU -No, no, no, your son was misled with a snipt-taffeta -fellow there, whose villanous saffron would have -made all the unbaked and doughy youth of a nation in -his colour: your daughter-in-law had been alive at -this hour, and your son here at home, more advanced -by the king than by that red-tailed humble-bee I speak of. - - - -COUNTESS -I would I had not known him; it was the death of the -most virtuous gentlewoman that ever nature had -praise for creating. If she had partaken of my -flesh, and cost me the dearest groans of a mother, I -could not have owed her a more rooted love. - - - -LAFEU -'Twas a good lady, 'twas a good lady: we may pick a -thousand salads ere we light on such another herb. - - - -Clown -Indeed, sir, she was the sweet marjoram of the -salad, or rather, the herb of grace. - - - -LAFEU -They are not herbs, you knave; they are nose-herbs. - - - -Clown -I am no great Nebuchadnezzar, sir; I have not much -skill in grass. - - - -LAFEU -Whether dost thou profess thyself, a knave or a fool? - - - -Clown -A fool, sir, at a woman's service, and a knave at a man's. - - - -LAFEU -Your distinction? - - - -Clown -I would cozen the man of his wife and do his service. - - - -LAFEU -So you were a knave at his service, indeed. - - - -Clown -And I would give his wife my bauble, sir, to do her service. - - - -LAFEU -I will subscribe for thee, thou art both knave and fool. - - - -Clown -At your service. - - - -LAFEU -No, no, no. - - - -Clown -Why, sir, if I cannot serve you, I can serve as -great a prince as you are. - - - -LAFEU -Who's that? a Frenchman? - - - -Clown -Faith, sir, a' has an English name; but his fisnomy -is more hotter in France than there. - - - -LAFEU -What prince is that? - - - -Clown -The black prince, sir; alias, the prince of -darkness; alias, the devil. - - - -LAFEU -Hold thee, there's my purse: I give thee not this -to suggest thee from thy master thou talkest of; -serve him still. - - - -Clown -I am a woodland fellow, sir, that always loved a -great fire; and the master I speak of ever keeps a -good fire. But, sure, he is the prince of the -world; let his nobility remain in's court. I am for -the house with the narrow gate, which I take to be -too little for pomp to enter: some that humble -themselves may; but the many will be too chill and -tender, and they'll be for the flowery way that -leads to the broad gate and the great fire. - - - -LAFEU -Go thy ways, I begin to be aweary of thee; and I -tell thee so before, because I would not fall out -with thee. Go thy ways: let my horses be well -looked to, without any tricks. - - - -Clown -If I put any tricks upon 'em, sir, they shall be -jades' tricks; which are their own right by the law of nature. - - -Exit - - -LAFEU -A shrewd knave and an unhappy. - - - -COUNTESS -So he is. My lord that's gone made himself much -sport out of him: by his authority he remains here, -which he thinks is a patent for his sauciness; and, -indeed, he has no pace, but runs where he will. - - - -LAFEU -I like him well; 'tis not amiss. And I was about to -tell you, since I heard of the good lady's death and -that my lord your son was upon his return home, I -moved the king my master to speak in the behalf of -my daughter; which, in the minority of them both, -his majesty, out of a self-gracious remembrance, did -first propose: his highness hath promised me to do -it: and, to stop up the displeasure he hath -conceived against your son, there is no fitter -matter. How does your ladyship like it? - - - -COUNTESS -With very much content, my lord; and I wish it -happily effected. - - - -LAFEU -His highness comes post from Marseilles, of as able -body as when he numbered thirty: he will be here -to-morrow, or I am deceived by him that in such -intelligence hath seldom failed. - - - -COUNTESS -It rejoices me, that I hope I shall see him ere I -die. I have letters that my son will be here -to-night: I shall beseech your lordship to remain -with me till they meet together. - - - -LAFEU -Madam, I was thinking with what manners I might -safely be admitted. - - - -COUNTESS -You need but plead your honourable privilege. - - - -LAFEU -Lady, of that I have made a bold charter; but I -thank my God it holds yet. - - -Re-enter Clown - - -Clown -O madam, yonder's my lord your son with a patch of -velvet on's face: whether there be a scar under't -or no, the velvet knows; but 'tis a goodly patch of -velvet: his left cheek is a cheek of two pile and a -half, but his right cheek is worn bare. - - - -LAFEU -A scar nobly got, or a noble scar, is a good livery -of honour; so belike is that. - - - -Clown -But it is your carbonadoed face. - - - -LAFEU -Let us go see your son, I pray you: I long to talk -with the young noble soldier. - - - -Clown -Faith there's a dozen of 'em, with delicate fine -hats and most courteous feathers, which bow the head -and nod at every man. - - -Exeunt - - - - -ACT V - -SCENE I. Marseilles. A street. -Enter HELENA, Widow, and DIANA, with two -Attendants - - -HELENA -But this exceeding posting day and night -Must wear your spirits low; we cannot help it: -But since you have made the days and nights as one, -To wear your gentle limbs in my affairs, -Be bold you do so grow in my requital -As nothing can unroot you. In happy time; -Enter a Gentleman -This man may help me to his majesty's ear, -If he would spend his power. God save you, sir. - - - -Gentleman -And you. - - - -HELENA -Sir, I have seen you in the court of France. - - - -Gentleman -I have been sometimes there. - - - -HELENA -I do presume, sir, that you are not fallen -From the report that goes upon your goodness; -An therefore, goaded with most sharp occasions, -Which lay nice manners by, I put you to -The use of your own virtues, for the which -I shall continue thankful. - - - -Gentleman -What's your will? - - - -HELENA -That it will please you -To give this poor petition to the king, -And aid me with that store of power you have -To come into his presence. - - - -Gentleman -The king's not here. - - - -HELENA -Not here, sir! - - - -Gentleman -Not, indeed: -He hence removed last night and with more haste -Than is his use. - - - -Widow -Lord, how we lose our pains! - - - -HELENA -All's well that ends well yet, -Though time seem so adverse and means unfit. -I do beseech you, whither is he gone? - - - -Gentleman -Marry, as I take it, to Rousillon; -Whither I am going. - - - -HELENA -I do beseech you, sir, -Since you are like to see the king before me, -Commend the paper to his gracious hand, -Which I presume shall render you no blame -But rather make you thank your pains for it. -I will come after you with what good speed -Our means will make us means. - - - -Gentleman -This I'll do for you. - - - -HELENA -And you shall find yourself to be well thank'd, -Whate'er falls more. We must to horse again. -Go, go, provide. - - -Exeunt - - -SCENE II. Rousillon. Before the COUNT's palace. -Enter Clown, and PAROLLES, following - - -PAROLLES -Good Monsieur Lavache, give my Lord Lafeu this -letter: I have ere now, sir, been better known to -you, when I have held familiarity with fresher -clothes; but I am now, sir, muddied in fortune's -mood, and smell somewhat strong of her strong -displeasure. - - - -Clown -Truly, fortune's displeasure is but sluttish, if it -smell so strongly as thou speakest of: I will -henceforth eat no fish of fortune's buttering. -Prithee, allow the wind. - - - -PAROLLES -Nay, you need not to stop your nose, sir; I spake -but by a metaphor. - - - -Clown -Indeed, sir, if your metaphor stink, I will stop my -nose; or against any man's metaphor. Prithee, get -thee further. - - - -PAROLLES -Pray you, sir, deliver me this paper. - - - -Clown -Foh! prithee, stand away: a paper from fortune's -close-stool to give to a nobleman! Look, here he -comes himself. -Enter LAFEU -Here is a purr of fortune's, sir, or of fortune's -cat,--but not a musk-cat,--that has fallen into the -unclean fishpond of her displeasure, and, as he -says, is muddied withal: pray you, sir, use the -carp as you may; for he looks like a poor, decayed, -ingenious, foolish, rascally knave. I do pity his -distress in my similes of comfort and leave him to -your lordship. - - -Exit - - -PAROLLES -My lord, I am a man whom fortune hath cruelly -scratched. - - - -LAFEU -And what would you have me to do? 'Tis too late to -pare her nails now. Wherein have you played the -knave with fortune, that she should scratch you, who -of herself is a good lady and would not have knaves -thrive long under her? There's a quart d'ecu for -you: let the justices make you and fortune friends: -I am for other business. - - - -PAROLLES -I beseech your honour to hear me one single word. - - - -LAFEU -You beg a single penny more: come, you shall ha't; -save your word. - - - -PAROLLES -My name, my good lord, is Parolles. - - - -LAFEU -You beg more than 'word,' then. Cox my passion! -give me your hand. How does your drum? - - - -PAROLLES -O my good lord, you were the first that found me! - - - -LAFEU -Was I, in sooth? and I was the first that lost thee. - - - -PAROLLES -It lies in you, my lord, to bring me in some grace, -for you did bring me out. - - - -LAFEU -Out upon thee, knave! dost thou put upon me at once -both the office of God and the devil? One brings -thee in grace and the other brings thee out. -Trumpets sound -The king's coming; I know by his trumpets. Sirrah, -inquire further after me; I had talk of you last -night: though you are a fool and a knave, you shall -eat; go to, follow. - - - -PAROLLES -I praise God for you. - - -Exeunt - - -SCENE III. Rousillon. The COUNT's palace. -Flourish. Enter KING, COUNTESS, LAFEU, the two -French Lords, with Attendants - - -KING -We lost a jewel of her; and our esteem -Was made much poorer by it: but your son, -As mad in folly, lack'd the sense to know -Her estimation home. - - - -COUNTESS -'Tis past, my liege; -And I beseech your majesty to make it -Natural rebellion, done i' the blaze of youth; -When oil and fire, too strong for reason's force, -O'erbears it and burns on. - - - -KING -My honour'd lady, -I have forgiven and forgotten all; -Though my revenges were high bent upon him, -And watch'd the time to shoot. - - - -LAFEU -This I must say, -But first I beg my pardon, the young lord -Did to his majesty, his mother and his lady -Offence of mighty note; but to himself -The greatest wrong of all. He lost a wife -Whose beauty did astonish the survey -Of richest eyes, whose words all ears took captive, -Whose dear perfection hearts that scorn'd to serve -Humbly call'd mistress. - - - -KING -Praising what is lost -Makes the remembrance dear. Well, call him hither; -We are reconciled, and the first view shall kill -All repetition: let him not ask our pardon; -The nature of his great offence is dead, -And deeper than oblivion we do bury -The incensing relics of it: let him approach, -A stranger, no offender; and inform him -So 'tis our will he should. - - - -Gentleman -I shall, my liege. - - -Exit - - -KING -What says he to your daughter? have you spoke? - - - -LAFEU -All that he is hath reference to your highness. - - - -KING -Then shall we have a match. I have letters sent me -That set him high in fame. - - -Enter BERTRAM - - -LAFEU -He looks well on't. - - - -KING -I am not a day of season, -For thou mayst see a sunshine and a hail -In me at once: but to the brightest beams -Distracted clouds give way; so stand thou forth; -The time is fair again. - - - -BERTRAM -My high-repented blames, -Dear sovereign, pardon to me. - - - -KING -All is whole; -Not one word more of the consumed time. -Let's take the instant by the forward top; -For we are old, and on our quick'st decrees -The inaudible and noiseless foot of Time -Steals ere we can effect them. You remember -The daughter of this lord? - - - -BERTRAM -Admiringly, my liege, at first -I stuck my choice upon her, ere my heart -Durst make too bold a herald of my tongue -Where the impression of mine eye infixing, -Contempt his scornful perspective did lend me, -Which warp'd the line of every other favour; -Scorn'd a fair colour, or express'd it stolen; -Extended or contracted all proportions -To a most hideous object: thence it came -That she whom all men praised and whom myself, -Since I have lost, have loved, was in mine eye -The dust that did offend it. - - - -KING -Well excused: -That thou didst love her, strikes some scores away -From the great compt: but love that comes too late, -Like a remorseful pardon slowly carried, -To the great sender turns a sour offence, -Crying, 'That's good that's gone.' Our rash faults -Make trivial price of serious things we have, -Not knowing them until we know their grave: -Oft our displeasures, to ourselves unjust, -Destroy our friends and after weep their dust -Our own love waking cries to see what's done, -While shame full late sleeps out the afternoon. -Be this sweet Helen's knell, and now forget her. -Send forth your amorous token for fair Maudlin: -The main consents are had; and here we'll stay -To see our widower's second marriage-day. - - - -COUNTESS -Which better than the first, O dear heaven, bless! -Or, ere they meet, in me, O nature, cesse! - - - -LAFEU -Come on, my son, in whom my house's name -Must be digested, give a favour from you -To sparkle in the spirits of my daughter, -That she may quickly come. -BERTRAM gives a ring -By my old beard, -And every hair that's on't, Helen, that's dead, -Was a sweet creature: such a ring as this, -The last that e'er I took her at court, -I saw upon her finger. - - - -BERTRAM -Hers it was not. - - - -KING -Now, pray you, let me see it; for mine eye, -While I was speaking, oft was fasten'd to't. -This ring was mine; and, when I gave it Helen, -I bade her, if her fortunes ever stood -Necessitied to help, that by this token -I would relieve her. Had you that craft, to reave -her -Of what should stead her most? - - - -BERTRAM -My gracious sovereign, -Howe'er it pleases you to take it so, -The ring was never hers. - - - -COUNTESS -Son, on my life, -I have seen her wear it; and she reckon'd it -At her life's rate. - - - -LAFEU -I am sure I saw her wear it. - - - -BERTRAM -You are deceived, my lord; she never saw it: -In Florence was it from a casement thrown me, -Wrapp'd in a paper, which contain'd the name -Of her that threw it: noble she was, and thought -I stood engaged: but when I had subscribed -To mine own fortune and inform'd her fully -I could not answer in that course of honour -As she had made the overture, she ceased -In heavy satisfaction and would never -Receive the ring again. - - - -KING -Plutus himself, -That knows the tinct and multiplying medicine, -Hath not in nature's mystery more science -Than I have in this ring: 'twas mine, 'twas Helen's, -Whoever gave it you. Then, if you know -That you are well acquainted with yourself, -Confess 'twas hers, and by what rough enforcement -You got it from her: she call'd the saints to surety -That she would never put it from her finger, -Unless she gave it to yourself in bed, -Where you have never come, or sent it us -Upon her great disaster. - - - -BERTRAM -She never saw it. - - - -KING -Thou speak'st it falsely, as I love mine honour; -And makest conjectural fears to come into me -Which I would fain shut out. If it should prove -That thou art so inhuman,--'twill not prove so;-- -And yet I know not: thou didst hate her deadly, -And she is dead; which nothing, but to close -Her eyes myself, could win me to believe, -More than to see this ring. Take him away. -Guards seize BERTRAM -My fore-past proofs, howe'er the matter fall, -Shall tax my fears of little vanity, -Having vainly fear'd too little. Away with him! -We'll sift this matter further. - - - -BERTRAM -If you shall prove -This ring was ever hers, you shall as easy -Prove that I husbanded her bed in Florence, -Where yet she never was. - - -Exit, guarded - - -KING -I am wrapp'd in dismal thinkings. - - -Enter a Gentleman - - -Gentleman -Gracious sovereign, -Whether I have been to blame or no, I know not: -Here's a petition from a Florentine, -Who hath for four or five removes come short -To tender it herself. I undertook it, -Vanquish'd thereto by the fair grace and speech -Of the poor suppliant, who by this I know -Is here attending: her business looks in her -With an importing visage; and she told me, -In a sweet verbal brief, it did concern -Your highness with herself. - - - -KING -Reads Upon his many protestations to marry me -when his wife was dead, I blush to say it, he won -me. Now is the Count Rousillon a widower: his vows -are forfeited to me, and my honour's paid to him. He -stole from Florence, taking no leave, and I follow -him to his country for justice: grant it me, O -king! in you it best lies; otherwise a seducer -flourishes, and a poor maid is undone. -DIANA CAPILET. - - - -LAFEU -I will buy me a son-in-law in a fair, and toll for -this: I'll none of him. - - - -KING -The heavens have thought well on thee Lafeu, -To bring forth this discovery. Seek these suitors: -Go speedily and bring again the count. -I am afeard the life of Helen, lady, -Was foully snatch'd. - - - -COUNTESS -Now, justice on the doers! - - -Re-enter BERTRAM, guarded - - -KING -I wonder, sir, sith wives are monsters to you, -And that you fly them as you swear them lordship, -Yet you desire to marry. -Enter Widow and DIANA -What woman's that? - - - -DIANA -I am, my lord, a wretched Florentine, -Derived from the ancient Capilet: -My suit, as I do understand, you know, -And therefore know how far I may be pitied. - - - -Widow -I am her mother, sir, whose age and honour -Both suffer under this complaint we bring, -And both shall cease, without your remedy. - - - -KING -Come hither, count; do you know these women? - - - -BERTRAM -My lord, I neither can nor will deny -But that I know them: do they charge me further? - - - -DIANA -Why do you look so strange upon your wife? - - - -BERTRAM -She's none of mine, my lord. - - - -DIANA -If you shall marry, -You give away this hand, and that is mine; -You give away heaven's vows, and those are mine; -You give away myself, which is known mine; -For I by vow am so embodied yours, -That she which marries you must marry me, -Either both or none. - - - -LAFEU -Your reputation comes too short for my daughter; you -are no husband for her. - - - -BERTRAM -My lord, this is a fond and desperate creature, -Whom sometime I have laugh'd with: let your highness -Lay a more noble thought upon mine honour -Than for to think that I would sink it here. - - - -KING -Sir, for my thoughts, you have them ill to friend -Till your deeds gain them: fairer prove your honour -Than in my thought it lies. - - - -DIANA -Good my lord, -Ask him upon his oath, if he does think -He had not my virginity. - - - -KING -What say'st thou to her? - - - -BERTRAM -She's impudent, my lord, -And was a common gamester to the camp. - - - -DIANA -He does me wrong, my lord; if I were so, -He might have bought me at a common price: -Do not believe him. O, behold this ring, -Whose high respect and rich validity -Did lack a parallel; yet for all that -He gave it to a commoner o' the camp, -If I be one. - - - -COUNTESS -He blushes, and 'tis it: -Of six preceding ancestors, that gem, -Conferr'd by testament to the sequent issue, -Hath it been owed and worn. This is his wife; -That ring's a thousand proofs. - - - -KING -Methought you said -You saw one here in court could witness it. - - - -DIANA -I did, my lord, but loath am to produce -So bad an instrument: his name's Parolles. - - - -LAFEU -I saw the man to-day, if man he be. - - - -KING -Find him, and bring him hither. - - -Exit an Attendant - - -BERTRAM -What of him? -He's quoted for a most perfidious slave, -With all the spots o' the world tax'd and debosh'd; -Whose nature sickens but to speak a truth. -Am I or that or this for what he'll utter, -That will speak any thing? - - - -KING -She hath that ring of yours. - - - -BERTRAM -I think she has: certain it is I liked her, -And boarded her i' the wanton way of youth: -She knew her distance and did angle for me, -Madding my eagerness with her restraint, -As all impediments in fancy's course -Are motives of more fancy; and, in fine, -Her infinite cunning, with her modern grace, -Subdued me to her rate: she got the ring; -And I had that which any inferior might -At market-price have bought. - - - -DIANA -I must be patient: -You, that have turn'd off a first so noble wife, -May justly diet me. I pray you yet; -Since you lack virtue, I will lose a husband; -Send for your ring, I will return it home, -And give me mine again. - - - -BERTRAM -I have it not. - - - -KING -What ring was yours, I pray you? - - - -DIANA -Sir, much like -The same upon your finger. - - - -KING -Know you this ring? this ring was his of late. - - - -DIANA -And this was it I gave him, being abed. - - - -KING -The story then goes false, you threw it him -Out of a casement. - - - -DIANA -I have spoke the truth. - - -Enter PAROLLES - - -BERTRAM -My lord, I do confess the ring was hers. - - - -KING -You boggle shrewdly, every feather stars you. -Is this the man you speak of? - - - -DIANA -Ay, my lord. - - - -KING -Tell me, sirrah, but tell me true, I charge you, -Not fearing the displeasure of your master, -Which on your just proceeding I'll keep off, -By him and by this woman here what know you? - - - -PAROLLES -So please your majesty, my master hath been an -honourable gentleman: tricks he hath had in him, -which gentlemen have. - - - -KING -Come, come, to the purpose: did he love this woman? - - - -PAROLLES -Faith, sir, he did love her; but how? - - - -KING -How, I pray you? - - - -PAROLLES -He did love her, sir, as a gentleman loves a woman. - - - -KING -How is that? - - - -PAROLLES -He loved her, sir, and loved her not. - - - -KING -As thou art a knave, and no knave. What an -equivocal companion is this! - - - -PAROLLES -I am a poor man, and at your majesty's command. - - - -LAFEU -He's a good drum, my lord, but a naughty orator. - - - -DIANA -Do you know he promised me marriage? - - - -PAROLLES -Faith, I know more than I'll speak. - - - -KING -But wilt thou not speak all thou knowest? - - - -PAROLLES -Yes, so please your majesty. I did go between them, -as I said; but more than that, he loved her: for -indeed he was mad for her, and talked of Satan and -of Limbo and of Furies and I know not what: yet I -was in that credit with them at that time that I -knew of their going to bed, and of other motions, -as promising her marriage, and things which would -derive me ill will to speak of; therefore I will not -speak what I know. - - - -KING -Thou hast spoken all already, unless thou canst say -they are married: but thou art too fine in thy -evidence; therefore stand aside. -This ring, you say, was yours? - - - -DIANA -Ay, my good lord. - - - -KING -Where did you buy it? or who gave it you? - - - -DIANA -It was not given me, nor I did not buy it. - - - -KING -Who lent it you? - - - -DIANA -It was not lent me neither. - - - -KING -Where did you find it, then? - - - -DIANA -I found it not. - - - -KING -If it were yours by none of all these ways, -How could you give it him? - - - -DIANA -I never gave it him. - - - -LAFEU -This woman's an easy glove, my lord; she goes off -and on at pleasure. - - - -KING -This ring was mine; I gave it his first wife. - - - -DIANA -It might be yours or hers, for aught I know. - - - -KING -Take her away; I do not like her now; -To prison with her: and away with him. -Unless thou tell'st me where thou hadst this ring, -Thou diest within this hour. - - - -DIANA -I'll never tell you. - - - -KING -Take her away. - - - -DIANA -I'll put in bail, my liege. - - - -KING -I think thee now some common customer. - - - -DIANA -By Jove, if ever I knew man, 'twas you. - - - -KING -Wherefore hast thou accused him all this while? - - - -DIANA -Because he's guilty, and he is not guilty: -He knows I am no maid, and he'll swear to't; -I'll swear I am a maid, and he knows not. -Great king, I am no strumpet, by my life; -I am either maid, or else this old man's wife. - - - -KING -She does abuse our ears: to prison with her. - - - -DIANA -Good mother, fetch my bail. Stay, royal sir: -Exit Widow -The jeweller that owes the ring is sent for, -And he shall surety me. But for this lord, -Who hath abused me, as he knows himself, -Though yet he never harm'd me, here I quit him: -He knows himself my bed he hath defiled; -And at that time he got his wife with child: -Dead though she be, she feels her young one kick: -So there's my riddle: one that's dead is quick: -And now behold the meaning. - - -Re-enter Widow, with HELENA - - -KING -Is there no exorcist -Beguiles the truer office of mine eyes? -Is't real that I see? - - - -HELENA -No, my good lord; -'Tis but the shadow of a wife you see, -The name and not the thing. - - - -BERTRAM -Both, both. O, pardon! - - - -HELENA -O my good lord, when I was like this maid, -I found you wondrous kind. There is your ring; -And, look you, here's your letter; this it says: -'When from my finger you can get this ring -And are by me with child,' &c. This is done: -Will you be mine, now you are doubly won? - - - -BERTRAM -If she, my liege, can make me know this clearly, -I'll love her dearly, ever, ever dearly. - - - -HELENA -If it appear not plain and prove untrue, -Deadly divorce step between me and you! -O my dear mother, do I see you living? - - - -LAFEU -Mine eyes smell onions; I shall weep anon: -To PAROLLES -Good Tom Drum, lend me a handkercher: so, -I thank thee: wait on me home, I'll make sport with thee: -Let thy courtesies alone, they are scurvy ones. - - - -KING -Let us from point to point this story know, -To make the even truth in pleasure flow. -To DIANA -If thou be'st yet a fresh uncropped flower, -Choose thou thy husband, and I'll pay thy dower; -For I can guess that by thy honest aid -Thou keep'st a wife herself, thyself a maid. -Of that and all the progress, more or less, -Resolvedly more leisure shall express: -All yet seems well; and if it end so meet, -The bitter past, more welcome is the sweet. - -Flourish - - -EPILOGUE - -KING -The king's a beggar, now the play is done: -All is well ended, if this suit be won, -That you express content; which we will pay, -With strife to please you, day exceeding day: -Ours be your patience then, and yours our parts; -Your gentle hands lend us, and take our hearts. - - -Exeunt - - -
+ + + + +All's Well That Ends Well + + +

ASCII text placed in the public domain by Moby Lexical Tools, 1992.

+

SGML markup by Jon Bosak, 1992-1994.

+

XML version by Jon Bosak, 1996-1999.

+

The XML markup in this version is Copyright © 1999 Jon Bosak. +This work may freely be distributed on condition that it not be +modified or altered in any way.

+
+ + +Dramatis Personae + +KING OF FRANCE +DUKE OF FLORENCE +BERTRAM, Count of Rousillon. +LAFEU, an old lord. +PAROLLES, a follower of Bertram. + + +Steward +Clown +servants to the Countess of Rousillon. + + +A Page. +COUNTESS OF ROUSILLON, mother to Bertram. +HELENA, a gentlewoman protected by the Countess. +An old Widow of Florence. +DIANA, daughter to the Widow. + + +VIOLENTA +MARIANA +neighbours and friends to the Widow. + + +Lords, Officers, Soldiers, &c., French and Florentine. + + +SCENE Rousillon; Paris; Florence; Marseilles. + +ALL'S WELL THAT ENDS WELL + +ACT I + +SCENE I. Rousillon. The COUNT's palace. +Enter BERTRAM, the COUNTESS of Rousillon, HELENA, +and LAFEU, all in black + + +COUNTESS +In delivering my son from me, I bury a second husband. + + + +BERTRAM +And I in going, madam, weep o'er my father's death +anew: but I must attend his majesty's command, to +whom I am now in ward, evermore in subjection. + + + +LAFEU +You shall find of the king a husband, madam; you, +sir, a father: he that so generally is at all times +good must of necessity hold his virtue to you; whose +worthiness would stir it up where it wanted rather +than lack it where there is such abundance. + + + +COUNTESS +What hope is there of his majesty's amendment? + + + +LAFEU +He hath abandoned his physicians, madam; under whose +practises he hath persecuted time with hope, and +finds no other advantage in the process but only the +losing of hope by time. + + + +COUNTESS +This young gentlewoman had a father,--O, that +'had'! how sad a passage 'tis!--whose skill was +almost as great as his honesty; had it stretched so +far, would have made nature immortal, and death +should have play for lack of work. Would, for the +king's sake, he were living! I think it would be +the death of the king's disease. + + + +LAFEU +How called you the man you speak of, madam? + + + +COUNTESS +He was famous, sir, in his profession, and it was +his great right to be so: Gerard de Narbon. + + + +LAFEU +He was excellent indeed, madam: the king very +lately spoke of him admiringly and mourningly: he +was skilful enough to have lived still, if knowledge +could be set up against mortality. + + + +BERTRAM +What is it, my good lord, the king languishes of? + + + +LAFEU +A fistula, my lord. + + + +BERTRAM +I heard not of it before. + + + +LAFEU +I would it were not notorious. Was this gentlewoman +the daughter of Gerard de Narbon? + + + +COUNTESS +His sole child, my lord, and bequeathed to my +overlooking. I have those hopes of her good that +her education promises; her dispositions she +inherits, which makes fair gifts fairer; for where +an unclean mind carries virtuous qualities, there +commendations go with pity; they are virtues and +traitors too; in her they are the better for their +simpleness; she derives her honesty and achieves her goodness. + + + +LAFEU +Your commendations, madam, get from her tears. + + + +COUNTESS +'Tis the best brine a maiden can season her praise +in. The remembrance of her father never approaches +her heart but the tyranny of her sorrows takes all +livelihood from her cheek. No more of this, Helena; +go to, no more; lest it be rather thought you affect +a sorrow than have it. + + + +HELENA +I do affect a sorrow indeed, but I have it too. + + + +LAFEU +Moderate lamentation is the right of the dead, +excessive grief the enemy to the living. + + + +COUNTESS +If the living be enemy to the grief, the excess +makes it soon mortal. + + + +BERTRAM +Madam, I desire your holy wishes. + + + +LAFEU +How understand we that? + + + +COUNTESS +Be thou blest, Bertram, and succeed thy father +In manners, as in shape! thy blood and virtue +Contend for empire in thee, and thy goodness +Share with thy birthright! Love all, trust a few, +Do wrong to none: be able for thine enemy +Rather in power than use, and keep thy friend +Under thy own life's key: be cheque'd for silence, +But never tax'd for speech. What heaven more will, +That thee may furnish and my prayers pluck down, +Fall on thy head! Farewell, my lord; +'Tis an unseason'd courtier; good my lord, +Advise him. + + + +LAFEU +He cannot want the best +That shall attend his love. + + + +COUNTESS +Heaven bless him! Farewell, Bertram. + + +Exit + + +BERTRAM +To HELENA The best wishes that can be forged in +your thoughts be servants to you! Be comfortable +to my mother, your mistress, and make much of her. + + + +LAFEU +Farewell, pretty lady: you must hold the credit of +your father. + + +Exeunt BERTRAM and LAFEU + + +HELENA +O, were that all! I think not on my father; +And these great tears grace his remembrance more +Than those I shed for him. What was he like? +I have forgot him: my imagination +Carries no favour in't but Bertram's. +I am undone: there is no living, none, +If Bertram be away. 'Twere all one +That I should love a bright particular star +And think to wed it, he is so above me: +In his bright radiance and collateral light +Must I be comforted, not in his sphere. +The ambition in my love thus plagues itself: +The hind that would be mated by the lion +Must die for love. 'Twas pretty, though plague, +To see him every hour; to sit and draw +His arched brows, his hawking eye, his curls, +In our heart's table; heart too capable +Of every line and trick of his sweet favour: +But now he's gone, and my idolatrous fancy +Must sanctify his reliques. Who comes here? +Enter PAROLLES +Aside +One that goes with him: I love him for his sake; +And yet I know him a notorious liar, +Think him a great way fool, solely a coward; +Yet these fixed evils sit so fit in him, +That they take place, when virtue's steely bones +Look bleak i' the cold wind: withal, full oft we see +Cold wisdom waiting on superfluous folly. + + + +PAROLLES +Save you, fair queen! + + + +HELENA +And you, monarch! + + + +PAROLLES +No. + + + +HELENA +And no. + + + +PAROLLES +Are you meditating on virginity? + + + +HELENA +Ay. You have some stain of soldier in you: let me +ask you a question. Man is enemy to virginity; how +may we barricado it against him? + + + +PAROLLES +Keep him out. + + + +HELENA +But he assails; and our virginity, though valiant, +in the defence yet is weak: unfold to us some +warlike resistance. + + + +PAROLLES +There is none: man, sitting down before you, will +undermine you and blow you up. + + + +HELENA +Bless our poor virginity from underminers and +blowers up! Is there no military policy, how +virgins might blow up men? + + + +PAROLLES +Virginity being blown down, man will quicklier be +blown up: marry, in blowing him down again, with +the breach yourselves made, you lose your city. It +is not politic in the commonwealth of nature to +preserve virginity. Loss of virginity is rational +increase and there was never virgin got till +virginity was first lost. That you were made of is +metal to make virgins. Virginity by being once lost +may be ten times found; by being ever kept, it is +ever lost: 'tis too cold a companion; away with 't! + + + +HELENA +I will stand for 't a little, though therefore I die a virgin. + + + +PAROLLES +There's little can be said in 't; 'tis against the +rule of nature. To speak on the part of virginity, +is to accuse your mothers; which is most infallible +disobedience. He that hangs himself is a virgin: +virginity murders itself and should be buried in +highways out of all sanctified limit, as a desperate +offendress against nature. Virginity breeds mites, +much like a cheese; consumes itself to the very +paring, and so dies with feeding his own stomach. +Besides, virginity is peevish, proud, idle, made of +self-love, which is the most inhibited sin in the +canon. Keep it not; you cannot choose but loose +by't: out with 't! within ten year it will make +itself ten, which is a goodly increase; and the +principal itself not much the worse: away with 't! + + + +HELENA +How might one do, sir, to lose it to her own liking? + + + +PAROLLES +Let me see: marry, ill, to like him that ne'er it +likes. 'Tis a commodity will lose the gloss with +lying; the longer kept, the less worth: off with 't +while 'tis vendible; answer the time of request. +Virginity, like an old courtier, wears her cap out +of fashion: richly suited, but unsuitable: just +like the brooch and the tooth-pick, which wear not +now. Your date is better in your pie and your +porridge than in your cheek; and your virginity, +your old virginity, is like one of our French +withered pears, it looks ill, it eats drily; marry, +'tis a withered pear; it was formerly better; +marry, yet 'tis a withered pear: will you anything with it? + + + +HELENA +Not my virginity yet +There shall your master have a thousand loves, +A mother and a mistress and a friend, +A phoenix, captain and an enemy, +A guide, a goddess, and a sovereign, +A counsellor, a traitress, and a dear; +His humble ambition, proud humility, +His jarring concord, and his discord dulcet, +His faith, his sweet disaster; with a world +Of pretty, fond, adoptious christendoms, +That blinking Cupid gossips. Now shall he-- +I know not what he shall. God send him well! +The court's a learning place, and he is one-- + + + +PAROLLES +What one, i' faith? + + + +HELENA +That I wish well. 'Tis pity-- + + + +PAROLLES +What's pity? + + + +HELENA +That wishing well had not a body in't, +Which might be felt; that we, the poorer born, +Whose baser stars do shut us up in wishes, +Might with effects of them follow our friends, +And show what we alone must think, which never +Return us thanks. + + +Enter Page + + +Page +Monsieur Parolles, my lord calls for you. + + +Exit + + +PAROLLES +Little Helen, farewell; if I can remember thee, I +will think of thee at court. + + + +HELENA +Monsieur Parolles, you were born under a charitable star. + + + +PAROLLES +Under Mars, I. + + + +HELENA +I especially think, under Mars. + + + +PAROLLES +Why under Mars? + + + +HELENA +The wars have so kept you under that you must needs +be born under Mars. + + + +PAROLLES +When he was predominant. + + + +HELENA +When he was retrograde, I think, rather. + + + +PAROLLES +Why think you so? + + + +HELENA +You go so much backward when you fight. + + + +PAROLLES +That's for advantage. + + + +HELENA +So is running away, when fear proposes the safety; +but the composition that your valour and fear makes +in you is a virtue of a good wing, and I like the wear well. + + + +PAROLLES +I am so full of businesses, I cannot answer thee +acutely. I will return perfect courtier; in the +which, my instruction shall serve to naturalize +thee, so thou wilt be capable of a courtier's +counsel and understand what advice shall thrust upon +thee; else thou diest in thine unthankfulness, and +thine ignorance makes thee away: farewell. When +thou hast leisure, say thy prayers; when thou hast +none, remember thy friends; get thee a good husband, +and use him as he uses thee; so, farewell. + + +Exit + + +HELENA +Our remedies oft in ourselves do lie, +Which we ascribe to heaven: the fated sky +Gives us free scope, only doth backward pull +Our slow designs when we ourselves are dull. +What power is it which mounts my love so high, +That makes me see, and cannot feed mine eye? +The mightiest space in fortune nature brings +To join like likes and kiss like native things. +Impossible be strange attempts to those +That weigh their pains in sense and do suppose +What hath been cannot be: who ever strove +So show her merit, that did miss her love? +The king's disease--my project may deceive me, +But my intents are fix'd and will not leave me. + + +Exit + + +SCENE II. Paris. The KING's palace. +Flourish of cornets. Enter the KING of France, +with letters, and divers Attendants + + +KING +The Florentines and Senoys are by the ears; +Have fought with equal fortune and continue +A braving war. + + + +First Lord +So 'tis reported, sir. + + + +KING +Nay, 'tis most credible; we here received it +A certainty, vouch'd from our cousin Austria, +With caution that the Florentine will move us +For speedy aid; wherein our dearest friend +Prejudicates the business and would seem +To have us make denial. + + + +First Lord +His love and wisdom, +Approved so to your majesty, may plead +For amplest credence. + + + +KING +He hath arm'd our answer, +And Florence is denied before he comes: +Yet, for our gentlemen that mean to see +The Tuscan service, freely have they leave +To stand on either part. + + + +Second Lord +It well may serve +A nursery to our gentry, who are sick +For breathing and exploit. + + + +KING +What's he comes here? + + +Enter BERTRAM, LAFEU, and PAROLLES + + +First Lord +It is the Count Rousillon, my good lord, +Young Bertram. + + + +KING +Youth, thou bear'st thy father's face; +Frank nature, rather curious than in haste, +Hath well composed thee. Thy father's moral parts +Mayst thou inherit too! Welcome to Paris. + + + +BERTRAM +My thanks and duty are your majesty's. + + + +KING +I would I had that corporal soundness now, +As when thy father and myself in friendship +First tried our soldiership! He did look far +Into the service of the time and was +Discipled of the bravest: he lasted long; +But on us both did haggish age steal on +And wore us out of act. It much repairs me +To talk of your good father. In his youth +He had the wit which I can well observe +To-day in our young lords; but they may jest +Till their own scorn return to them unnoted +Ere they can hide their levity in honour; +So like a courtier, contempt nor bitterness +Were in his pride or sharpness; if they were, +His equal had awaked them, and his honour, +Clock to itself, knew the true minute when +Exception bid him speak, and at this time +His tongue obey'd his hand: who were below him +He used as creatures of another place +And bow'd his eminent top to their low ranks, +Making them proud of his humility, +In their poor praise he humbled. Such a man +Might be a copy to these younger times; +Which, follow'd well, would demonstrate them now +But goers backward. + + + +BERTRAM +His good remembrance, sir, +Lies richer in your thoughts than on his tomb; +So in approof lives not his epitaph +As in your royal speech. + + + +KING +Would I were with him! He would always say-- +Methinks I hear him now; his plausive words +He scatter'd not in ears, but grafted them, +To grow there and to bear,--'Let me not live,'-- +This his good melancholy oft began, +On the catastrophe and heel of pastime, +When it was out,--'Let me not live,' quoth he, +'After my flame lacks oil, to be the snuff +Of younger spirits, whose apprehensive senses +All but new things disdain; whose judgments are +Mere fathers of their garments; whose constancies +Expire before their fashions.' This he wish'd; +I after him do after him wish too, +Since I nor wax nor honey can bring home, +I quickly were dissolved from my hive, +To give some labourers room. + + + +Second Lord +You are loved, sir: +They that least lend it you shall lack you first. + + + +KING +I fill a place, I know't. How long is't, count, +Since the physician at your father's died? +He was much famed. + + + +BERTRAM +Some six months since, my lord. + + + +KING +If he were living, I would try him yet. +Lend me an arm; the rest have worn me out +With several applications; nature and sickness +Debate it at their leisure. Welcome, count; +My son's no dearer. + + + +BERTRAM +Thank your majesty. + + +Exeunt. Flourish + + +SCENE III. Rousillon. The COUNT's palace. +Enter COUNTESS, Steward, and Clown + + +COUNTESS +I will now hear; what say you of this gentlewoman? + + + +Steward +Madam, the care I have had to even your content, I +wish might be found in the calendar of my past +endeavours; for then we wound our modesty and make +foul the clearness of our deservings, when of +ourselves we publish them. + + + +COUNTESS +What does this knave here? Get you gone, sirrah: +the complaints I have heard of you I do not all +believe: 'tis my slowness that I do not; for I know +you lack not folly to commit them, and have ability +enough to make such knaveries yours. + + + +Clown +'Tis not unknown to you, madam, I am a poor fellow. + + + +COUNTESS +Well, sir. + + + +Clown +No, madam, 'tis not so well that I am poor, though +many of the rich are damned: but, if I may have +your ladyship's good will to go to the world, Isbel +the woman and I will do as we may. + + + +COUNTESS +Wilt thou needs be a beggar? + + + +Clown +I do beg your good will in this case. + + + +COUNTESS +In what case? + + + +Clown +In Isbel's case and mine own. Service is no +heritage: and I think I shall never have the +blessing of God till I have issue o' my body; for +they say barnes are blessings. + + + +COUNTESS +Tell me thy reason why thou wilt marry. + + + +Clown +My poor body, madam, requires it: I am driven on +by the flesh; and he must needs go that the devil drives. + + + +COUNTESS +Is this all your worship's reason? + + + +Clown +Faith, madam, I have other holy reasons such as they +are. + + + +COUNTESS +May the world know them? + + + +Clown +I have been, madam, a wicked creature, as you and +all flesh and blood are; and, indeed, I do marry +that I may repent. + + + +COUNTESS +Thy marriage, sooner than thy wickedness. + + + +Clown +I am out o' friends, madam; and I hope to have +friends for my wife's sake. + + + +COUNTESS +Such friends are thine enemies, knave. + + + +Clown +You're shallow, madam, in great friends; for the +knaves come to do that for me which I am aweary of. +He that ears my land spares my team and gives me +leave to in the crop; if I be his cuckold, he's my +drudge: he that comforts my wife is the cherisher +of my flesh and blood; he that cherishes my flesh +and blood loves my flesh and blood; he that loves my +flesh and blood is my friend: ergo, he that kisses +my wife is my friend. If men could be contented to +be what they are, there were no fear in marriage; +for young Charbon the Puritan and old Poysam the +Papist, howsome'er their hearts are severed in +religion, their heads are both one; they may jowl +horns together, like any deer i' the herd. + + + +COUNTESS +Wilt thou ever be a foul-mouthed and calumnious knave? + + + +Clown +A prophet I, madam; and I speak the truth the next +way: +For I the ballad will repeat, +Which men full true shall find; +Your marriage comes by destiny, +Your cuckoo sings by kind. + + + +COUNTESS +Get you gone, sir; I'll talk with you more anon. + + + +Steward +May it please you, madam, that he bid Helen come to +you: of her I am to speak. + + + +COUNTESS +Sirrah, tell my gentlewoman I would speak with her; +Helen, I mean. + + + +Clown +Was this fair face the cause, quoth she, +Why the Grecians sacked Troy? +Fond done, done fond, +Was this King Priam's joy? +With that she sighed as she stood, +With that she sighed as she stood, +And gave this sentence then; +Among nine bad if one be good, +Among nine bad if one be good, +There's yet one good in ten. + + + +COUNTESS +What, one good in ten? you corrupt the song, sirrah. + + + +Clown +One good woman in ten, madam; which is a purifying +o' the song: would God would serve the world so all +the year! we'ld find no fault with the tithe-woman, +if I were the parson. One in ten, quoth a'! An we +might have a good woman born but one every blazing +star, or at an earthquake, 'twould mend the lottery +well: a man may draw his heart out, ere a' pluck +one. + + + +COUNTESS +You'll be gone, sir knave, and do as I command you. + + + +Clown +That man should be at woman's command, and yet no +hurt done! Though honesty be no puritan, yet it +will do no hurt; it will wear the surplice of +humility over the black gown of a big heart. I am +going, forsooth: the business is for Helen to come hither. + + +Exit + + +COUNTESS +Well, now. + + + +Steward +I know, madam, you love your gentlewoman entirely. + + + +COUNTESS +Faith, I do: her father bequeathed her to me; and +she herself, without other advantage, may lawfully +make title to as much love as she finds: there is +more owing her than is paid; and more shall be paid +her than she'll demand. + + + +Steward +Madam, I was very late more near her than I think +she wished me: alone she was, and did communicate +to herself her own words to her own ears; she +thought, I dare vow for her, they touched not any +stranger sense. Her matter was, she loved your son: +Fortune, she said, was no goddess, that had put +such difference betwixt their two estates; Love no +god, that would not extend his might, only where +qualities were level; Dian no queen of virgins, that +would suffer her poor knight surprised, without +rescue in the first assault or ransom afterward. +This she delivered in the most bitter touch of +sorrow that e'er I heard virgin exclaim in: which I +held my duty speedily to acquaint you withal; +sithence, in the loss that may happen, it concerns +you something to know it. + + + +COUNTESS +You have discharged this honestly; keep it to +yourself: many likelihoods informed me of this +before, which hung so tottering in the balance that +I could neither believe nor misdoubt. Pray you, +leave me: stall this in your bosom; and I thank you +for your honest care: I will speak with you further anon. +Exit Steward +Enter HELENA +Even so it was with me when I was young: +If ever we are nature's, these are ours; this thorn +Doth to our rose of youth rightly belong; +Our blood to us, this to our blood is born; +It is the show and seal of nature's truth, +Where love's strong passion is impress'd in youth: +By our remembrances of days foregone, +Such were our faults, or then we thought them none. +Her eye is sick on't: I observe her now. + + + +HELENA +What is your pleasure, madam? + + + +COUNTESS +You know, Helen, +I am a mother to you. + + + +HELENA +Mine honourable mistress. + + + +COUNTESS +Nay, a mother: +Why not a mother? When I said 'a mother,' +Methought you saw a serpent: what's in 'mother,' +That you start at it? I say, I am your mother; +And put you in the catalogue of those +That were enwombed mine: 'tis often seen +Adoption strives with nature and choice breeds +A native slip to us from foreign seeds: +You ne'er oppress'd me with a mother's groan, +Yet I express to you a mother's care: +God's mercy, maiden! does it curd thy blood +To say I am thy mother? What's the matter, +That this distemper'd messenger of wet, +The many-colour'd Iris, rounds thine eye? +Why? that you are my daughter? + + + +HELENA +That I am not. + + + +COUNTESS +I say, I am your mother. + + + +HELENA +Pardon, madam; +The Count Rousillon cannot be my brother: +I am from humble, he from honour'd name; +No note upon my parents, his all noble: +My master, my dear lord he is; and I +His servant live, and will his vassal die: +He must not be my brother. + + + +COUNTESS +Nor I your mother? + + + +HELENA +You are my mother, madam; would you were,-- +So that my lord your son were not my brother,-- +Indeed my mother! or were you both our mothers, +I care no more for than I do for heaven, +So I were not his sister. Can't no other, +But, I your daughter, he must be my brother? + + + +COUNTESS +Yes, Helen, you might be my daughter-in-law: +God shield you mean it not! daughter and mother +So strive upon your pulse. What, pale again? +My fear hath catch'd your fondness: now I see +The mystery of your loneliness, and find +Your salt tears' head: now to all sense 'tis gross +You love my son; invention is ashamed, +Against the proclamation of thy passion, +To say thou dost not: therefore tell me true; +But tell me then, 'tis so; for, look thy cheeks +Confess it, th' one to th' other; and thine eyes +See it so grossly shown in thy behaviors +That in their kind they speak it: only sin +And hellish obstinacy tie thy tongue, +That truth should be suspected. Speak, is't so? +If it be so, you have wound a goodly clew; +If it be not, forswear't: howe'er, I charge thee, +As heaven shall work in me for thine avail, +Tell me truly. + + + +HELENA +Good madam, pardon me! + + + +COUNTESS +Do you love my son? + + + +HELENA +Your pardon, noble mistress! + + + +COUNTESS +Love you my son? + + + +HELENA +Do not you love him, madam? + + + +COUNTESS +Go not about; my love hath in't a bond, +Whereof the world takes note: come, come, disclose +The state of your affection; for your passions +Have to the full appeach'd. + + + +HELENA +Then, I confess, +Here on my knee, before high heaven and you, +That before you, and next unto high heaven, +I love your son. +My friends were poor, but honest; so's my love: +Be not offended; for it hurts not him +That he is loved of me: I follow him not +By any token of presumptuous suit; +Nor would I have him till I do deserve him; +Yet never know how that desert should be. +I know I love in vain, strive against hope; +Yet in this captious and intenible sieve +I still pour in the waters of my love +And lack not to lose still: thus, Indian-like, +Religious in mine error, I adore +The sun, that looks upon his worshipper, +But knows of him no more. My dearest madam, +Let not your hate encounter with my love +For loving where you do: but if yourself, +Whose aged honour cites a virtuous youth, +Did ever in so true a flame of liking +Wish chastely and love dearly, that your Dian +Was both herself and love: O, then, give pity +To her, whose state is such that cannot choose +But lend and give where she is sure to lose; +That seeks not to find that her search implies, +But riddle-like lives sweetly where she dies! + + + +COUNTESS +Had you not lately an intent,--speak truly,-- +To go to Paris? + + + +HELENA +Madam, I had. + + + +COUNTESS +Wherefore? tell true. + + + +HELENA +I will tell truth; by grace itself I swear. +You know my father left me some prescriptions +Of rare and proved effects, such as his reading +And manifest experience had collected +For general sovereignty; and that he will'd me +In heedfull'st reservation to bestow them, +As notes whose faculties inclusive were +More than they were in note: amongst the rest, +There is a remedy, approved, set down, +To cure the desperate languishings whereof +The king is render'd lost. + + + +COUNTESS +This was your motive +For Paris, was it? speak. + + + +HELENA +My lord your son made me to think of this; +Else Paris and the medicine and the king +Had from the conversation of my thoughts +Haply been absent then. + + + +COUNTESS +But think you, Helen, +If you should tender your supposed aid, +He would receive it? he and his physicians +Are of a mind; he, that they cannot help him, +They, that they cannot help: how shall they credit +A poor unlearned virgin, when the schools, +Embowell'd of their doctrine, have left off +The danger to itself? + + + +HELENA +There's something in't, +More than my father's skill, which was the greatest +Of his profession, that his good receipt +Shall for my legacy be sanctified +By the luckiest stars in heaven: and, would your honour +But give me leave to try success, I'ld venture +The well-lost life of mine on his grace's cure +By such a day and hour. + + + +COUNTESS +Dost thou believe't? + + + +HELENA +Ay, madam, knowingly. + + + +COUNTESS +Why, Helen, thou shalt have my leave and love, +Means and attendants and my loving greetings +To those of mine in court: I'll stay at home +And pray God's blessing into thy attempt: +Be gone to-morrow; and be sure of this, +What I can help thee to thou shalt not miss. + + +Exeunt + + + + +ACT II + +SCENE I. Paris. The KING's palace. +Flourish of cornets. Enter the KING, attended +with divers young Lords taking leave for the +Florentine war; BERTRAM, and PAROLLES + + +KING +Farewell, young lords; these warlike principles +Do not throw from you: and you, my lords, farewell: +Share the advice betwixt you; if both gain, all +The gift doth stretch itself as 'tis received, +And is enough for both. + + + +First Lord +'Tis our hope, sir, +After well enter'd soldiers, to return +And find your grace in health. + + + +KING +No, no, it cannot be; and yet my heart +Will not confess he owes the malady +That doth my life besiege. Farewell, young lords; +Whether I live or die, be you the sons +Of worthy Frenchmen: let higher Italy,-- +Those bated that inherit but the fall +Of the last monarchy,--see that you come +Not to woo honour, but to wed it; when +The bravest questant shrinks, find what you seek, +That fame may cry you loud: I say, farewell. + + + +Second Lord +Health, at your bidding, serve your majesty! + + + +KING +Those girls of Italy, take heed of them: +They say, our French lack language to deny, +If they demand: beware of being captives, +Before you serve. + + + +Both +Our hearts receive your warnings. + + + +KING +Farewell. Come hither to me. + + +Exit, attended + + +First Lord +O, my sweet lord, that you will stay behind us! + + + +PAROLLES +'Tis not his fault, the spark. + + + +Second Lord +O, 'tis brave wars! + + + +PAROLLES +Most admirable: I have seen those wars. + + + +BERTRAM +I am commanded here, and kept a coil with +'Too young' and 'the next year' and ''tis too early.' + + + +PAROLLES +An thy mind stand to't, boy, steal away bravely. + + + +BERTRAM +I shall stay here the forehorse to a smock, +Creaking my shoes on the plain masonry, +Till honour be bought up and no sword worn +But one to dance with! By heaven, I'll steal away. + + + +First Lord +There's honour in the theft. + + + +PAROLLES +Commit it, count. + + + +Second Lord +I am your accessary; and so, farewell. + + + +BERTRAM +I grow to you, and our parting is a tortured body. + + + +First Lord +Farewell, captain. + + + +Second Lord +Sweet Monsieur Parolles! + + + +PAROLLES +Noble heroes, my sword and yours are kin. Good +sparks and lustrous, a word, good metals: you shall +find in the regiment of the Spinii one Captain +Spurio, with his cicatrice, an emblem of war, here +on his sinister cheek; it was this very sword +entrenched it: say to him, I live; and observe his +reports for me. + + + +First Lord +We shall, noble captain. + + +Exeunt Lords + + +PAROLLES +Mars dote on you for his novices! what will ye do? + + + +BERTRAM +Stay: the king. + + +Re-enter KING. BERTRAM and PAROLLES retire + + +PAROLLES +To BERTRAM Use a more spacious ceremony to the +noble lords; you have restrained yourself within the +list of too cold an adieu: be more expressive to +them: for they wear themselves in the cap of the +time, there do muster true gait, eat, speak, and +move under the influence of the most received star; +and though the devil lead the measure, such are to +be followed: after them, and take a more dilated farewell. + + + +BERTRAM +And I will do so. + + + +PAROLLES +Worthy fellows; and like to prove most sinewy sword-men. + + +Exeunt BERTRAM and PAROLLES +Enter LAFEU + + +LAFEU +Kneeling Pardon, my lord, for me and for my tidings. + + + +KING +I'll fee thee to stand up. + + + +LAFEU +Then here's a man stands, that has brought his pardon. +I would you had kneel'd, my lord, to ask me mercy, +And that at my bidding you could so stand up. + + + +KING +I would I had; so I had broke thy pate, +And ask'd thee mercy for't. + + + +LAFEU +Good faith, across: but, my good lord 'tis thus; +Will you be cured of your infirmity? + + + +KING +No. + + + +LAFEU +O, will you eat no grapes, my royal fox? +Yes, but you will my noble grapes, an if +My royal fox could reach them: I have seen a medicine +That's able to breathe life into a stone, +Quicken a rock, and make you dance canary +With spritely fire and motion; whose simple touch, +Is powerful to araise King Pepin, nay, +To give great Charlemain a pen in's hand, +And write to her a love-line. + + + +KING +What 'her' is this? + + + +LAFEU +Why, Doctor She: my lord, there's one arrived, +If you will see her: now, by my faith and honour, +If seriously I may convey my thoughts +In this my light deliverance, I have spoke +With one that, in her sex, her years, profession, +Wisdom and constancy, hath amazed me more +Than I dare blame my weakness: will you see her +For that is her demand, and know her business? +That done, laugh well at me. + + + +KING +Now, good Lafeu, +Bring in the admiration; that we with thee +May spend our wonder too, or take off thine +By wondering how thou took'st it. + + + +LAFEU +Nay, I'll fit you, +And not be all day neither. + + +Exit + + +KING +Thus he his special nothing ever prologues. + + +Re-enter LAFEU, with HELENA + + +LAFEU +Nay, come your ways. + + + +KING +This haste hath wings indeed. + + + +LAFEU +Nay, come your ways: +This is his majesty; say your mind to him: +A traitor you do look like; but such traitors +His majesty seldom fears: I am Cressid's uncle, +That dare leave two together; fare you well. + + +Exit + + +KING +Now, fair one, does your business follow us? + + + +HELENA +Ay, my good lord. +Gerard de Narbon was my father; +In what he did profess, well found. + + + +KING +I knew him. + + + +HELENA +The rather will I spare my praises towards him: +Knowing him is enough. On's bed of death +Many receipts he gave me: chiefly one. +Which, as the dearest issue of his practise, +And of his old experience the oily darling, +He bade me store up, as a triple eye, +Safer than mine own two, more dear; I have so; +And hearing your high majesty is touch'd +With that malignant cause wherein the honour +Of my dear father's gift stands chief in power, +I come to tender it and my appliance +With all bound humbleness. + + + +KING +We thank you, maiden; +But may not be so credulous of cure, +When our most learned doctors leave us and +The congregated college have concluded +That labouring art can never ransom nature +From her inaidible estate; I say we must not +So stain our judgment, or corrupt our hope, +To prostitute our past-cure malady +To empirics, or to dissever so +Our great self and our credit, to esteem +A senseless help when help past sense we deem. + + + +HELENA +My duty then shall pay me for my pains: +I will no more enforce mine office on you. +Humbly entreating from your royal thoughts +A modest one, to bear me back a again. + + + +KING +I cannot give thee less, to be call'd grateful: +Thou thought'st to help me; and such thanks I give +As one near death to those that wish him live: +But what at full I know, thou know'st no part, +I knowing all my peril, thou no art. + + + +HELENA +What I can do can do no hurt to try, +Since you set up your rest 'gainst remedy. +He that of greatest works is finisher +Oft does them by the weakest minister: +So holy writ in babes hath judgment shown, +When judges have been babes; great floods have flown +From simple sources, and great seas have dried +When miracles have by the greatest been denied. +Oft expectation fails and most oft there +Where most it promises, and oft it hits +Where hope is coldest and despair most fits. + + + +KING +I must not hear thee; fare thee well, kind maid; +Thy pains not used must by thyself be paid: +Proffers not took reap thanks for their reward. + + + +HELENA +Inspired merit so by breath is barr'd: +It is not so with Him that all things knows +As 'tis with us that square our guess by shows; +But most it is presumption in us when +The help of heaven we count the act of men. +Dear sir, to my endeavours give consent; +Of heaven, not me, make an experiment. +I am not an impostor that proclaim +Myself against the level of mine aim; +But know I think and think I know most sure +My art is not past power nor you past cure. + + + +KING +Are thou so confident? within what space +Hopest thou my cure? + + + +HELENA +The great'st grace lending grace +Ere twice the horses of the sun shall bring +Their fiery torcher his diurnal ring, +Ere twice in murk and occidental damp +Moist Hesperus hath quench'd his sleepy lamp, +Or four and twenty times the pilot's glass +Hath told the thievish minutes how they pass, +What is infirm from your sound parts shall fly, +Health shall live free and sickness freely die. + + + +KING +Upon thy certainty and confidence +What darest thou venture? + + + +HELENA +Tax of impudence, +A strumpet's boldness, a divulged shame +Traduced by odious ballads: my maiden's name +Sear'd otherwise; nay, worse--if worse--extended +With vilest torture let my life be ended. + + + +KING +Methinks in thee some blessed spirit doth speak +His powerful sound within an organ weak: +And what impossibility would slay +In common sense, sense saves another way. +Thy life is dear; for all that life can rate +Worth name of life in thee hath estimate, +Youth, beauty, wisdom, courage, all +That happiness and prime can happy call: +Thou this to hazard needs must intimate +Skill infinite or monstrous desperate. +Sweet practiser, thy physic I will try, +That ministers thine own death if I die. + + + +HELENA +If I break time, or flinch in property +Of what I spoke, unpitied let me die, +And well deserved: not helping, death's my fee; +But, if I help, what do you promise me? + + + +KING +Make thy demand. + + + +HELENA +But will you make it even? + + + +KING +Ay, by my sceptre and my hopes of heaven. + + + +HELENA +Then shalt thou give me with thy kingly hand +What husband in thy power I will command: +Exempted be from me the arrogance +To choose from forth the royal blood of France, +My low and humble name to propagate +With any branch or image of thy state; +But such a one, thy vassal, whom I know +Is free for me to ask, thee to bestow. + + + +KING +Here is my hand; the premises observed, +Thy will by my performance shall be served: +So make the choice of thy own time, for I, +Thy resolved patient, on thee still rely. +More should I question thee, and more I must, +Though more to know could not be more to trust, +From whence thou camest, how tended on: but rest +Unquestion'd welcome and undoubted blest. +Give me some help here, ho! If thou proceed +As high as word, my deed shall match thy meed. + + +Flourish. Exeunt + + +SCENE II. Rousillon. The COUNT's palace. +Enter COUNTESS and Clown + + +COUNTESS +Come on, sir; I shall now put you to the height of +your breeding. + + + +Clown +I will show myself highly fed and lowly taught: I +know my business is but to the court. + + + +COUNTESS +To the court! why, what place make you special, +when you put off that with such contempt? But to the court! + + + +Clown +Truly, madam, if God have lent a man any manners, he +may easily put it off at court: he that cannot make +a leg, put off's cap, kiss his hand and say nothing, +has neither leg, hands, lip, nor cap; and indeed +such a fellow, to say precisely, were not for the +court; but for me, I have an answer will serve all +men. + + + +COUNTESS +Marry, that's a bountiful answer that fits all +questions. + + + +Clown +It is like a barber's chair that fits all buttocks, +the pin-buttock, the quatch-buttock, the brawn +buttock, or any buttock. + + + +COUNTESS +Will your answer serve fit to all questions? + + + +Clown +As fit as ten groats is for the hand of an attorney, +as your French crown for your taffeta punk, as Tib's +rush for Tom's forefinger, as a pancake for Shrove +Tuesday, a morris for May-day, as the nail to his +hole, the cuckold to his horn, as a scolding queen +to a wrangling knave, as the nun's lip to the +friar's mouth, nay, as the pudding to his skin. + + + +COUNTESS +Have you, I say, an answer of such fitness for all +questions? + + + +Clown +From below your duke to beneath your constable, it +will fit any question. + + + +COUNTESS +It must be an answer of most monstrous size that +must fit all demands. + + + +Clown +But a trifle neither, in good faith, if the learned +should speak truth of it: here it is, and all that +belongs to't. Ask me if I am a courtier: it shall +do you no harm to learn. + + + +COUNTESS +To be young again, if we could: I will be a fool in +question, hoping to be the wiser by your answer. I +pray you, sir, are you a courtier? + + + +Clown +O Lord, sir! There's a simple putting off. More, +more, a hundred of them. + + + +COUNTESS +Sir, I am a poor friend of yours, that loves you. + + + +Clown +O Lord, sir! Thick, thick, spare not me. + + + +COUNTESS +I think, sir, you can eat none of this homely meat. + + + +Clown +O Lord, sir! Nay, put me to't, I warrant you. + + + +COUNTESS +You were lately whipped, sir, as I think. + + + +Clown +O Lord, sir! spare not me. + + + +COUNTESS +Do you cry, 'O Lord, sir!' at your whipping, and +'spare not me?' Indeed your 'O Lord, sir!' is very +sequent to your whipping: you would answer very well +to a whipping, if you were but bound to't. + + + +Clown +I ne'er had worse luck in my life in my 'O Lord, +sir!' I see things may serve long, but not serve ever. + + + +COUNTESS +I play the noble housewife with the time +To entertain't so merrily with a fool. + + + +Clown +O Lord, sir! why, there't serves well again. + + + +COUNTESS +An end, sir; to your business. Give Helen this, +And urge her to a present answer back: +Commend me to my kinsmen and my son: +This is not much. + + + +Clown +Not much commendation to them. + + + +COUNTESS +Not much employment for you: you understand me? + + + +Clown +Most fruitfully: I am there before my legs. + + + +COUNTESS +Haste you again. + + +Exeunt severally + + +SCENE III. Paris. The KING's palace. +Enter BERTRAM, LAFEU, and PAROLLES + + +LAFEU +They say miracles are past; and we have our +philosophical persons, to make modern and familiar, +things supernatural and causeless. Hence is it that +we make trifles of terrors, ensconcing ourselves +into seeming knowledge, when we should submit +ourselves to an unknown fear. + + + +PAROLLES +Why, 'tis the rarest argument of wonder that hath +shot out in our latter times. + + + +BERTRAM +And so 'tis. + + + +LAFEU +To be relinquish'd of the artists,-- + + + +PAROLLES +So I say. + + + +LAFEU +Both of Galen and Paracelsus. + + + +PAROLLES +So I say. + + + +LAFEU +Of all the learned and authentic fellows,-- + + + +PAROLLES +Right; so I say. + + + +LAFEU +That gave him out incurable,-- + + + +PAROLLES +Why, there 'tis; so say I too. + + + +LAFEU +Not to be helped,-- + + + +PAROLLES +Right; as 'twere, a man assured of a-- + + + +LAFEU +Uncertain life, and sure death. + + + +PAROLLES +Just, you say well; so would I have said. + + + +LAFEU +I may truly say, it is a novelty to the world. + + + +PAROLLES +It is, indeed: if you will have it in showing, you +shall read it in--what do you call there? + + + +LAFEU +A showing of a heavenly effect in an earthly actor. + + + +PAROLLES +That's it; I would have said the very same. + + + +LAFEU +Why, your dolphin is not lustier: 'fore me, +I speak in respect-- + + + +PAROLLES +Nay, 'tis strange, 'tis very strange, that is the +brief and the tedious of it; and he's of a most +facinerious spirit that will not acknowledge it to be the-- + + + +LAFEU +Very hand of heaven. + + + +PAROLLES +Ay, so I say. + + + +LAFEU +In a most weak-- +pausing +and debile minister, great power, great +transcendence: which should, indeed, give us a +further use to be made than alone the recovery of +the king, as to be-- +pausing +generally thankful. + + + +PAROLLES +I would have said it; you say well. Here comes the king. + + +Enter KING, HELENA, and Attendants. LAFEU and +PAROLLES retire + + +LAFEU +Lustig, as the Dutchman says: I'll like a maid the +better, whilst I have a tooth in my head: why, he's +able to lead her a coranto. + + + +PAROLLES +Mort du vinaigre! is not this Helen? + + + +LAFEU +'Fore God, I think so. + + + +KING +Go, call before me all the lords in court. +Sit, my preserver, by thy patient's side; +And with this healthful hand, whose banish'd sense +Thou hast repeal'd, a second time receive +The confirmation of my promised gift, +Which but attends thy naming. +Enter three or four Lords +Fair maid, send forth thine eye: this youthful parcel +Of noble bachelors stand at my bestowing, +O'er whom both sovereign power and father's voice +I have to use: thy frank election make; +Thou hast power to choose, and they none to forsake. + + + +HELENA +To each of you one fair and virtuous mistress +Fall, when Love please! marry, to each, but one! + + + +LAFEU +I'ld give bay Curtal and his furniture, +My mouth no more were broken than these boys', +And writ as little beard. + + + +KING +Peruse them well: +Not one of those but had a noble father. + + + +HELENA +Gentlemen, +Heaven hath through me restored the king to health. + + + +All +We understand it, and thank heaven for you. + + + +HELENA +I am a simple maid, and therein wealthiest, +That I protest I simply am a maid. +Please it your majesty, I have done already: +The blushes in my cheeks thus whisper me, +'We blush that thou shouldst choose; but, be refused, +Let the white death sit on thy cheek for ever; +We'll ne'er come there again.' + + + +KING +Make choice; and, see, +Who shuns thy love shuns all his love in me. + + + +HELENA +Now, Dian, from thy altar do I fly, +And to imperial Love, that god most high, +Do my sighs stream. Sir, will you hear my suit? + + + +First Lord +And grant it. + + + +HELENA +Thanks, sir; all the rest is mute. + + + +LAFEU +I had rather be in this choice than throw ames-ace +for my life. + + + +HELENA +The honour, sir, that flames in your fair eyes, +Before I speak, too threateningly replies: +Love make your fortunes twenty times above +Her that so wishes and her humble love! + + + +Second Lord +No better, if you please. + + + +HELENA +My wish receive, +Which great Love grant! and so, I take my leave. + + + +LAFEU +Do all they deny her? An they were sons of mine, +I'd have them whipped; or I would send them to the +Turk, to make eunuchs of. + + + +HELENA +Be not afraid that I your hand should take; +I'll never do you wrong for your own sake: +Blessing upon your vows! and in your bed +Find fairer fortune, if you ever wed! + + + +LAFEU +These boys are boys of ice, they'll none have her: +sure, they are bastards to the English; the French +ne'er got 'em. + + + +HELENA +You are too young, too happy, and too good, +To make yourself a son out of my blood. + + + +Fourth Lord +Fair one, I think not so. + + + +LAFEU +There's one grape yet; I am sure thy father drunk +wine: but if thou be'st not an ass, I am a youth +of fourteen; I have known thee already. + + + +HELENA +To BERTRAM I dare not say I take you; but I give +Me and my service, ever whilst I live, +Into your guiding power. This is the man. + + + +KING +Why, then, young Bertram, take her; she's thy wife. + + + +BERTRAM +My wife, my liege! I shall beseech your highness, +In such a business give me leave to use +The help of mine own eyes. + + + +KING +Know'st thou not, Bertram, +What she has done for me? + + + +BERTRAM +Yes, my good lord; +But never hope to know why I should marry her. + + + +KING +Thou know'st she has raised me from my sickly bed. + + + +BERTRAM +But follows it, my lord, to bring me down +Must answer for your raising? I know her well: +She had her breeding at my father's charge. +A poor physician's daughter my wife! Disdain +Rather corrupt me ever! + + + +KING +'Tis only title thou disdain'st in her, the which +I can build up. Strange is it that our bloods, +Of colour, weight, and heat, pour'd all together, +Would quite confound distinction, yet stand off +In differences so mighty. If she be +All that is virtuous, save what thou dislikest, +A poor physician's daughter, thou dislikest +Of virtue for the name: but do not so: +From lowest place when virtuous things proceed, +The place is dignified by the doer's deed: +Where great additions swell's, and virtue none, +It is a dropsied honour. Good alone +Is good without a name. Vileness is so: +The property by what it is should go, +Not by the title. She is young, wise, fair; +In these to nature she's immediate heir, +And these breed honour: that is honour's scorn, +Which challenges itself as honour's born +And is not like the sire: honours thrive, +When rather from our acts we them derive +Than our foregoers: the mere word's a slave +Debosh'd on every tomb, on every grave +A lying trophy, and as oft is dumb +Where dust and damn'd oblivion is the tomb +Of honour'd bones indeed. What should be said? +If thou canst like this creature as a maid, +I can create the rest: virtue and she +Is her own dower; honour and wealth from me. + + + +BERTRAM +I cannot love her, nor will strive to do't. + + + +KING +Thou wrong'st thyself, if thou shouldst strive to choose. + + + +HELENA +That you are well restored, my lord, I'm glad: +Let the rest go. + + + +KING +My honour's at the stake; which to defeat, +I must produce my power. Here, take her hand, +Proud scornful boy, unworthy this good gift; +That dost in vile misprision shackle up +My love and her desert; that canst not dream, +We, poising us in her defective scale, +Shall weigh thee to the beam; that wilt not know, +It is in us to plant thine honour where +We please to have it grow. Cheque thy contempt: +Obey our will, which travails in thy good: +Believe not thy disdain, but presently +Do thine own fortunes that obedient right +Which both thy duty owes and our power claims; +Or I will throw thee from my care for ever +Into the staggers and the careless lapse +Of youth and ignorance; both my revenge and hate +Loosing upon thee, in the name of justice, +Without all terms of pity. Speak; thine answer. + + + +BERTRAM +Pardon, my gracious lord; for I submit +My fancy to your eyes: when I consider +What great creation and what dole of honour +Flies where you bid it, I find that she, which late +Was in my nobler thoughts most base, is now +The praised of the king; who, so ennobled, +Is as 'twere born so. + + + +KING +Take her by the hand, +And tell her she is thine: to whom I promise +A counterpoise, if not to thy estate +A balance more replete. + + + +BERTRAM +I take her hand. + + + +KING +Good fortune and the favour of the king +Smile upon this contract; whose ceremony +Shall seem expedient on the now-born brief, +And be perform'd to-night: the solemn feast +Shall more attend upon the coming space, +Expecting absent friends. As thou lovest her, +Thy love's to me religious; else, does err. + + +Exeunt all but LAFEU and PAROLLES + + +LAFEU +Advancing Do you hear, monsieur? a word with you. + + + +PAROLLES +Your pleasure, sir? + + + +LAFEU +Your lord and master did well to make his +recantation. + + + +PAROLLES +Recantation! My lord! my master! + + + +LAFEU +Ay; is it not a language I speak? + + + +PAROLLES +A most harsh one, and not to be understood without +bloody succeeding. My master! + + + +LAFEU +Are you companion to the Count Rousillon? + + + +PAROLLES +To any count, to all counts, to what is man. + + + +LAFEU +To what is count's man: count's master is of +another style. + + + +PAROLLES +You are too old, sir; let it satisfy you, you are too old. + + + +LAFEU +I must tell thee, sirrah, I write man; to which +title age cannot bring thee. + + + +PAROLLES +What I dare too well do, I dare not do. + + + +LAFEU +I did think thee, for two ordinaries, to be a pretty +wise fellow; thou didst make tolerable vent of thy +travel; it might pass: yet the scarfs and the +bannerets about thee did manifoldly dissuade me from +believing thee a vessel of too great a burthen. I +have now found thee; when I lose thee again, I care +not: yet art thou good for nothing but taking up; and +that thou't scarce worth. + + + +PAROLLES +Hadst thou not the privilege of antiquity upon thee,-- + + + +LAFEU +Do not plunge thyself too far in anger, lest thou +hasten thy trial; which if--Lord have mercy on thee +for a hen! So, my good window of lattice, fare thee +well: thy casement I need not open, for I look +through thee. Give me thy hand. + + + +PAROLLES +My lord, you give me most egregious indignity. + + + +LAFEU +Ay, with all my heart; and thou art worthy of it. + + + +PAROLLES +I have not, my lord, deserved it. + + + +LAFEU +Yes, good faith, every dram of it; and I will not +bate thee a scruple. + + + +PAROLLES +Well, I shall be wiser. + + + +LAFEU +Even as soon as thou canst, for thou hast to pull at +a smack o' the contrary. If ever thou be'st bound +in thy scarf and beaten, thou shalt find what it is +to be proud of thy bondage. I have a desire to hold +my acquaintance with thee, or rather my knowledge, +that I may say in the default, he is a man I know. + + + +PAROLLES +My lord, you do me most insupportable vexation. + + + +LAFEU +I would it were hell-pains for thy sake, and my poor +doing eternal: for doing I am past: as I will by +thee, in what motion age will give me leave. + + +Exit + + +PAROLLES +Well, thou hast a son shall take this disgrace off +me; scurvy, old, filthy, scurvy lord! Well, I must +be patient; there is no fettering of authority. +I'll beat him, by my life, if I can meet him with +any convenience, an he were double and double a +lord. I'll have no more pity of his age than I +would of--I'll beat him, an if I could but meet him again. + + +Re-enter LAFEU + + +LAFEU +Sirrah, your lord and master's married; there's news +for you: you have a new mistress. + + + +PAROLLES +I most unfeignedly beseech your lordship to make +some reservation of your wrongs: he is my good +lord: whom I serve above is my master. + + + +LAFEU +Who? God? + + + +PAROLLES +Ay, sir. + + + +LAFEU +The devil it is that's thy master. Why dost thou +garter up thy arms o' this fashion? dost make hose of +sleeves? do other servants so? Thou wert best set +thy lower part where thy nose stands. By mine +honour, if I were but two hours younger, I'ld beat +thee: methinks, thou art a general offence, and +every man should beat thee: I think thou wast +created for men to breathe themselves upon thee. + + + +PAROLLES +This is hard and undeserved measure, my lord. + + + +LAFEU +Go to, sir; you were beaten in Italy for picking a +kernel out of a pomegranate; you are a vagabond and +no true traveller: you are more saucy with lords +and honourable personages than the commission of your +birth and virtue gives you heraldry. You are not +worth another word, else I'ld call you knave. I leave you. + + +Exit + + +PAROLLES +Good, very good; it is so then: good, very good; +let it be concealed awhile. + + +Re-enter BERTRAM + + +BERTRAM +Undone, and forfeited to cares for ever! + + + +PAROLLES +What's the matter, sweet-heart? + + + +BERTRAM +Although before the solemn priest I have sworn, +I will not bed her. + + + +PAROLLES +What, what, sweet-heart? + + + +BERTRAM +O my Parolles, they have married me! +I'll to the Tuscan wars, and never bed her. + + + +PAROLLES +France is a dog-hole, and it no more merits +The tread of a man's foot: to the wars! + + + +BERTRAM +There's letters from my mother: what the import is, +I know not yet. + + + +PAROLLES +Ay, that would be known. To the wars, my boy, to the wars! +He wears his honour in a box unseen, +That hugs his kicky-wicky here at home, +Spending his manly marrow in her arms, +Which should sustain the bound and high curvet +Of Mars's fiery steed. To other regions +France is a stable; we that dwell in't jades; +Therefore, to the war! + + + +BERTRAM +It shall be so: I'll send her to my house, +Acquaint my mother with my hate to her, +And wherefore I am fled; write to the king +That which I durst not speak; his present gift +Shall furnish me to those Italian fields, +Where noble fellows strike: war is no strife +To the dark house and the detested wife. + + + +PAROLLES +Will this capriccio hold in thee? art sure? + + + +BERTRAM +Go with me to my chamber, and advise me. +I'll send her straight away: to-morrow +I'll to the wars, she to her single sorrow. + + + +PAROLLES +Why, these balls bound; there's noise in it. 'Tis hard: +A young man married is a man that's marr'd: +Therefore away, and leave her bravely; go: +The king has done you wrong: but, hush, 'tis so. + + +Exeunt + + +SCENE IV. Paris. The KING's palace. +Enter HELENA and Clown + + +HELENA +My mother greets me kindly; is she well? + + + +Clown +She is not well; but yet she has her health: she's +very merry; but yet she is not well: but thanks be +given, she's very well and wants nothing i', the +world; but yet she is not well. + + + +HELENA +If she be very well, what does she ail, that she's +not very well? + + + +Clown +Truly, she's very well indeed, but for two things. + + + +HELENA +What two things? + + + +Clown +One, that she's not in heaven, whither God send her +quickly! the other that she's in earth, from whence +God send her quickly! + + +Enter PAROLLES + + +PAROLLES +Bless you, my fortunate lady! + + + +HELENA +I hope, sir, I have your good will to have mine own +good fortunes. + + + +PAROLLES +You had my prayers to lead them on; and to keep them +on, have them still. O, my knave, how does my old lady? + + + +Clown +So that you had her wrinkles and I her money, +I would she did as you say. + + + +PAROLLES +Why, I say nothing. + + + +Clown +Marry, you are the wiser man; for many a man's +tongue shakes out his master's undoing: to say +nothing, to do nothing, to know nothing, and to have +nothing, is to be a great part of your title; which +is within a very little of nothing. + + + +PAROLLES +Away! thou'rt a knave. + + + +Clown +You should have said, sir, before a knave thou'rt a +knave; that's, before me thou'rt a knave: this had +been truth, sir. + + + +PAROLLES +Go to, thou art a witty fool; I have found thee. + + + +Clown +Did you find me in yourself, sir? or were you +taught to find me? The search, sir, was profitable; +and much fool may you find in you, even to the +world's pleasure and the increase of laughter. + + + +PAROLLES +A good knave, i' faith, and well fed. +Madam, my lord will go away to-night; +A very serious business calls on him. +The great prerogative and rite of love, +Which, as your due, time claims, he does acknowledge; +But puts it off to a compell'd restraint; +Whose want, and whose delay, is strew'd with sweets, +Which they distil now in the curbed time, +To make the coming hour o'erflow with joy +And pleasure drown the brim. + + + +HELENA +What's his will else? + + + +PAROLLES +That you will take your instant leave o' the king +And make this haste as your own good proceeding, +Strengthen'd with what apology you think +May make it probable need. + + + +HELENA +What more commands he? + + + +PAROLLES +That, having this obtain'd, you presently +Attend his further pleasure. + + + +HELENA +In every thing I wait upon his will. + + + +PAROLLES +I shall report it so. + + + +HELENA +I pray you. +Exit PAROLLES +Come, sirrah. + + +Exeunt + + +SCENE V. Paris. The KING's palace. +Enter LAFEU and BERTRAM + + +LAFEU +But I hope your lordship thinks not him a soldier. + + + +BERTRAM +Yes, my lord, and of very valiant approof. + + + +LAFEU +You have it from his own deliverance. + + + +BERTRAM +And by other warranted testimony. + + + +LAFEU +Then my dial goes not true: I took this lark for a bunting. + + + +BERTRAM +I do assure you, my lord, he is very great in +knowledge and accordingly valiant. + + + +LAFEU +I have then sinned against his experience and +transgressed against his valour; and my state that +way is dangerous, since I cannot yet find in my +heart to repent. Here he comes: I pray you, make +us friends; I will pursue the amity. + + +Enter PAROLLES + + +PAROLLES +To BERTRAM These things shall be done, sir. + + + +LAFEU +Pray you, sir, who's his tailor? + + + +PAROLLES +Sir? + + + +LAFEU +O, I know him well, I, sir; he, sir, 's a good +workman, a very good tailor. + + + +BERTRAM +Aside to PAROLLES Is she gone to the king? + + + +PAROLLES +She is. + + + +BERTRAM +Will she away to-night? + + + +PAROLLES +As you'll have her. + + + +BERTRAM +I have writ my letters, casketed my treasure, +Given order for our horses; and to-night, +When I should take possession of the bride, +End ere I do begin. + + + +LAFEU +A good traveller is something at the latter end of a +dinner; but one that lies three thirds and uses a +known truth to pass a thousand nothings with, should +be once heard and thrice beaten. God save you, captain. + + + +BERTRAM +Is there any unkindness between my lord and you, monsieur? + + + +PAROLLES +I know not how I have deserved to run into my lord's +displeasure. + + + +LAFEU +You have made shift to run into 't, boots and spurs +and all, like him that leaped into the custard; and +out of it you'll run again, rather than suffer +question for your residence. + + + +BERTRAM +It may be you have mistaken him, my lord. + + + +LAFEU +And shall do so ever, though I took him at 's +prayers. Fare you well, my lord; and believe this +of me, there can be no kernel in this light nut; the +soul of this man is his clothes. Trust him not in +matter of heavy consequence; I have kept of them +tame, and know their natures. Farewell, monsieur: +I have spoken better of you than you have or will to +deserve at my hand; but we must do good against evil. + + +Exit + + +PAROLLES +An idle lord. I swear. + + + +BERTRAM +I think so. + + + +PAROLLES +Why, do you not know him? + + + +BERTRAM +Yes, I do know him well, and common speech +Gives him a worthy pass. Here comes my clog. + + +Enter HELENA + + +HELENA +I have, sir, as I was commanded from you, +Spoke with the king and have procured his leave +For present parting; only he desires +Some private speech with you. + + + +BERTRAM +I shall obey his will. +You must not marvel, Helen, at my course, +Which holds not colour with the time, nor does +The ministration and required office +On my particular. Prepared I was not +For such a business; therefore am I found +So much unsettled: this drives me to entreat you +That presently you take our way for home; +And rather muse than ask why I entreat you, +For my respects are better than they seem +And my appointments have in them a need +Greater than shows itself at the first view +To you that know them not. This to my mother: +Giving a letter +'Twill be two days ere I shall see you, so +I leave you to your wisdom. + + + +HELENA +Sir, I can nothing say, +But that I am your most obedient servant. + + + +BERTRAM +Come, come, no more of that. + + + +HELENA +And ever shall +With true observance seek to eke out that +Wherein toward me my homely stars have fail'd +To equal my great fortune. + + + +BERTRAM +Let that go: +My haste is very great: farewell; hie home. + + + +HELENA +Pray, sir, your pardon. + + + +BERTRAM +Well, what would you say? + + + +HELENA +I am not worthy of the wealth I owe, +Nor dare I say 'tis mine, and yet it is; +But, like a timorous thief, most fain would steal +What law does vouch mine own. + + + +BERTRAM +What would you have? + + + +HELENA +Something; and scarce so much: nothing, indeed. +I would not tell you what I would, my lord: +Faith yes; +Strangers and foes do sunder, and not kiss. + + + +BERTRAM +I pray you, stay not, but in haste to horse. + + + +HELENA +I shall not break your bidding, good my lord. + + + +BERTRAM +Where are my other men, monsieur? Farewell. +Exit HELENA +Go thou toward home; where I will never come +Whilst I can shake my sword or hear the drum. +Away, and for our flight. + + + +PAROLLES +Bravely, coragio! + + +Exeunt + + + + +ACT III + +SCENE I. Florence. The DUKE's palace. +Flourish. Enter the DUKE of Florence attended; +the two Frenchmen, with a troop of soldiers. + + +DUKE +So that from point to point now have you heard +The fundamental reasons of this war, +Whose great decision hath much blood let forth +And more thirsts after. + + + +First Lord +Holy seems the quarrel +Upon your grace's part; black and fearful +On the opposer. + + + +DUKE +Therefore we marvel much our cousin France +Would in so just a business shut his bosom +Against our borrowing prayers. + + + +Second Lord +Good my lord, +The reasons of our state I cannot yield, +But like a common and an outward man, +That the great figure of a council frames +By self-unable motion: therefore dare not +Say what I think of it, since I have found +Myself in my incertain grounds to fail +As often as I guess'd. + + + +DUKE +Be it his pleasure. + + + +First Lord +But I am sure the younger of our nature, +That surfeit on their ease, will day by day +Come here for physic. + + + +DUKE +Welcome shall they be; +And all the honours that can fly from us +Shall on them settle. You know your places well; +When better fall, for your avails they fell: +To-morrow to the field. + + +Flourish. Exeunt + + +SCENE II. Rousillon. The COUNT's palace. +Enter COUNTESS and Clown + + +COUNTESS +It hath happened all as I would have had it, save +that he comes not along with her. + + + +Clown +By my troth, I take my young lord to be a very +melancholy man. + + + +COUNTESS +By what observance, I pray you? + + + +Clown +Why, he will look upon his boot and sing; mend the +ruff and sing; ask questions and sing; pick his +teeth and sing. I know a man that had this trick of +melancholy sold a goodly manor for a song. + + + +COUNTESS +Let me see what he writes, and when he means to come. + + +Opening a letter + + +Clown +I have no mind to Isbel since I was at court: our +old ling and our Isbels o' the country are nothing +like your old ling and your Isbels o' the court: +the brains of my Cupid's knocked out, and I begin to +love, as an old man loves money, with no stomach. + + + +COUNTESS +What have we here? + + + +Clown +E'en that you have there. + + +Exit + + +COUNTESS +Reads I have sent you a daughter-in-law: she hath +recovered the king, and undone me. I have wedded +her, not bedded her; and sworn to make the 'not' +eternal. You shall hear I am run away: know it +before the report come. If there be breadth enough +in the world, I will hold a long distance. My duty +to you. Your unfortunate son, +BERTRAM. +This is not well, rash and unbridled boy. +To fly the favours of so good a king; +To pluck his indignation on thy head +By the misprising of a maid too virtuous +For the contempt of empire. + + +Re-enter Clown + + +Clown +O madam, yonder is heavy news within between two +soldiers and my young lady! + + + +COUNTESS +What is the matter? + + + +Clown +Nay, there is some comfort in the news, some +comfort; your son will not be killed so soon as I +thought he would. + + + +COUNTESS +Why should he be killed? + + + +Clown +So say I, madam, if he run away, as I hear he does: +the danger is in standing to't; that's the loss of +men, though it be the getting of children. Here +they come will tell you more: for my part, I only +hear your son was run away. + + +Exit +Enter HELENA, and two Gentlemen + + +First Gentleman +Save you, good madam. + + + +HELENA +Madam, my lord is gone, for ever gone. + + + +Second Gentleman +Do not say so. + + + +COUNTESS +Think upon patience. Pray you, gentlemen, +I have felt so many quirks of joy and grief, +That the first face of neither, on the start, +Can woman me unto't: where is my son, I pray you? + + + +Second Gentleman +Madam, he's gone to serve the duke of Florence: +We met him thitherward; for thence we came, +And, after some dispatch in hand at court, +Thither we bend again. + + + +HELENA +Look on his letter, madam; here's my passport. +Reads +When thou canst get the ring upon my finger which +never shall come off, and show me a child begotten +of thy body that I am father to, then call me +husband: but in such a 'then' I write a 'never.' +This is a dreadful sentence. + + + +COUNTESS +Brought you this letter, gentlemen? + + + +First Gentleman +Ay, madam; +And for the contents' sake are sorry for our pain. + + + +COUNTESS +I prithee, lady, have a better cheer; +If thou engrossest all the griefs are thine, +Thou robb'st me of a moiety: he was my son; +But I do wash his name out of my blood, +And thou art all my child. Towards Florence is he? + + + +Second Gentleman +Ay, madam. + + + +COUNTESS +And to be a soldier? + + + +Second Gentleman +Such is his noble purpose; and believe 't, +The duke will lay upon him all the honour +That good convenience claims. + + + +COUNTESS +Return you thither? + + + +First Gentleman +Ay, madam, with the swiftest wing of speed. + + + +HELENA +Reads Till I have no wife I have nothing in France. +'Tis bitter. + + + +COUNTESS +Find you that there? + + + +HELENA +Ay, madam. + + + +First Gentleman +'Tis but the boldness of his hand, haply, which his +heart was not consenting to. + + + +COUNTESS +Nothing in France, until he have no wife! +There's nothing here that is too good for him +But only she; and she deserves a lord +That twenty such rude boys might tend upon +And call her hourly mistress. Who was with him? + + + +First Gentleman +A servant only, and a gentleman +Which I have sometime known. + + + +COUNTESS +Parolles, was it not? + + + +First Gentleman +Ay, my good lady, he. + + + +COUNTESS +A very tainted fellow, and full of wickedness. +My son corrupts a well-derived nature +With his inducement. + + + +First Gentleman +Indeed, good lady, +The fellow has a deal of that too much, +Which holds him much to have. + + + +COUNTESS +You're welcome, gentlemen. +I will entreat you, when you see my son, +To tell him that his sword can never win +The honour that he loses: more I'll entreat you +Written to bear along. + + + +Second Gentleman +We serve you, madam, +In that and all your worthiest affairs. + + + +COUNTESS +Not so, but as we change our courtesies. +Will you draw near! + + +Exeunt COUNTESS and Gentlemen + + +HELENA +'Till I have no wife, I have nothing in France.' +Nothing in France, until he has no wife! +Thou shalt have none, Rousillon, none in France; +Then hast thou all again. Poor lord! is't I +That chase thee from thy country and expose +Those tender limbs of thine to the event +Of the none-sparing war? and is it I +That drive thee from the sportive court, where thou +Wast shot at with fair eyes, to be the mark +Of smoky muskets? O you leaden messengers, +That ride upon the violent speed of fire, +Fly with false aim; move the still-peering air, +That sings with piercing; do not touch my lord. +Whoever shoots at him, I set him there; +Whoever charges on his forward breast, +I am the caitiff that do hold him to't; +And, though I kill him not, I am the cause +His death was so effected: better 'twere +I met the ravin lion when he roar'd +With sharp constraint of hunger; better 'twere +That all the miseries which nature owes +Were mine at once. No, come thou home, Rousillon, +Whence honour but of danger wins a scar, +As oft it loses all: I will be gone; +My being here it is that holds thee hence: +Shall I stay here to do't? no, no, although +The air of paradise did fan the house +And angels officed all: I will be gone, +That pitiful rumour may report my flight, +To consolate thine ear. Come, night; end, day! +For with the dark, poor thief, I'll steal away. + + +Exit + + +SCENE III. Florence. Before the DUKE's palace. +Flourish. Enter the DUKE of Florence, BERTRAM, +PAROLLES, Soldiers, Drum, and Trumpets + + +DUKE +The general of our horse thou art; and we, +Great in our hope, lay our best love and credence +Upon thy promising fortune. + + + +BERTRAM +Sir, it is +A charge too heavy for my strength, but yet +We'll strive to bear it for your worthy sake +To the extreme edge of hazard. + + + +DUKE +Then go thou forth; +And fortune play upon thy prosperous helm, +As thy auspicious mistress! + + + +BERTRAM +This very day, +Great Mars, I put myself into thy file: +Make me but like my thoughts, and I shall prove +A lover of thy drum, hater of love. + + +Exeunt + + +SCENE IV. Rousillon. The COUNT's palace. +Enter COUNTESS and Steward + + +COUNTESS +Alas! and would you take the letter of her? +Might you not know she would do as she has done, +By sending me a letter? Read it again. + + + +Steward +Reads +I am Saint Jaques' pilgrim, thither gone: +Ambitious love hath so in me offended, +That barefoot plod I the cold ground upon, +With sainted vow my faults to have amended. +Write, write, that from the bloody course of war +My dearest master, your dear son, may hie: +Bless him at home in peace, whilst I from far +His name with zealous fervor sanctify: +His taken labours bid him me forgive; +I, his despiteful Juno, sent him forth +From courtly friends, with camping foes to live, +Where death and danger dogs the heels of worth: +He is too good and fair for death and me: +Whom I myself embrace, to set him free. + + + +COUNTESS +Ah, what sharp stings are in her mildest words! +Rinaldo, you did never lack advice so much, +As letting her pass so: had I spoke with her, +I could have well diverted her intents, +Which thus she hath prevented. + + + +Steward +Pardon me, madam: +If I had given you this at over-night, +She might have been o'erta'en; and yet she writes, +Pursuit would be but vain. + + + +COUNTESS +What angel shall +Bless this unworthy husband? he cannot thrive, +Unless her prayers, whom heaven delights to hear +And loves to grant, reprieve him from the wrath +Of greatest justice. Write, write, Rinaldo, +To this unworthy husband of his wife; +Let every word weigh heavy of her worth +That he does weigh too light: my greatest grief. +Though little he do feel it, set down sharply. +Dispatch the most convenient messenger: +When haply he shall hear that she is gone, +He will return; and hope I may that she, +Hearing so much, will speed her foot again, +Led hither by pure love: which of them both +Is dearest to me. I have no skill in sense +To make distinction: provide this messenger: +My heart is heavy and mine age is weak; +Grief would have tears, and sorrow bids me speak. + + +Exeunt + + +SCENE V. Florence. Without the walls. A tucket afar off. +Enter an old Widow of Florence, DIANA, VIOLENTA, +and MARIANA, with other Citizens + + +Widow +Nay, come; for if they do approach the city, we +shall lose all the sight. + + + +DIANA +They say the French count has done most honourable service. + + + +Widow +It is reported that he has taken their greatest +commander; and that with his own hand he slew the +duke's brother. +Tucket +We have lost our labour; they are gone a contrary +way: hark! you may know by their trumpets. + + + +MARIANA +Come, let's return again, and suffice ourselves with +the report of it. Well, Diana, take heed of this +French earl: the honour of a maid is her name; and +no legacy is so rich as honesty. + + + +Widow +I have told my neighbour how you have been solicited +by a gentleman his companion. + + + +MARIANA +I know that knave; hang him! one Parolles: a +filthy officer he is in those suggestions for the +young earl. Beware of them, Diana; their promises, +enticements, oaths, tokens, and all these engines of +lust, are not the things they go under: many a maid +hath been seduced by them; and the misery is, +example, that so terrible shows in the wreck of +maidenhood, cannot for all that dissuade succession, +but that they are limed with the twigs that threaten +them. I hope I need not to advise you further; but +I hope your own grace will keep you where you are, +though there were no further danger known but the +modesty which is so lost. + + + +DIANA +You shall not need to fear me. + + + +Widow +I hope so. +Enter HELENA, disguised like a Pilgrim +Look, here comes a pilgrim: I know she will lie at +my house; thither they send one another: I'll +question her. God save you, pilgrim! whither are you bound? + + + +HELENA +To Saint Jaques le Grand. +Where do the palmers lodge, I do beseech you? + + + +Widow +At the Saint Francis here beside the port. + + + +HELENA +Is this the way? + + + +Widow +Ay, marry, is't. +A march afar +Hark you! they come this way. +If you will tarry, holy pilgrim, +But till the troops come by, +I will conduct you where you shall be lodged; +The rather, for I think I know your hostess +As ample as myself. + + + +HELENA +Is it yourself? + + + +Widow +If you shall please so, pilgrim. + + + +HELENA +I thank you, and will stay upon your leisure. + + + +Widow +You came, I think, from France? + + + +HELENA +I did so. + + + +Widow +Here you shall see a countryman of yours +That has done worthy service. + + + +HELENA +His name, I pray you. + + + +DIANA +The Count Rousillon: know you such a one? + + + +HELENA +But by the ear, that hears most nobly of him: +His face I know not. + + + +DIANA +Whatsome'er he is, +He's bravely taken here. He stole from France, +As 'tis reported, for the king had married him +Against his liking: think you it is so? + + + +HELENA +Ay, surely, mere the truth: I know his lady. + + + +DIANA +There is a gentleman that serves the count +Reports but coarsely of her. + + + +HELENA +What's his name? + + + +DIANA +Monsieur Parolles. + + + +HELENA +O, I believe with him, +In argument of praise, or to the worth +Of the great count himself, she is too mean +To have her name repeated: all her deserving +Is a reserved honesty, and that +I have not heard examined. + + + +DIANA +Alas, poor lady! +'Tis a hard bondage to become the wife +Of a detesting lord. + + + +Widow +I warrant, good creature, wheresoe'er she is, +Her heart weighs sadly: this young maid might do her +A shrewd turn, if she pleased. + + + +HELENA +How do you mean? +May be the amorous count solicits her +In the unlawful purpose. + + + +Widow +He does indeed; +And brokes with all that can in such a suit +Corrupt the tender honour of a maid: +But she is arm'd for him and keeps her guard +In honestest defence. + + + +MARIANA +The gods forbid else! + + + +Widow +So, now they come: +Drum and Colours +Enter BERTRAM, PAROLLES, and the whole army +That is Antonio, the duke's eldest son; +That, Escalus. + + + +HELENA +Which is the Frenchman? + + + +DIANA +He; +That with the plume: 'tis a most gallant fellow. +I would he loved his wife: if he were honester +He were much goodlier: is't not a handsome gentleman? + + + +HELENA +I like him well. + + + +DIANA +'Tis pity he is not honest: yond's that same knave +That leads him to these places: were I his lady, +I would Poison that vile rascal. + + + +HELENA +Which is he? + + + +DIANA +That jack-an-apes with scarfs: why is he melancholy? + + + +HELENA +Perchance he's hurt i' the battle. + + + +PAROLLES +Lose our drum! well. + + + +MARIANA +He's shrewdly vexed at something: look, he has spied us. + + + +Widow +Marry, hang you! + + + +MARIANA +And your courtesy, for a ring-carrier! + + +Exeunt BERTRAM, PAROLLES, and army + + +Widow +The troop is past. Come, pilgrim, I will bring you +Where you shall host: of enjoin'd penitents +There's four or five, to great Saint Jaques bound, +Already at my house. + + + +HELENA +I humbly thank you: +Please it this matron and this gentle maid +To eat with us to-night, the charge and thanking +Shall be for me; and, to requite you further, +I will bestow some precepts of this virgin +Worthy the note. + + + +BOTH +We'll take your offer kindly. + + +Exeunt + + +SCENE VI. Camp before Florence. +Enter BERTRAM and the two French Lords + + +Second Lord +Nay, good my lord, put him to't; let him have his +way. + + + +First Lord +If your lordship find him not a hilding, hold me no +more in your respect. + + + +Second Lord +On my life, my lord, a bubble. + + + +BERTRAM +Do you think I am so far deceived in him? + + + +Second Lord +Believe it, my lord, in mine own direct knowledge, +without any malice, but to speak of him as my +kinsman, he's a most notable coward, an infinite and +endless liar, an hourly promise-breaker, the owner +of no one good quality worthy your lordship's +entertainment. + + + +First Lord +It were fit you knew him; lest, reposing too far in +his virtue, which he hath not, he might at some +great and trusty business in a main danger fail you. + + + +BERTRAM +I would I knew in what particular action to try him. + + + +First Lord +None better than to let him fetch off his drum, +which you hear him so confidently undertake to do. + + + +Second Lord +I, with a troop of Florentines, will suddenly +surprise him; such I will have, whom I am sure he +knows not from the enemy: we will bind and hoodwink +him so, that he shall suppose no other but that he +is carried into the leaguer of the adversaries, when +we bring him to our own tents. Be but your lordship +present at his examination: if he do not, for the +promise of his life and in the highest compulsion of +base fear, offer to betray you and deliver all the +intelligence in his power against you, and that with +the divine forfeit of his soul upon oath, never +trust my judgment in any thing. + + + +First Lord +O, for the love of laughter, let him fetch his drum; +he says he has a stratagem for't: when your +lordship sees the bottom of his success in't, and to +what metal this counterfeit lump of ore will be +melted, if you give him not John Drum's +entertainment, your inclining cannot be removed. +Here he comes. + + +Enter PAROLLES + + +Second Lord +Aside to BERTRAM O, for the love of laughter, +hinder not the honour of his design: let him fetch +off his drum in any hand. + + + +BERTRAM +How now, monsieur! this drum sticks sorely in your +disposition. + + + +First Lord +A pox on't, let it go; 'tis but a drum. + + + +PAROLLES +'But a drum'! is't 'but a drum'? A drum so lost! +There was excellent command,--to charge in with our +horse upon our own wings, and to rend our own soldiers! + + + +First Lord +That was not to be blamed in the command of the +service: it was a disaster of war that Caesar +himself could not have prevented, if he had been +there to command. + + + +BERTRAM +Well, we cannot greatly condemn our success: some +dishonour we had in the loss of that drum; but it is +not to be recovered. + + + +PAROLLES +It might have been recovered. + + + +BERTRAM +It might; but it is not now. + + + +PAROLLES +It is to be recovered: but that the merit of +service is seldom attributed to the true and exact +performer, I would have that drum or another, or +'hic jacet.' + + + +BERTRAM +Why, if you have a stomach, to't, monsieur: if you +think your mystery in stratagem can bring this +instrument of honour again into his native quarter, +be magnanimous in the enterprise and go on; I will +grace the attempt for a worthy exploit: if you +speed well in it, the duke shall both speak of it. +and extend to you what further becomes his +greatness, even to the utmost syllable of your +worthiness. + + + +PAROLLES +By the hand of a soldier, I will undertake it. + + + +BERTRAM +But you must not now slumber in it. + + + +PAROLLES +I'll about it this evening: and I will presently +pen down my dilemmas, encourage myself in my +certainty, put myself into my mortal preparation; +and by midnight look to hear further from me. + + + +BERTRAM +May I be bold to acquaint his grace you are gone about it? + + + +PAROLLES +I know not what the success will be, my lord; but +the attempt I vow. + + + +BERTRAM +I know thou'rt valiant; and, to the possibility of +thy soldiership, will subscribe for thee. Farewell. + + + +PAROLLES +I love not many words. + + +Exit + + +Second Lord +No more than a fish loves water. Is not this a +strange fellow, my lord, that so confidently seems +to undertake this business, which he knows is not to +be done; damns himself to do and dares better be +damned than to do't? + + + +First Lord +You do not know him, my lord, as we do: certain it +is that he will steal himself into a man's favour and +for a week escape a great deal of discoveries; but +when you find him out, you have him ever after. + + + +BERTRAM +Why, do you think he will make no deed at all of +this that so seriously he does address himself unto? + + + +Second Lord +None in the world; but return with an invention and +clap upon you two or three probable lies: but we +have almost embossed him; you shall see his fall +to-night; for indeed he is not for your lordship's respect. + + + +First Lord +We'll make you some sport with the fox ere we case +him. He was first smoked by the old lord Lafeu: +when his disguise and he is parted, tell me what a +sprat you shall find him; which you shall see this +very night. + + + +Second Lord +I must go look my twigs: he shall be caught. + + + +BERTRAM +Your brother he shall go along with me. + + + +Second Lord +As't please your lordship: I'll leave you. + + +Exit + + +BERTRAM +Now will I lead you to the house, and show you +The lass I spoke of. + + + +First Lord +But you say she's honest. + + + +BERTRAM +That's all the fault: I spoke with her but once +And found her wondrous cold; but I sent to her, +By this same coxcomb that we have i' the wind, +Tokens and letters which she did re-send; +And this is all I have done. She's a fair creature: +Will you go see her? + + + +First Lord +With all my heart, my lord. + + +Exeunt + + +SCENE VII. Florence. The Widow's house. +Enter HELENA and Widow + + +HELENA +If you misdoubt me that I am not she, +I know not how I shall assure you further, +But I shall lose the grounds I work upon. + + + +Widow +Though my estate be fallen, I was well born, +Nothing acquainted with these businesses; +And would not put my reputation now +In any staining act. + + + +HELENA +Nor would I wish you. +First, give me trust, the count he is my husband, +And what to your sworn counsel I have spoken +Is so from word to word; and then you cannot, +By the good aid that I of you shall borrow, +Err in bestowing it. + + + +Widow +I should believe you: +For you have show'd me that which well approves +You're great in fortune. + + + +HELENA +Take this purse of gold, +And let me buy your friendly help thus far, +Which I will over-pay and pay again +When I have found it. The count he wooes your daughter, +Lays down his wanton siege before her beauty, +Resolved to carry her: let her in fine consent, +As we'll direct her how 'tis best to bear it. +Now his important blood will nought deny +That she'll demand: a ring the county wears, +That downward hath succeeded in his house +From son to son, some four or five descents +Since the first father wore it: this ring he holds +In most rich choice; yet in his idle fire, +To buy his will, it would not seem too dear, +Howe'er repented after. + + + +Widow +Now I see +The bottom of your purpose. + + + +HELENA +You see it lawful, then: it is no more, +But that your daughter, ere she seems as won, +Desires this ring; appoints him an encounter; +In fine, delivers me to fill the time, +Herself most chastely absent: after this, +To marry her, I'll add three thousand crowns +To what is passed already. + + + +Widow +I have yielded: +Instruct my daughter how she shall persever, +That time and place with this deceit so lawful +May prove coherent. Every night he comes +With musics of all sorts and songs composed +To her unworthiness: it nothing steads us +To chide him from our eaves; for he persists +As if his life lay on't. + + + +HELENA +Why then to-night +Let us assay our plot; which, if it speed, +Is wicked meaning in a lawful deed +And lawful meaning in a lawful act, +Where both not sin, and yet a sinful fact: +But let's about it. + + +Exeunt + + + + +ACT IV + +SCENE I. Without the Florentine camp. +Enter Second French Lord, with five or six other +Soldiers in ambush + + +Second Lord +He can come no other way but by this hedge-corner. +When you sally upon him, speak what terrible +language you will: though you understand it not +yourselves, no matter; for we must not seem to +understand him, unless some one among us whom we +must produce for an interpreter. + + + +First Soldier +Good captain, let me be the interpreter. + + + +Second Lord +Art not acquainted with him? knows he not thy voice? + + + +First Soldier +No, sir, I warrant you. + + + +Second Lord +But what linsey-woolsey hast thou to speak to us again? + + + +First Soldier +E'en such as you speak to me. + + + +Second Lord +He must think us some band of strangers i' the +adversary's entertainment. Now he hath a smack of +all neighbouring languages; therefore we must every +one be a man of his own fancy, not to know what we +speak one to another; so we seem to know, is to +know straight our purpose: choughs' language, +gabble enough, and good enough. As for you, +interpreter, you must seem very politic. But couch, +ho! here he comes, to beguile two hours in a sleep, +and then to return and swear the lies he forges. + + +Enter PAROLLES + + +PAROLLES +Ten o'clock: within these three hours 'twill be +time enough to go home. What shall I say I have +done? It must be a very plausive invention that +carries it: they begin to smoke me; and disgraces +have of late knocked too often at my door. I find +my tongue is too foolhardy; but my heart hath the +fear of Mars before it and of his creatures, not +daring the reports of my tongue. + + + +Second Lord +This is the first truth that e'er thine own tongue +was guilty of. + + + +PAROLLES +What the devil should move me to undertake the +recovery of this drum, being not ignorant of the +impossibility, and knowing I had no such purpose? I +must give myself some hurts, and say I got them in +exploit: yet slight ones will not carry it; they +will say, 'Came you off with so little?' and great +ones I dare not give. Wherefore, what's the +instance? Tongue, I must put you into a +butter-woman's mouth and buy myself another of +Bajazet's mule, if you prattle me into these perils. + + + +Second Lord +Is it possible he should know what he is, and be +that he is? + + + +PAROLLES +I would the cutting of my garments would serve the +turn, or the breaking of my Spanish sword. + + + +Second Lord +We cannot afford you so. + + + +PAROLLES +Or the baring of my beard; and to say it was in +stratagem. + + + +Second Lord +'Twould not do. + + + +PAROLLES +Or to drown my clothes, and say I was stripped. + + + +Second Lord +Hardly serve. + + + +PAROLLES +Though I swore I leaped from the window of the citadel. + + + +Second Lord +How deep? + + + +PAROLLES +Thirty fathom. + + + +Second Lord +Three great oaths would scarce make that be believed. + + + +PAROLLES +I would I had any drum of the enemy's: I would swear +I recovered it. + + + +Second Lord +You shall hear one anon. + + + +PAROLLES +A drum now of the enemy's,-- + + +Alarum within + + +Second Lord +Throca movousus, cargo, cargo, cargo. + + + +All +Cargo, cargo, cargo, villiando par corbo, cargo. + + + +PAROLLES +O, ransom, ransom! do not hide mine eyes. + + +They seize and blindfold him + + +First Soldier +Boskos thromuldo boskos. + + + +PAROLLES +I know you are the Muskos' regiment: +And I shall lose my life for want of language; +If there be here German, or Dane, low Dutch, +Italian, or French, let him speak to me; I'll +Discover that which shall undo the Florentine. + + + +First Soldier +Boskos vauvado: I understand thee, and can speak +thy tongue. Kerely bonto, sir, betake thee to thy +faith, for seventeen poniards are at thy bosom. + + + +PAROLLES +O! + + + +First Soldier +O, pray, pray, pray! Manka revania dulche. + + + +Second Lord +Oscorbidulchos volivorco. + + + +First Soldier +The general is content to spare thee yet; +And, hoodwink'd as thou art, will lead thee on +To gather from thee: haply thou mayst inform +Something to save thy life. + + + +PAROLLES +O, let me live! +And all the secrets of our camp I'll show, +Their force, their purposes; nay, I'll speak that +Which you will wonder at. + + + +First Soldier +But wilt thou faithfully? + + + +PAROLLES +If I do not, damn me. + + + +First Soldier +Acordo linta. +Come on; thou art granted space. + + +Exit, with PAROLLES guarded. A short alarum within + + +Second Lord +Go, tell the Count Rousillon, and my brother, +We have caught the woodcock, and will keep him muffled +Till we do hear from them. + + + +Second Soldier +Captain, I will. + + + +Second Lord +A' will betray us all unto ourselves: +Inform on that. + + + +Second Soldier +So I will, sir. + + + +Second Lord +Till then I'll keep him dark and safely lock'd. + + +Exeunt + + +SCENE II. Florence. The Widow's house. +Enter BERTRAM and DIANA + + +BERTRAM +They told me that your name was Fontibell. + + + +DIANA +No, my good lord, Diana. + + + +BERTRAM +Titled goddess; +And worth it, with addition! But, fair soul, +In your fine frame hath love no quality? +If quick fire of youth light not your mind, +You are no maiden, but a monument: +When you are dead, you should be such a one +As you are now, for you are cold and stem; +And now you should be as your mother was +When your sweet self was got. + + + +DIANA +She then was honest. + + + +BERTRAM +So should you be. + + + +DIANA +No: +My mother did but duty; such, my lord, +As you owe to your wife. + + + +BERTRAM +No more o' that; +I prithee, do not strive against my vows: +I was compell'd to her; but I love thee +By love's own sweet constraint, and will for ever +Do thee all rights of service. + + + +DIANA +Ay, so you serve us +Till we serve you; but when you have our roses, +You barely leave our thorns to prick ourselves +And mock us with our bareness. + + + +BERTRAM +How have I sworn! + + + +DIANA +'Tis not the many oaths that makes the truth, +But the plain single vow that is vow'd true. +What is not holy, that we swear not by, +But take the High'st to witness: then, pray you, tell me, +If I should swear by God's great attributes, +I loved you dearly, would you believe my oaths, +When I did love you ill? This has no holding, +To swear by him whom I protest to love, +That I will work against him: therefore your oaths +Are words and poor conditions, but unseal'd, +At least in my opinion. + + + +BERTRAM +Change it, change it; +Be not so holy-cruel: love is holy; +And my integrity ne'er knew the crafts +That you do charge men with. Stand no more off, +But give thyself unto my sick desires, +Who then recover: say thou art mine, and ever +My love as it begins shall so persever. + + + +DIANA +I see that men make ropes in such a scarre +That we'll forsake ourselves. Give me that ring. + + + +BERTRAM +I'll lend it thee, my dear; but have no power +To give it from me. + + + +DIANA +Will you not, my lord? + + + +BERTRAM +It is an honour 'longing to our house, +Bequeathed down from many ancestors; +Which were the greatest obloquy i' the world +In me to lose. + + + +DIANA +Mine honour's such a ring: +My chastity's the jewel of our house, +Bequeathed down from many ancestors; +Which were the greatest obloquy i' the world +In me to lose: thus your own proper wisdom +Brings in the champion Honour on my part, +Against your vain assault. + + + +BERTRAM +Here, take my ring: +My house, mine honour, yea, my life, be thine, +And I'll be bid by thee. + + + +DIANA +When midnight comes, knock at my chamber-window: +I'll order take my mother shall not hear. +Now will I charge you in the band of truth, +When you have conquer'd my yet maiden bed, +Remain there but an hour, nor speak to me: +My reasons are most strong; and you shall know them +When back again this ring shall be deliver'd: +And on your finger in the night I'll put +Another ring, that what in time proceeds +May token to the future our past deeds. +Adieu, till then; then, fail not. You have won +A wife of me, though there my hope be done. + + + +BERTRAM +A heaven on earth I have won by wooing thee. + + +Exit + + +DIANA +For which live long to thank both heaven and me! +You may so in the end. +My mother told me just how he would woo, +As if she sat in 's heart; she says all men +Have the like oaths: he had sworn to marry me +When his wife's dead; therefore I'll lie with him +When I am buried. Since Frenchmen are so braid, +Marry that will, I live and die a maid: +Only in this disguise I think't no sin +To cozen him that would unjustly win. + + +Exit + + +SCENE III. The Florentine camp. +Enter the two French Lords and some two or three Soldiers + + +First Lord +You have not given him his mother's letter? + + + +Second Lord +I have delivered it an hour since: there is +something in't that stings his nature; for on the +reading it he changed almost into another man. + + + +First Lord +He has much worthy blame laid upon him for shaking +off so good a wife and so sweet a lady. + + + +Second Lord +Especially he hath incurred the everlasting +displeasure of the king, who had even tuned his +bounty to sing happiness to him. I will tell you a +thing, but you shall let it dwell darkly with you. + + + +First Lord +When you have spoken it, 'tis dead, and I am the +grave of it. + + + +Second Lord +He hath perverted a young gentlewoman here in +Florence, of a most chaste renown; and this night he +fleshes his will in the spoil of her honour: he hath +given her his monumental ring, and thinks himself +made in the unchaste composition. + + + +First Lord +Now, God delay our rebellion! as we are ourselves, +what things are we! + + + +Second Lord +Merely our own traitors. And as in the common course +of all treasons, we still see them reveal +themselves, till they attain to their abhorred ends, +so he that in this action contrives against his own +nobility, in his proper stream o'erflows himself. + + + +First Lord +Is it not meant damnable in us, to be trumpeters of +our unlawful intents? We shall not then have his +company to-night? + + + +Second Lord +Not till after midnight; for he is dieted to his hour. + + + +First Lord +That approaches apace; I would gladly have him see +his company anatomized, that he might take a measure +of his own judgments, wherein so curiously he had +set this counterfeit. + + + +Second Lord +We will not meddle with him till he come; for his +presence must be the whip of the other. + + + +First Lord +In the mean time, what hear you of these wars? + + + +Second Lord +I hear there is an overture of peace. + + + +First Lord +Nay, I assure you, a peace concluded. + + + +Second Lord +What will Count Rousillon do then? will he travel +higher, or return again into France? + + + +First Lord +I perceive, by this demand, you are not altogether +of his council. + + + +Second Lord +Let it be forbid, sir; so should I be a great deal +of his act. + + + +First Lord +Sir, his wife some two months since fled from his +house: her pretence is a pilgrimage to Saint Jaques +le Grand; which holy undertaking with most austere +sanctimony she accomplished; and, there residing the +tenderness of her nature became as a prey to her +grief; in fine, made a groan of her last breath, and +now she sings in heaven. + + + +Second Lord +How is this justified? + + + +First Lord +The stronger part of it by her own letters, which +makes her story true, even to the point of her +death: her death itself, which could not be her +office to say is come, was faithfully confirmed by +the rector of the place. + + + +Second Lord +Hath the count all this intelligence? + + + +First Lord +Ay, and the particular confirmations, point from +point, so to the full arming of the verity. + + + +Second Lord +I am heartily sorry that he'll be glad of this. + + + +First Lord +How mightily sometimes we make us comforts of our losses! + + + +Second Lord +And how mightily some other times we drown our gain +in tears! The great dignity that his valour hath +here acquired for him shall at home be encountered +with a shame as ample. + + + +First Lord +The web of our life is of a mingled yarn, good and +ill together: our virtues would be proud, if our +faults whipped them not; and our crimes would +despair, if they were not cherished by our virtues. +Enter a Messenger +How now! where's your master? + + + +Servant +He met the duke in the street, sir, of whom he hath +taken a solemn leave: his lordship will next +morning for France. The duke hath offered him +letters of commendations to the king. + + + +Second Lord +They shall be no more than needful there, if they +were more than they can commend. + + + +First Lord +They cannot be too sweet for the king's tartness. +Here's his lordship now. +Enter BERTRAM +How now, my lord! is't not after midnight? + + + +BERTRAM +I have to-night dispatched sixteen businesses, a +month's length a-piece, by an abstract of success: +I have congied with the duke, done my adieu with his +nearest; buried a wife, mourned for her; writ to my +lady mother I am returning; entertained my convoy; +and between these main parcels of dispatch effected +many nicer needs; the last was the greatest, but +that I have not ended yet. + + + +Second Lord +If the business be of any difficulty, and this +morning your departure hence, it requires haste of +your lordship. + + + +BERTRAM +I mean, the business is not ended, as fearing to +hear of it hereafter. But shall we have this +dialogue between the fool and the soldier? Come, +bring forth this counterfeit module, he has deceived +me, like a double-meaning prophesier. + + + +Second Lord +Bring him forth: has sat i' the stocks all night, +poor gallant knave. + + + +BERTRAM +No matter: his heels have deserved it, in usurping +his spurs so long. How does he carry himself? + + + +Second Lord +I have told your lordship already, the stocks carry +him. But to answer you as you would be understood; +he weeps like a wench that had shed her milk: he +hath confessed himself to Morgan, whom he supposes +to be a friar, from the time of his remembrance to +this very instant disaster of his setting i' the +stocks: and what think you he hath confessed? + + + +BERTRAM +Nothing of me, has a'? + + + +Second Lord +His confession is taken, and it shall be read to his +face: if your lordship be in't, as I believe you +are, you must have the patience to hear it. + + +Enter PAROLLES guarded, and First Soldier + + +BERTRAM +A plague upon him! muffled! he can say nothing of +me: hush, hush! + + + +First Lord +Hoodman comes! Portotartarosa + + + +First Soldier +He calls for the tortures: what will you say +without 'em? + + + +PAROLLES +I will confess what I know without constraint: if +ye pinch me like a pasty, I can say no more. + + + +First Soldier +Bosko chimurcho. + + + +First Lord +Boblibindo chicurmurco. + + + +First Soldier +You are a merciful general. Our general bids you +answer to what I shall ask you out of a note. + + + +PAROLLES +And truly, as I hope to live. + + + +First Soldier +Reads 'First demand of him how many horse the +duke is strong.' What say you to that? + + + +PAROLLES +Five or six thousand; but very weak and +unserviceable: the troops are all scattered, and +the commanders very poor rogues, upon my reputation +and credit and as I hope to live. + + + +First Soldier +Shall I set down your answer so? + + + +PAROLLES +Do: I'll take the sacrament on't, how and which way you will. + + + +BERTRAM +All's one to him. What a past-saving slave is this! + + + +First Lord +You're deceived, my lord: this is Monsieur +Parolles, the gallant militarist,--that was his own +phrase,--that had the whole theoric of war in the +knot of his scarf, and the practise in the chape of +his dagger. + + + +Second Lord +I will never trust a man again for keeping his sword +clean. nor believe he can have every thing in him +by wearing his apparel neatly. + + + +First Soldier +Well, that's set down. + + + +PAROLLES +Five or six thousand horse, I said,-- I will say +true,--or thereabouts, set down, for I'll speak truth. + + + +First Lord +He's very near the truth in this. + + + +BERTRAM +But I con him no thanks for't, in the nature he +delivers it. + + + +PAROLLES +Poor rogues, I pray you, say. + + + +First Soldier +Well, that's set down. + + + +PAROLLES +I humbly thank you, sir: a truth's a truth, the +rogues are marvellous poor. + + + +First Soldier +Reads 'Demand of him, of what strength they are +a-foot.' What say you to that? + + + +PAROLLES +By my troth, sir, if I were to live this present +hour, I will tell true. Let me see: Spurio, a +hundred and fifty; Sebastian, so many; Corambus, so +many; Jaques, so many; Guiltian, Cosmo, Lodowick, +and Gratii, two hundred and fifty each; mine own +company, Chitopher, Vaumond, Bentii, two hundred and +fifty each: so that the muster-file, rotten and +sound, upon my life, amounts not to fifteen thousand +poll; half of the which dare not shake snow from off +their cassocks, lest they shake themselves to pieces. + + + +BERTRAM +What shall be done to him? + + + +First Lord +Nothing, but let him have thanks. Demand of him my +condition, and what credit I have with the duke. + + + +First Soldier +Well, that's set down. +Reads +'You shall demand of him, whether one Captain Dumain +be i' the camp, a Frenchman; what his reputation is +with the duke; what his valour, honesty, and +expertness in wars; or whether he thinks it were not +possible, with well-weighing sums of gold, to +corrupt him to revolt.' What say you to this? what +do you know of it? + + + +PAROLLES +I beseech you, let me answer to the particular of +the inter'gatories: demand them singly. + + + +First Soldier +Do you know this Captain Dumain? + + + +PAROLLES +I know him: a' was a botcher's 'prentice in Paris, +from whence he was whipped for getting the shrieve's +fool with child,--a dumb innocent, that could not +say him nay. + + + +BERTRAM +Nay, by your leave, hold your hands; though I know +his brains are forfeit to the next tile that falls. + + + +First Soldier +Well, is this captain in the duke of Florence's camp? + + + +PAROLLES +Upon my knowledge, he is, and lousy. + + + +First Lord +Nay look not so upon me; we shall hear of your +lordship anon. + + + +First Soldier +What is his reputation with the duke? + + + +PAROLLES +The duke knows him for no other but a poor officer +of mine; and writ to me this other day to turn him +out o' the band: I think I have his letter in my pocket. + + + +First Soldier +Marry, we'll search. + + + +PAROLLES +In good sadness, I do not know; either it is there, +or it is upon a file with the duke's other letters +in my tent. + + + +First Soldier +Here 'tis; here's a paper: shall I read it to you? + + + +PAROLLES +I do not know if it be it or no. + + + +BERTRAM +Our interpreter does it well. + + + +First Lord +Excellently. + + + +First Soldier +Reads 'Dian, the count's a fool, and full of gold,'-- + + + +PAROLLES +That is not the duke's letter, sir; that is an +advertisement to a proper maid in Florence, one +Diana, to take heed of the allurement of one Count +Rousillon, a foolish idle boy, but for all that very +ruttish: I pray you, sir, put it up again. + + + +First Soldier +Nay, I'll read it first, by your favour. + + + +PAROLLES +My meaning in't, I protest, was very honest in the +behalf of the maid; for I knew the young count to be +a dangerous and lascivious boy, who is a whale to +virginity and devours up all the fry it finds. + + + +BERTRAM +Damnable both-sides rogue! + + + +First Soldier +Reads 'When he swears oaths, bid him drop gold, and take it; +After he scores, he never pays the score: +Half won is match well made; match, and well make it; +He ne'er pays after-debts, take it before; +And say a soldier, Dian, told thee this, +Men are to mell with, boys are not to kiss: +For count of this, the count's a fool, I know it, +Who pays before, but not when he does owe it. +Thine, as he vowed to thee in thine ear, +PAROLLES.' + + + +BERTRAM +He shall be whipped through the army with this rhyme +in's forehead. + + + +Second Lord +This is your devoted friend, sir, the manifold +linguist and the armipotent soldier. + + + +BERTRAM +I could endure any thing before but a cat, and now +he's a cat to me. + + + +First Soldier +I perceive, sir, by the general's looks, we shall be +fain to hang you. + + + +PAROLLES +My life, sir, in any case: not that I am afraid to +die; but that, my offences being many, I would +repent out the remainder of nature: let me live, +sir, in a dungeon, i' the stocks, or any where, so I may live. + + + +First Soldier +We'll see what may be done, so you confess freely; +therefore, once more to this Captain Dumain: you +have answered to his reputation with the duke and to +his valour: what is his honesty? + + + +PAROLLES +He will steal, sir, an egg out of a cloister: for +rapes and ravishments he parallels Nessus: he +professes not keeping of oaths; in breaking 'em he +is stronger than Hercules: he will lie, sir, with +such volubility, that you would think truth were a +fool: drunkenness is his best virtue, for he will +be swine-drunk; and in his sleep he does little +harm, save to his bed-clothes about him; but they +know his conditions and lay him in straw. I have but +little more to say, sir, of his honesty: he has +every thing that an honest man should not have; what +an honest man should have, he has nothing. + + + +First Lord +I begin to love him for this. + + + +BERTRAM +For this description of thine honesty? A pox upon +him for me, he's more and more a cat. + + + +First Soldier +What say you to his expertness in war? + + + +PAROLLES +Faith, sir, he has led the drum before the English +tragedians; to belie him, I will not, and more of +his soldiership I know not; except, in that country +he had the honour to be the officer at a place there +called Mile-end, to instruct for the doubling of +files: I would do the man what honour I can, but of +this I am not certain. + + + +First Lord +He hath out-villained villany so far, that the +rarity redeems him. + + + +BERTRAM +A pox on him, he's a cat still. + + + +First Soldier +His qualities being at this poor price, I need not +to ask you if gold will corrupt him to revolt. + + + +PAROLLES +Sir, for a quart d'ecu he will sell the fee-simple +of his salvation, the inheritance of it; and cut the +entail from all remainders, and a perpetual +succession for it perpetually. + + + +First Soldier +What's his brother, the other Captain Dumain? + + + +Second Lord +Why does be ask him of me? + + + +First Soldier +What's he? + + + +PAROLLES +E'en a crow o' the same nest; not altogether so +great as the first in goodness, but greater a great +deal in evil: he excels his brother for a coward, +yet his brother is reputed one of the best that is: +in a retreat he outruns any lackey; marry, in coming +on he has the cramp. + + + +First Soldier +If your life be saved, will you undertake to betray +the Florentine? + + + +PAROLLES +Ay, and the captain of his horse, Count Rousillon. + + + +First Soldier +I'll whisper with the general, and know his pleasure. + + + +PAROLLES +Aside I'll no more drumming; a plague of all +drums! Only to seem to deserve well, and to +beguile the supposition of that lascivious young boy +the count, have I run into this danger. Yet who +would have suspected an ambush where I was taken? + + + +First Soldier +There is no remedy, sir, but you must die: the +general says, you that have so traitorously +discovered the secrets of your army and made such +pestiferous reports of men very nobly held, can +serve the world for no honest use; therefore you +must die. Come, headsman, off with his head. + + + +PAROLLES +O Lord, sir, let me live, or let me see my death! + + + +First Lord +That shall you, and take your leave of all your friends. +Unblinding him +So, look about you: know you any here? + + + +BERTRAM +Good morrow, noble captain. + + + +Second Lord +God bless you, Captain Parolles. + + + +First Lord +God save you, noble captain. + + + +Second Lord +Captain, what greeting will you to my Lord Lafeu? +I am for France. + + + +First Lord +Good captain, will you give me a copy of the sonnet +you writ to Diana in behalf of the Count Rousillon? +an I were not a very coward, I'ld compel it of you: +but fare you well. + + +Exeunt BERTRAM and Lords + + +First Soldier +You are undone, captain, all but your scarf; that +has a knot on't yet + + + +PAROLLES +Who cannot be crushed with a plot? + + + +First Soldier +If you could find out a country where but women were +that had received so much shame, you might begin an +impudent nation. Fare ye well, sir; I am for France +too: we shall speak of you there. + + +Exit with Soldiers + + +PAROLLES +Yet am I thankful: if my heart were great, +'Twould burst at this. Captain I'll be no more; +But I will eat and drink, and sleep as soft +As captain shall: simply the thing I am +Shall make me live. Who knows himself a braggart, +Let him fear this, for it will come to pass +that every braggart shall be found an ass. +Rust, sword? cool, blushes! and, Parolles, live +Safest in shame! being fool'd, by foolery thrive! +There's place and means for every man alive. +I'll after them. + + +Exit + + +SCENE IV. Florence. The Widow's house. +Enter HELENA, Widow, and DIANA + + +HELENA +That you may well perceive I have not wrong'd you, +One of the greatest in the Christian world +Shall be my surety; 'fore whose throne 'tis needful, +Ere I can perfect mine intents, to kneel: +Time was, I did him a desired office, +Dear almost as his life; which gratitude +Through flinty Tartar's bosom would peep forth, +And answer, thanks: I duly am inform'd +His grace is at Marseilles; to which place +We have convenient convoy. You must know +I am supposed dead: the army breaking, +My husband hies him home; where, heaven aiding, +And by the leave of my good lord the king, +We'll be before our welcome. + + + +Widow +Gentle madam, +You never had a servant to whose trust +Your business was more welcome. + + + +HELENA +Nor you, mistress, +Ever a friend whose thoughts more truly labour +To recompense your love: doubt not but heaven +Hath brought me up to be your daughter's dower, +As it hath fated her to be my motive +And helper to a husband. But, O strange men! +That can such sweet use make of what they hate, +When saucy trusting of the cozen'd thoughts +Defiles the pitchy night: so lust doth play +With what it loathes for that which is away. +But more of this hereafter. You, Diana, +Under my poor instructions yet must suffer +Something in my behalf. + + + +DIANA +Let death and honesty +Go with your impositions, I am yours +Upon your will to suffer. + + + +HELENA +Yet, I pray you: +But with the word the time will bring on summer, +When briers shall have leaves as well as thorns, +And be as sweet as sharp. We must away; +Our wagon is prepared, and time revives us: +All's well that ends well; still the fine's the crown; +Whate'er the course, the end is the renown. + + +Exeunt + + +SCENE V. Rousillon. The COUNT's palace. +Enter COUNTESS, LAFEU, and Clown + + +LAFEU +No, no, no, your son was misled with a snipt-taffeta +fellow there, whose villanous saffron would have +made all the unbaked and doughy youth of a nation in +his colour: your daughter-in-law had been alive at +this hour, and your son here at home, more advanced +by the king than by that red-tailed humble-bee I speak of. + + + +COUNTESS +I would I had not known him; it was the death of the +most virtuous gentlewoman that ever nature had +praise for creating. If she had partaken of my +flesh, and cost me the dearest groans of a mother, I +could not have owed her a more rooted love. + + + +LAFEU +'Twas a good lady, 'twas a good lady: we may pick a +thousand salads ere we light on such another herb. + + + +Clown +Indeed, sir, she was the sweet marjoram of the +salad, or rather, the herb of grace. + + + +LAFEU +They are not herbs, you knave; they are nose-herbs. + + + +Clown +I am no great Nebuchadnezzar, sir; I have not much +skill in grass. + + + +LAFEU +Whether dost thou profess thyself, a knave or a fool? + + + +Clown +A fool, sir, at a woman's service, and a knave at a man's. + + + +LAFEU +Your distinction? + + + +Clown +I would cozen the man of his wife and do his service. + + + +LAFEU +So you were a knave at his service, indeed. + + + +Clown +And I would give his wife my bauble, sir, to do her service. + + + +LAFEU +I will subscribe for thee, thou art both knave and fool. + + + +Clown +At your service. + + + +LAFEU +No, no, no. + + + +Clown +Why, sir, if I cannot serve you, I can serve as +great a prince as you are. + + + +LAFEU +Who's that? a Frenchman? + + + +Clown +Faith, sir, a' has an English name; but his fisnomy +is more hotter in France than there. + + + +LAFEU +What prince is that? + + + +Clown +The black prince, sir; alias, the prince of +darkness; alias, the devil. + + + +LAFEU +Hold thee, there's my purse: I give thee not this +to suggest thee from thy master thou talkest of; +serve him still. + + + +Clown +I am a woodland fellow, sir, that always loved a +great fire; and the master I speak of ever keeps a +good fire. But, sure, he is the prince of the +world; let his nobility remain in's court. I am for +the house with the narrow gate, which I take to be +too little for pomp to enter: some that humble +themselves may; but the many will be too chill and +tender, and they'll be for the flowery way that +leads to the broad gate and the great fire. + + + +LAFEU +Go thy ways, I begin to be aweary of thee; and I +tell thee so before, because I would not fall out +with thee. Go thy ways: let my horses be well +looked to, without any tricks. + + + +Clown +If I put any tricks upon 'em, sir, they shall be +jades' tricks; which are their own right by the law of nature. + + +Exit + + +LAFEU +A shrewd knave and an unhappy. + + + +COUNTESS +So he is. My lord that's gone made himself much +sport out of him: by his authority he remains here, +which he thinks is a patent for his sauciness; and, +indeed, he has no pace, but runs where he will. + + + +LAFEU +I like him well; 'tis not amiss. And I was about to +tell you, since I heard of the good lady's death and +that my lord your son was upon his return home, I +moved the king my master to speak in the behalf of +my daughter; which, in the minority of them both, +his majesty, out of a self-gracious remembrance, did +first propose: his highness hath promised me to do +it: and, to stop up the displeasure he hath +conceived against your son, there is no fitter +matter. How does your ladyship like it? + + + +COUNTESS +With very much content, my lord; and I wish it +happily effected. + + + +LAFEU +His highness comes post from Marseilles, of as able +body as when he numbered thirty: he will be here +to-morrow, or I am deceived by him that in such +intelligence hath seldom failed. + + + +COUNTESS +It rejoices me, that I hope I shall see him ere I +die. I have letters that my son will be here +to-night: I shall beseech your lordship to remain +with me till they meet together. + + + +LAFEU +Madam, I was thinking with what manners I might +safely be admitted. + + + +COUNTESS +You need but plead your honourable privilege. + + + +LAFEU +Lady, of that I have made a bold charter; but I +thank my God it holds yet. + + +Re-enter Clown + + +Clown +O madam, yonder's my lord your son with a patch of +velvet on's face: whether there be a scar under't +or no, the velvet knows; but 'tis a goodly patch of +velvet: his left cheek is a cheek of two pile and a +half, but his right cheek is worn bare. + + + +LAFEU +A scar nobly got, or a noble scar, is a good livery +of honour; so belike is that. + + + +Clown +But it is your carbonadoed face. + + + +LAFEU +Let us go see your son, I pray you: I long to talk +with the young noble soldier. + + + +Clown +Faith there's a dozen of 'em, with delicate fine +hats and most courteous feathers, which bow the head +and nod at every man. + + +Exeunt + + + + +ACT V + +SCENE I. Marseilles. A street. +Enter HELENA, Widow, and DIANA, with two +Attendants + + +HELENA +But this exceeding posting day and night +Must wear your spirits low; we cannot help it: +But since you have made the days and nights as one, +To wear your gentle limbs in my affairs, +Be bold you do so grow in my requital +As nothing can unroot you. In happy time; +Enter a Gentleman +This man may help me to his majesty's ear, +If he would spend his power. God save you, sir. + + + +Gentleman +And you. + + + +HELENA +Sir, I have seen you in the court of France. + + + +Gentleman +I have been sometimes there. + + + +HELENA +I do presume, sir, that you are not fallen +From the report that goes upon your goodness; +An therefore, goaded with most sharp occasions, +Which lay nice manners by, I put you to +The use of your own virtues, for the which +I shall continue thankful. + + + +Gentleman +What's your will? + + + +HELENA +That it will please you +To give this poor petition to the king, +And aid me with that store of power you have +To come into his presence. + + + +Gentleman +The king's not here. + + + +HELENA +Not here, sir! + + + +Gentleman +Not, indeed: +He hence removed last night and with more haste +Than is his use. + + + +Widow +Lord, how we lose our pains! + + + +HELENA +All's well that ends well yet, +Though time seem so adverse and means unfit. +I do beseech you, whither is he gone? + + + +Gentleman +Marry, as I take it, to Rousillon; +Whither I am going. + + + +HELENA +I do beseech you, sir, +Since you are like to see the king before me, +Commend the paper to his gracious hand, +Which I presume shall render you no blame +But rather make you thank your pains for it. +I will come after you with what good speed +Our means will make us means. + + + +Gentleman +This I'll do for you. + + + +HELENA +And you shall find yourself to be well thank'd, +Whate'er falls more. We must to horse again. +Go, go, provide. + + +Exeunt + + +SCENE II. Rousillon. Before the COUNT's palace. +Enter Clown, and PAROLLES, following + + +PAROLLES +Good Monsieur Lavache, give my Lord Lafeu this +letter: I have ere now, sir, been better known to +you, when I have held familiarity with fresher +clothes; but I am now, sir, muddied in fortune's +mood, and smell somewhat strong of her strong +displeasure. + + + +Clown +Truly, fortune's displeasure is but sluttish, if it +smell so strongly as thou speakest of: I will +henceforth eat no fish of fortune's buttering. +Prithee, allow the wind. + + + +PAROLLES +Nay, you need not to stop your nose, sir; I spake +but by a metaphor. + + + +Clown +Indeed, sir, if your metaphor stink, I will stop my +nose; or against any man's metaphor. Prithee, get +thee further. + + + +PAROLLES +Pray you, sir, deliver me this paper. + + + +Clown +Foh! prithee, stand away: a paper from fortune's +close-stool to give to a nobleman! Look, here he +comes himself. +Enter LAFEU +Here is a purr of fortune's, sir, or of fortune's +cat,--but not a musk-cat,--that has fallen into the +unclean fishpond of her displeasure, and, as he +says, is muddied withal: pray you, sir, use the +carp as you may; for he looks like a poor, decayed, +ingenious, foolish, rascally knave. I do pity his +distress in my similes of comfort and leave him to +your lordship. + + +Exit + + +PAROLLES +My lord, I am a man whom fortune hath cruelly +scratched. + + + +LAFEU +And what would you have me to do? 'Tis too late to +pare her nails now. Wherein have you played the +knave with fortune, that she should scratch you, who +of herself is a good lady and would not have knaves +thrive long under her? There's a quart d'ecu for +you: let the justices make you and fortune friends: +I am for other business. + + + +PAROLLES +I beseech your honour to hear me one single word. + + + +LAFEU +You beg a single penny more: come, you shall ha't; +save your word. + + + +PAROLLES +My name, my good lord, is Parolles. + + + +LAFEU +You beg more than 'word,' then. Cox my passion! +give me your hand. How does your drum? + + + +PAROLLES +O my good lord, you were the first that found me! + + + +LAFEU +Was I, in sooth? and I was the first that lost thee. + + + +PAROLLES +It lies in you, my lord, to bring me in some grace, +for you did bring me out. + + + +LAFEU +Out upon thee, knave! dost thou put upon me at once +both the office of God and the devil? One brings +thee in grace and the other brings thee out. +Trumpets sound +The king's coming; I know by his trumpets. Sirrah, +inquire further after me; I had talk of you last +night: though you are a fool and a knave, you shall +eat; go to, follow. + + + +PAROLLES +I praise God for you. + + +Exeunt + + +SCENE III. Rousillon. The COUNT's palace. +Flourish. Enter KING, COUNTESS, LAFEU, the two +French Lords, with Attendants + + +KING +We lost a jewel of her; and our esteem +Was made much poorer by it: but your son, +As mad in folly, lack'd the sense to know +Her estimation home. + + + +COUNTESS +'Tis past, my liege; +And I beseech your majesty to make it +Natural rebellion, done i' the blaze of youth; +When oil and fire, too strong for reason's force, +O'erbears it and burns on. + + + +KING +My honour'd lady, +I have forgiven and forgotten all; +Though my revenges were high bent upon him, +And watch'd the time to shoot. + + + +LAFEU +This I must say, +But first I beg my pardon, the young lord +Did to his majesty, his mother and his lady +Offence of mighty note; but to himself +The greatest wrong of all. He lost a wife +Whose beauty did astonish the survey +Of richest eyes, whose words all ears took captive, +Whose dear perfection hearts that scorn'd to serve +Humbly call'd mistress. + + + +KING +Praising what is lost +Makes the remembrance dear. Well, call him hither; +We are reconciled, and the first view shall kill +All repetition: let him not ask our pardon; +The nature of his great offence is dead, +And deeper than oblivion we do bury +The incensing relics of it: let him approach, +A stranger, no offender; and inform him +So 'tis our will he should. + + + +Gentleman +I shall, my liege. + + +Exit + + +KING +What says he to your daughter? have you spoke? + + + +LAFEU +All that he is hath reference to your highness. + + + +KING +Then shall we have a match. I have letters sent me +That set him high in fame. + + +Enter BERTRAM + + +LAFEU +He looks well on't. + + + +KING +I am not a day of season, +For thou mayst see a sunshine and a hail +In me at once: but to the brightest beams +Distracted clouds give way; so stand thou forth; +The time is fair again. + + + +BERTRAM +My high-repented blames, +Dear sovereign, pardon to me. + + + +KING +All is whole; +Not one word more of the consumed time. +Let's take the instant by the forward top; +For we are old, and on our quick'st decrees +The inaudible and noiseless foot of Time +Steals ere we can effect them. You remember +The daughter of this lord? + + + +BERTRAM +Admiringly, my liege, at first +I stuck my choice upon her, ere my heart +Durst make too bold a herald of my tongue +Where the impression of mine eye infixing, +Contempt his scornful perspective did lend me, +Which warp'd the line of every other favour; +Scorn'd a fair colour, or express'd it stolen; +Extended or contracted all proportions +To a most hideous object: thence it came +That she whom all men praised and whom myself, +Since I have lost, have loved, was in mine eye +The dust that did offend it. + + + +KING +Well excused: +That thou didst love her, strikes some scores away +From the great compt: but love that comes too late, +Like a remorseful pardon slowly carried, +To the great sender turns a sour offence, +Crying, 'That's good that's gone.' Our rash faults +Make trivial price of serious things we have, +Not knowing them until we know their grave: +Oft our displeasures, to ourselves unjust, +Destroy our friends and after weep their dust +Our own love waking cries to see what's done, +While shame full late sleeps out the afternoon. +Be this sweet Helen's knell, and now forget her. +Send forth your amorous token for fair Maudlin: +The main consents are had; and here we'll stay +To see our widower's second marriage-day. + + + +COUNTESS +Which better than the first, O dear heaven, bless! +Or, ere they meet, in me, O nature, cesse! + + + +LAFEU +Come on, my son, in whom my house's name +Must be digested, give a favour from you +To sparkle in the spirits of my daughter, +That she may quickly come. +BERTRAM gives a ring +By my old beard, +And every hair that's on't, Helen, that's dead, +Was a sweet creature: such a ring as this, +The last that e'er I took her at court, +I saw upon her finger. + + + +BERTRAM +Hers it was not. + + + +KING +Now, pray you, let me see it; for mine eye, +While I was speaking, oft was fasten'd to't. +This ring was mine; and, when I gave it Helen, +I bade her, if her fortunes ever stood +Necessitied to help, that by this token +I would relieve her. Had you that craft, to reave +her +Of what should stead her most? + + + +BERTRAM +My gracious sovereign, +Howe'er it pleases you to take it so, +The ring was never hers. + + + +COUNTESS +Son, on my life, +I have seen her wear it; and she reckon'd it +At her life's rate. + + + +LAFEU +I am sure I saw her wear it. + + + +BERTRAM +You are deceived, my lord; she never saw it: +In Florence was it from a casement thrown me, +Wrapp'd in a paper, which contain'd the name +Of her that threw it: noble she was, and thought +I stood engaged: but when I had subscribed +To mine own fortune and inform'd her fully +I could not answer in that course of honour +As she had made the overture, she ceased +In heavy satisfaction and would never +Receive the ring again. + + + +KING +Plutus himself, +That knows the tinct and multiplying medicine, +Hath not in nature's mystery more science +Than I have in this ring: 'twas mine, 'twas Helen's, +Whoever gave it you. Then, if you know +That you are well acquainted with yourself, +Confess 'twas hers, and by what rough enforcement +You got it from her: she call'd the saints to surety +That she would never put it from her finger, +Unless she gave it to yourself in bed, +Where you have never come, or sent it us +Upon her great disaster. + + + +BERTRAM +She never saw it. + + + +KING +Thou speak'st it falsely, as I love mine honour; +And makest conjectural fears to come into me +Which I would fain shut out. If it should prove +That thou art so inhuman,--'twill not prove so;-- +And yet I know not: thou didst hate her deadly, +And she is dead; which nothing, but to close +Her eyes myself, could win me to believe, +More than to see this ring. Take him away. +Guards seize BERTRAM +My fore-past proofs, howe'er the matter fall, +Shall tax my fears of little vanity, +Having vainly fear'd too little. Away with him! +We'll sift this matter further. + + + +BERTRAM +If you shall prove +This ring was ever hers, you shall as easy +Prove that I husbanded her bed in Florence, +Where yet she never was. + + +Exit, guarded + + +KING +I am wrapp'd in dismal thinkings. + + +Enter a Gentleman + + +Gentleman +Gracious sovereign, +Whether I have been to blame or no, I know not: +Here's a petition from a Florentine, +Who hath for four or five removes come short +To tender it herself. I undertook it, +Vanquish'd thereto by the fair grace and speech +Of the poor suppliant, who by this I know +Is here attending: her business looks in her +With an importing visage; and she told me, +In a sweet verbal brief, it did concern +Your highness with herself. + + + +KING +Reads Upon his many protestations to marry me +when his wife was dead, I blush to say it, he won +me. Now is the Count Rousillon a widower: his vows +are forfeited to me, and my honour's paid to him. He +stole from Florence, taking no leave, and I follow +him to his country for justice: grant it me, O +king! in you it best lies; otherwise a seducer +flourishes, and a poor maid is undone. +DIANA CAPILET. + + + +LAFEU +I will buy me a son-in-law in a fair, and toll for +this: I'll none of him. + + + +KING +The heavens have thought well on thee Lafeu, +To bring forth this discovery. Seek these suitors: +Go speedily and bring again the count. +I am afeard the life of Helen, lady, +Was foully snatch'd. + + + +COUNTESS +Now, justice on the doers! + + +Re-enter BERTRAM, guarded + + +KING +I wonder, sir, sith wives are monsters to you, +And that you fly them as you swear them lordship, +Yet you desire to marry. +Enter Widow and DIANA +What woman's that? + + + +DIANA +I am, my lord, a wretched Florentine, +Derived from the ancient Capilet: +My suit, as I do understand, you know, +And therefore know how far I may be pitied. + + + +Widow +I am her mother, sir, whose age and honour +Both suffer under this complaint we bring, +And both shall cease, without your remedy. + + + +KING +Come hither, count; do you know these women? + + + +BERTRAM +My lord, I neither can nor will deny +But that I know them: do they charge me further? + + + +DIANA +Why do you look so strange upon your wife? + + + +BERTRAM +She's none of mine, my lord. + + + +DIANA +If you shall marry, +You give away this hand, and that is mine; +You give away heaven's vows, and those are mine; +You give away myself, which is known mine; +For I by vow am so embodied yours, +That she which marries you must marry me, +Either both or none. + + + +LAFEU +Your reputation comes too short for my daughter; you +are no husband for her. + + + +BERTRAM +My lord, this is a fond and desperate creature, +Whom sometime I have laugh'd with: let your highness +Lay a more noble thought upon mine honour +Than for to think that I would sink it here. + + + +KING +Sir, for my thoughts, you have them ill to friend +Till your deeds gain them: fairer prove your honour +Than in my thought it lies. + + + +DIANA +Good my lord, +Ask him upon his oath, if he does think +He had not my virginity. + + + +KING +What say'st thou to her? + + + +BERTRAM +She's impudent, my lord, +And was a common gamester to the camp. + + + +DIANA +He does me wrong, my lord; if I were so, +He might have bought me at a common price: +Do not believe him. O, behold this ring, +Whose high respect and rich validity +Did lack a parallel; yet for all that +He gave it to a commoner o' the camp, +If I be one. + + + +COUNTESS +He blushes, and 'tis it: +Of six preceding ancestors, that gem, +Conferr'd by testament to the sequent issue, +Hath it been owed and worn. This is his wife; +That ring's a thousand proofs. + + + +KING +Methought you said +You saw one here in court could witness it. + + + +DIANA +I did, my lord, but loath am to produce +So bad an instrument: his name's Parolles. + + + +LAFEU +I saw the man to-day, if man he be. + + + +KING +Find him, and bring him hither. + + +Exit an Attendant + + +BERTRAM +What of him? +He's quoted for a most perfidious slave, +With all the spots o' the world tax'd and debosh'd; +Whose nature sickens but to speak a truth. +Am I or that or this for what he'll utter, +That will speak any thing? + + + +KING +She hath that ring of yours. + + + +BERTRAM +I think she has: certain it is I liked her, +And boarded her i' the wanton way of youth: +She knew her distance and did angle for me, +Madding my eagerness with her restraint, +As all impediments in fancy's course +Are motives of more fancy; and, in fine, +Her infinite cunning, with her modern grace, +Subdued me to her rate: she got the ring; +And I had that which any inferior might +At market-price have bought. + + + +DIANA +I must be patient: +You, that have turn'd off a first so noble wife, +May justly diet me. I pray you yet; +Since you lack virtue, I will lose a husband; +Send for your ring, I will return it home, +And give me mine again. + + + +BERTRAM +I have it not. + + + +KING +What ring was yours, I pray you? + + + +DIANA +Sir, much like +The same upon your finger. + + + +KING +Know you this ring? this ring was his of late. + + + +DIANA +And this was it I gave him, being abed. + + + +KING +The story then goes false, you threw it him +Out of a casement. + + + +DIANA +I have spoke the truth. + + +Enter PAROLLES + + +BERTRAM +My lord, I do confess the ring was hers. + + + +KING +You boggle shrewdly, every feather stars you. +Is this the man you speak of? + + + +DIANA +Ay, my lord. + + + +KING +Tell me, sirrah, but tell me true, I charge you, +Not fearing the displeasure of your master, +Which on your just proceeding I'll keep off, +By him and by this woman here what know you? + + + +PAROLLES +So please your majesty, my master hath been an +honourable gentleman: tricks he hath had in him, +which gentlemen have. + + + +KING +Come, come, to the purpose: did he love this woman? + + + +PAROLLES +Faith, sir, he did love her; but how? + + + +KING +How, I pray you? + + + +PAROLLES +He did love her, sir, as a gentleman loves a woman. + + + +KING +How is that? + + + +PAROLLES +He loved her, sir, and loved her not. + + + +KING +As thou art a knave, and no knave. What an +equivocal companion is this! + + + +PAROLLES +I am a poor man, and at your majesty's command. + + + +LAFEU +He's a good drum, my lord, but a naughty orator. + + + +DIANA +Do you know he promised me marriage? + + + +PAROLLES +Faith, I know more than I'll speak. + + + +KING +But wilt thou not speak all thou knowest? + + + +PAROLLES +Yes, so please your majesty. I did go between them, +as I said; but more than that, he loved her: for +indeed he was mad for her, and talked of Satan and +of Limbo and of Furies and I know not what: yet I +was in that credit with them at that time that I +knew of their going to bed, and of other motions, +as promising her marriage, and things which would +derive me ill will to speak of; therefore I will not +speak what I know. + + + +KING +Thou hast spoken all already, unless thou canst say +they are married: but thou art too fine in thy +evidence; therefore stand aside. +This ring, you say, was yours? + + + +DIANA +Ay, my good lord. + + + +KING +Where did you buy it? or who gave it you? + + + +DIANA +It was not given me, nor I did not buy it. + + + +KING +Who lent it you? + + + +DIANA +It was not lent me neither. + + + +KING +Where did you find it, then? + + + +DIANA +I found it not. + + + +KING +If it were yours by none of all these ways, +How could you give it him? + + + +DIANA +I never gave it him. + + + +LAFEU +This woman's an easy glove, my lord; she goes off +and on at pleasure. + + + +KING +This ring was mine; I gave it his first wife. + + + +DIANA +It might be yours or hers, for aught I know. + + + +KING +Take her away; I do not like her now; +To prison with her: and away with him. +Unless thou tell'st me where thou hadst this ring, +Thou diest within this hour. + + + +DIANA +I'll never tell you. + + + +KING +Take her away. + + + +DIANA +I'll put in bail, my liege. + + + +KING +I think thee now some common customer. + + + +DIANA +By Jove, if ever I knew man, 'twas you. + + + +KING +Wherefore hast thou accused him all this while? + + + +DIANA +Because he's guilty, and he is not guilty: +He knows I am no maid, and he'll swear to't; +I'll swear I am a maid, and he knows not. +Great king, I am no strumpet, by my life; +I am either maid, or else this old man's wife. + + + +KING +She does abuse our ears: to prison with her. + + + +DIANA +Good mother, fetch my bail. Stay, royal sir: +Exit Widow +The jeweller that owes the ring is sent for, +And he shall surety me. But for this lord, +Who hath abused me, as he knows himself, +Though yet he never harm'd me, here I quit him: +He knows himself my bed he hath defiled; +And at that time he got his wife with child: +Dead though she be, she feels her young one kick: +So there's my riddle: one that's dead is quick: +And now behold the meaning. + + +Re-enter Widow, with HELENA + + +KING +Is there no exorcist +Beguiles the truer office of mine eyes? +Is't real that I see? + + + +HELENA +No, my good lord; +'Tis but the shadow of a wife you see, +The name and not the thing. + + + +BERTRAM +Both, both. O, pardon! + + + +HELENA +O my good lord, when I was like this maid, +I found you wondrous kind. There is your ring; +And, look you, here's your letter; this it says: +'When from my finger you can get this ring +And are by me with child,' &c. This is done: +Will you be mine, now you are doubly won? + + + +BERTRAM +If she, my liege, can make me know this clearly, +I'll love her dearly, ever, ever dearly. + + + +HELENA +If it appear not plain and prove untrue, +Deadly divorce step between me and you! +O my dear mother, do I see you living? + + + +LAFEU +Mine eyes smell onions; I shall weep anon: +To PAROLLES +Good Tom Drum, lend me a handkercher: so, +I thank thee: wait on me home, I'll make sport with thee: +Let thy courtesies alone, they are scurvy ones. + + + +KING +Let us from point to point this story know, +To make the even truth in pleasure flow. +To DIANA +If thou be'st yet a fresh uncropped flower, +Choose thou thy husband, and I'll pay thy dower; +For I can guess that by thy honest aid +Thou keep'st a wife herself, thyself a maid. +Of that and all the progress, more or less, +Resolvedly more leisure shall express: +All yet seems well; and if it end so meet, +The bitter past, more welcome is the sweet. + +Flourish + + +EPILOGUE + +KING +The king's a beggar, now the play is done: +All is well ended, if this suit be won, +That you express content; which we will pay, +With strife to please you, day exceeding day: +Ours be your patience then, and yours our parts; +Your gentle hands lend us, and take our hearts. + + +Exeunt + + +
diff --git a/lib/xmerl/priv/testdata/play.dtd b/lib/xmerl/priv/testdata/play.dtd index 08833a5..e487b39 100755 --- a/lib/xmerl/priv/testdata/play.dtd +++ b/lib/xmerl/priv/testdata/play.dtd @@ -1,27 +1,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + +