Commits

james woodyatt committed 11f5749

Adjust whitespace. Update copyright declarations. Remove templates.

Comments (0)

Files changed (52)

beep/beep_core.ml

 (*---------------------------------------------------------------------------*
-  IMPLEMENTATION  beep_core.ml
-
-  Copyright (c) 2003-2007, James H. Woodyatt
+  $Change$
+  Copyright (c) 2003-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
             | 554 -> "transaction integrity error"
             | x when x < 100 || x > 999 ->
                  invalid_arg
-    			   "Beep_std_code.localizer#content: code not 3-digit integer"
+                   "Beep_std_code.localizer#content: code not 3-digit integer"
             | _ -> "unspecified error"
     end
 
     let ef _ x = raise (match x with End_of_file -> x | _ -> bad_syntax) in
     let module K = struct type t = MSG | RPY | ERR | ANS | NUL end in
     let keyword s =
-    	Scanf.kscanf s ef "%3[A-Z]" begin function
-    		| "MSG" -> K.MSG
-    		| "RPY" -> K.RPY
-    		| "ERR" -> K.ERR
-    		| "ANS" -> K.ANS
-    		| "NUL" -> K.NUL
-    		| _ -> raise bad_syntax
-    	end
+        Scanf.kscanf s ef "%3[A-Z]" begin function
+            | "MSG" -> K.MSG
+            | "RPY" -> K.RPY
+            | "ERR" -> K.ERR
+            | "ANS" -> K.ANS
+            | "NUL" -> K.NUL
+            | _ -> raise bad_syntax
+        end
     in
     let uint31 n = if Int32.compare n 0l < 0 then raise bad_syntax in
     let more v =
-    	match String.unsafe_get v 0 with
-    	| '.' -> Iom_stream.Last
-    	| _ -> Iom_stream.More
+        match String.unsafe_get v 0 with
+        | '.' -> Iom_stream.Last
+        | _ -> Iom_stream.More
     in
     let int32_of_maxint = Int32.of_int max_int in
     let size ?limit v =
-    	uint31 v;
-    	match limit with
-    	| Some limit when Int32.compare v limit > 0 -> raise too_large
-    	| _ when Int32.compare v int32_of_maxint > 0 -> raise too_large
-    	| _ -> Int32.to_int v
+        uint31 v;
+        match limit with
+        | Some limit when Int32.compare v limit > 0 -> raise too_large
+        | _ when Int32.compare v int32_of_maxint > 0 -> raise too_large
+        | _ -> Int32.to_int v
     in
     let common ?limit s =
-    	Scanf.kscanf s ef " %lu %lu %[.*] %lu %lu"
-    	begin fun a b c d e ->
-    		uint31 a;
-    		uint31 b;
-    		let c = more c in
-    		let e = size ?limit e in
-    		{ channo = a; msgno = b; seqno = d }, c, e
-    	end
+        Scanf.kscanf s ef " %lu %lu %[.*] %lu %lu"
+        begin fun a b c d e ->
+            uint31 a;
+            uint31 b;
+            let c = more c in
+            let e = size ?limit e in
+            { channo = a; msgno = b; seqno = d }, c, e
+        end
     in
     let crlf s = Scanf.kscanf s ef "\r\n%n" (fun x -> x) in
     let payload more m hlen size =
-    	let mlen = Cf_message.length m in
-    	if mlen < hlen + size + 5 then raise End_of_file;
-    	let m = Cf_message.shift ~pos:hlen m in
-    	let data, m = Cf_message.split ~pos:size m in
-    	let trailer, m = Cf_message.split ~pos:5 m in
-    	if Cf_message.contents trailer <> "END\r\n" then raise bad_syntax;
-    	more, data, m
+        let mlen = Cf_message.length m in
+        if mlen < hlen + size + 5 then raise End_of_file;
+        let m = Cf_message.shift ~pos:hlen m in
+        let data, m = Cf_message.split ~pos:size m in
+        let trailer, m = Cf_message.split ~pos:5 m in
+        if Cf_message.contents trailer <> "END\r\n" then raise bad_syntax;
+        more, data, m
     in
     let single ?limit s m =
-    	let header, more, size = common ?limit s in
-    	let hlen = crlf s in
-    	let more, data, m = payload more m hlen size in
-    	(header, more, data), m
+        let header, more, size = common ?limit s in
+        let hlen = crlf s in
+        let more, data, m = payload more m hlen size in
+        (header, more, data), m
     in
     fun ?limit m ->
-    	let s = Scanf.Scanning.from_function (Cf_message.to_function m) in
-    	match keyword s with
-    	| K.MSG ->
-    		let hd, tl = single ?limit s m in (`MSG hd), tl
-    	| K.RPY ->
-    		let hd, tl = single ?limit s m in (`RPY hd), tl
-    	| K.ERR ->
-    		let hd, tl = single ?limit s m in (`ERR hd), tl
-    	| K.ANS ->
-    		let header, more, size = common ?limit s in
-    		let ansno = Scanf.kscanf s ef " %lu" (fun x -> uint31 x; x) in
-    		let hlen = crlf s in
-    		let more, data, m = payload more m hlen size in
-    		`ANS (header, more, data, ansno), m
-    	| K.NUL ->
-    		Scanf.kscanf s ef " %lu %lu . %lu 0\r\nEND\r\n%n"
-    		begin fun a b c n ->
-    			uint31 a;
-    			uint31 b;
-    			let header = { channo = a; msgno = b; seqno = c } in
-    			let m = Cf_message.shift ~pos:n m in
-    			(`NUL header), m
-    		end
+        let s = Scanf.Scanning.from_function (Cf_message.to_function m) in
+        match keyword s with
+        | K.MSG ->
+            let hd, tl = single ?limit s m in (`MSG hd), tl
+        | K.RPY ->
+            let hd, tl = single ?limit s m in (`RPY hd), tl
+        | K.ERR ->
+            let hd, tl = single ?limit s m in (`ERR hd), tl
+        | K.ANS ->
+            let header, more, size = common ?limit s in
+            let ansno = Scanf.kscanf s ef " %lu" (fun x -> uint31 x; x) in
+            let hlen = crlf s in
+            let more, data, m = payload more m hlen size in
+            `ANS (header, more, data, ansno), m
+        | K.NUL ->
+            Scanf.kscanf s ef " %lu %lu . %lu 0\r\nEND\r\n%n"
+            begin fun a b c n ->
+                uint31 a;
+                uint31 b;
+                let header = { channo = a; msgno = b; seqno = c } in
+                let m = Cf_message.shift ~pos:n m in
+                (`NUL header), m
+            end
 
 let emit_frame =
     let trailer = [ "END\r\n", 0, 5 ] in
     let common b header more size =
-    	let more = match more with Iom_stream.More -> '*' | _ -> '.' in
-    	Printf.bprintf b " %lu %lu %c %lu %u" header.channo header.msgno more
-    		header.seqno size
+        let more = match more with Iom_stream.More -> '*' | _ -> '.' in
+        Printf.bprintf b " %lu %lu %c %lu %u" header.channo header.msgno more
+            header.seqno size
     in
     let payload b m =
-    	Buffer.add_string b "\r\n";
-    	let hlen = Buffer.length b in
-    	(Buffer.contents b, 0, hlen) :: (m @ trailer)
+        Buffer.add_string b "\r\n";
+        let hlen = Buffer.length b in
+        (Buffer.contents b, 0, hlen) :: (m @ trailer)
     in
     let single keyword header more m =
-    	let b = Buffer.create 40 in
-    	Buffer.add_string b keyword;
-    	let size = Cf_message.length m in
-    	common b header more size;
-    	payload b m
+        let b = Buffer.create 40 in
+        Buffer.add_string b keyword;
+        let size = Cf_message.length m in
+        common b header more size;
+        payload b m
     in
     function
     | `MSG (header, more, data) ->
-    	single "MSG" header more data
+        single "MSG" header more data
     | `RPY (header, more, data) ->
-    	single "RPY" header more data
+        single "RPY" header more data
     | `ERR (header, more, data) ->
-    	single "ERR" header more data
+        single "ERR" header more data
     | `ANS (header, more, data, ansno) ->
-    	let b = Buffer.create 40 in
-    	Buffer.add_string b "ANS";
-    	let size = Cf_message.length data in
-    	common b header more size;
-    	Printf.bprintf b " %lu" ansno;
-    	payload b data
+        let b = Buffer.create 40 in
+        Buffer.add_string b "ANS";
+        let size = Cf_message.length data in
+        common b header more size;
+        Printf.bprintf b " %lu" ansno;
+        payload b data
     | `NUL header ->
-    	let b = Buffer.create 40 in
-    	Buffer.add_string b "NUL";
-    	Printf.bprintf b " %lu %lu . %lu 0\r\nEND\r\n" header.channo
-    		header.msgno header.seqno;
-    	let length = Buffer.length b in
-    	[ Buffer.contents b, 0, length ]
+        let b = Buffer.create 40 in
+        Buffer.add_string b "NUL";
+        Printf.bprintf b " %lu %lu . %lu 0\r\nEND\r\n" header.channo
+            header.msgno header.seqno;
+        let length = Buffer.length b in
+        [ Buffer.contents b, 0, length ]
 
 (*--- channel and exchange driver types ---*)
 type iefix = {
             ief_eventRx = eventRx;
         } in
         Cf_cmonad.return (iep, ief)
-
+    
     method ocore =
         Iom_gadget.duplex >>= fun ((eventRx, flowTx), (flowRx, eventTx)) ->
         let oep = {
     let cx0 = match cx with None -> cx_state0 cxf | Some cx -> cx in
     object(self)
         inherit ['p cxstate] mxdrv cxf.cxf_abortRx cx0 as super
-
+        
         method private continue: 'a. 'p cxstate -> 'a Iom_gadget.t = function
             | Cx (Cx_msgx, Cx_rspx) -> self#complete
             | cx -> super#continue cx
                 self#continue (Cx (Cx_msgx, cxrv))
             | _, _ ->
                 self#continue cx
-
+        
         method private msg_octets = cx_msg_octets    
         method private rpy_octets _ _ _ = self#continue
         method private err_octets _ _ _ = self#continue
     let sx0 = match sx with None -> sx_state0 sxf | Some sx -> sx in
     object(self)
         inherit ['p sxstate] mxdrv sxf.sxf_abortRx sx0 as super
-
+        
         method private continue: 'a. 'p sxstate -> 'a Iom_gadget.t = function
             | Sx (Sx_msgx, Sx_rspx) -> self#complete
             | sx -> super#continue sx
         
         method private msg_octets _ _ _ sx = self#continue sx
-
+        
         method private rsp1_flow sx _ = self#continue sx
         
         method private rpy_octets ?h =
             sx_rsp1_octets ?h Mx_rpy sxf.sxf_chfix.chf_sxRpy
-
+        
         method private err_octets ?h =
             sx_rsp1_octets ?h Mx_err sxf.sxf_chfix.chf_sxErr
         
         method private ans_flow sx _ _ = self#continue sx
-
+        
         method private ans_octets_start ?n ?h =
             sx_ans_start ?n ?h sxf.sxf_chfix.chf_sxAns
-
+        
         method private ans_octets_append = sx_ans_append
         
         method private msg_guard (Sx (sxmv, sxrv)) =
                 sx_msg1_guard self#msg_octets sxrv sxf headers octetsRx
             | Sx_msgx ->
                 Cf_cmonad.nil
-
+        
         method private rsp_guard sx =
             let Sx (sxmv, sxrv) = sx in
             match sxmv, sxrv with
                 sx_rspn_guard self#ans_flow ansm sx
             | _, _ ->
                 Cf_cmonad.nil
-
+        
         method private guard =
             super#guard >>= fun () ->
             self#msg_guard core_ >>= fun () ->
     
     val core_: 'p chdrvstate = chdrvstate0
     method core = core_
-
+    
     method private abort: 'a. 'a Iom_gadget.t = Iom_gadget.abort
     
     method private close_ok = self#abort
     method private close_error _ = self#next
-
+    
     method private close_msg _ =
         chf.chf_notifyTx#put (M_ch0_ok chf.chf_channo) >>= fun () ->
         Iom_gadget.abort
-
+    
     method private failed code x =
         match x with
         | Error _ ->
     let txq = Cf_deque.A.push sxp Cf_deque.nil in
     Cf_cmonad.return { ch_state0 with chs_txq = txq }
 
-(*--- End of File [ beep_core.ml ] ---*)
+(*--- $File$ ---*)

beep/beep_core.mli

 (*---------------------------------------------------------------------------*
-  INTERFACE  beep_core.mli
-
-  Copyright (c) 2003-2008, James H. Woodyatt
+  $Change$
+  Copyright (c) 2003-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
     string list ->
     object
         method greeting_lang: string list
-    	method reply_lang: string option
-    	method reply_content: int -> string
+        method reply_lang: string option
+        method reply_content: int -> string
     end
 
 (** {5 Frames} *)
     method private msg_octets:
         Mime_entity.basic_scan_adapter -> Iom_octet_stream.fragment ->
         Iom_stream.readywait Iom_gadget.tx -> 'p sxstate -> unit Iom_gadget.t
-
+    
     method private rsp1_flow:
         'p sxstate -> Iom_stream.readywait -> unit Iom_gadget.t
     
     method private ans_flow:
         'p sxstate -> int32 -> Iom_stream.readywait -> unit Iom_gadget.t
-
+    
     method private rpy_octets:
         ?h:Mime_entity.basic_emit_adapter -> Iom_octet_stream.fragment ->
         'p sxstate -> 'p sxstate Iom_gadget.t
 
 class virtual ch0drv: pad -> object
     inherit [tag] chdrv
-
+    
     method virtual private ch_stop: int32 -> unit Iom_gadget.t
-
+    
     method virtual private up_close: int32 -> int -> unit Iom_gadget.t
     method virtual private up_ok: int32 -> unit Iom_gadget.t
     method virtual private up_error: int32 -> int -> unit Iom_gadget.t
 val ch0_role: pad -> role
 val ch0_initial: pad -> chstate Iom_gadget.t
 
-(*--- End of File [ beep_core.mli ] ---*)
+(*--- $File$ ---*)

beep/beep_serial.ml

 (*---------------------------------------------------------------------------*
-  IMPLEMENTATION  beep_serial.ml
-
-  Copyright (c) 2007, James H. Woodyatt
+  $Change$
+  Copyright (c) 2007-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
     let uint31 n = if Int32.compare n 0l < 0 then raise bad_syntax in
     let int32_of_maxint = Int32.of_int max_int in
     fun m ->
-    	let s = Scanf.Scanning.from_function (Cf_message.to_function m) in
-    	Scanf.kscanf s ef "%3[A-Z] %lu %lu %lu\r\n%n"
+        let s = Scanf.Scanning.from_function (Cf_message.to_function m) in
+        Scanf.kscanf s ef "%3[A-Z] %lu %lu %lu\r\n%n"
             begin fun key ch seq win n ->
                 match key with
                 | "SEQ" ->
             s8.s8_controlTx#put `Ready
     end
 
-(*--- End of File [ beep_serial.ml ] ---*)
+(*--- $File$ ---*)

beep/beep_serial.mli

 (*---------------------------------------------------------------------------*
-  INTERFACE  beep_serial.mli
-
-  Copyright (c) 2007, James H. Woodyatt
+  $Change$
+  Copyright (c) 2007-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
         inherit Beep_session.drv
     end
 
-(*--- End of File [ beep_serial.mli ] ---*)
+(*--- $File$ ---*)

beep/beep_session.ml

 (*---------------------------------------------------------------------------*
-  IMPLEMENTATION  beep_transport.ml
-
-  Copyright (c) 2008, James H. Woodyatt
+  $Change$
+  Copyright (c) 2008-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 
 module E_profile = struct
     open Cf_parser.Op
-
+    
     type encoding = E_none | E_base64
-
+    
     type t = {
         uri: string;
         encoding: encoding;
     }
     
     let required = "#REQUIRED" and empty = ""
-
+    
     let initial = {
         uri = required;
         encoding = E_none;
         content = empty;
     }
-
+    
     let emit_octets pp v =
         Format.pp_open_vbox pp 2;
         Format.pp_print_string pp "<profile uri='";
             in
             Xml_parser.validated_element
                 ~tag:"profile" ~attr ~content ~space initial
-
+    
     let scan_xml = scan_xml_entity false
 end
 
 module E_greeting = struct
     open Cf_parser.Op
-
+    
     type t = {
         features: string list;
         localize: string list;
         profiles: string list; (* only URI is valid in greeting elements *)
     }
-
+    
     let cons ?(features = []) ?(localize = []) profiles = {
         features = features;
         localize = localize;
             Format.pp_print_string pp hd;
             Format.pp_print_space pp ();
             emit_attribute_value_tokens_ pp tl
-
+    
     let emit_octets pp v =
         Format.pp_open_vbox pp 2;
         Format.pp_print_string pp "<greeting";
     let invalid_ pos pair =
         let event = Xml_event.T_element_start ("start", [pair]), pos in
         raise (Xml_parser.Invalid event)
-
+    
     let scan_xml =
         let attr pos obj (k, v as pair) =
             match k with
             Format.pp_print_string pp "close>"
         end;
         Format.pp_print_cut pp ()
-
+    
     let scan_signal close =
         let empty = "" in
         let initial = {
 
 module E_close = struct
     open Cf_parser.Op
-
+    
     module S = E_signal(struct let name = "close" end)        
     
     type t = {
         
     let emit_octets pp v =
         S.emit_signal pp ~number:v.number v.code v.lang v.content
-
+    
     let scan_xml =
         S.scan_signal true >>= fun v ->
         ~:{
     let invalid_ pos pair =
         let event = Xml_event.T_element_start ("ok", [pair]), pos in
         raise (Xml_parser.Invalid event)
-
+    
     let scan_xml =
         let attr pos () pair = invalid_ pos pair in
         let content () = Xml_parser.optional_whitespace in
 
 module M_err = struct
     open Cf_parser.Op
-
+    
     module S = E_signal(struct let name = "error" end)        
     
     let limits = Beep_core.default_limits
-
+    
     type t = {
         code: int;
         lang: string option;
     }
         
     let emit_octets pp v = S.emit_signal pp v.code v.lang v.content
-
+    
     let scan_xml _ =
         S.scan_signal false >>= fun v ->
         ~:{
         | M_msg.Start _, M_rpy.Profile v -> rspTx#put (`Profile v)
         | M_msg.Close _, M_rpy.Ok -> rspTx#put `Ok
         | _, _ -> super#failed Beep_core.general_syntax_error wrong_xml
-
+    
     method start =
         match msg with
         | M_msg.Greeting _ -> Iom_gadget.start (self#continue core_)
             | M_msg.Greeting _ -> assert (not true); Cf_cmonad.nil
         end >>= fun () ->
         self#continue sx
-
+    
     method private response = function
         | `Greeting v ->
             super#rpy_complete (M_rpy.Greeting v) core_ >>= self#continue
             match Beep_core.ch0_role cp with
             | Beep_core.R_initiator -> 1l
             | Beep_core.R_listener -> 2l
-
+        
         val mxq_ = Cf_deque.nil
                 
         method private ch_stop n =
                 Iom_gadget.abort
             else
                 self#next
-
+        
         method private up_close n code =
             let v = M_msg.Close {
                 E_close.number = n;
                 Cf_cmonad.return (next, drv)
             end >>= fun next ->
             next#next
-
+        
         method private up_ok n =
             errj#fail "Beep_transport.driver#up_ok"
-
+        
         method private up_error n code =
             errj#fail "Beep_transport.driver#up_error"
         
 
 let pad role = Beep_core.ch0_load role C.chform
 
-(*--- End of File [ beep_transport.ml ] ---*)
+(*--- $File$ ---*)

beep/beep_session.mli

 (*---------------------------------------------------------------------------*
-  INTERFACE  beep_transport.mli
-
-  Copyright (c) 2008, James H. Woodyatt
+  $Change$
+  Copyright (c) 2008-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
     uri:string list -> Beep_core.pad ->
     object
         inherit Beep_core.ch0drv
-
+        
         method private ch_stop: int32 -> unit Iom_gadget.t
-
+        
         method private up_close: int32 -> int -> unit Iom_gadget.t
         method private up_ok: int32 -> unit Iom_gadget.t
         method private up_error: int32 -> int -> unit Iom_gadget.t
 
 val pad: Beep_core.role -> Beep_core.pad Iom_gadget.t
 
-(*--- End of File [ beep_transport.mli ] ---*)
+(*--- $File$ ---*)

beep/beep_simple.ml

 (*---------------------------------------------------------------------------*
-  IMPLEMENTATION  beep_simple.ml
-
-  Copyright (c) 2007, James H. Woodyatt
+  $Change$
+  Copyright (c) 2007-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
     let emit_octets _ _ = ()
     
     let mime_fail () = raise (Error X_invalid_mime_header)
-
+    
     let scan_octets h p =
         if h#content_type <> None then mime_fail ();
         if h#content_transfer_encoding <> None then mime_fail ();
 
 module type Channel_form = sig
     module P: Profile
-
+    
     class cxdrv:
         ?cx:P.tag Beep_core.cxstate -> P.MSG.t -> P.tag Beep_core.cxfix ->
         object
             inherit [P.tag] Beep_core.cxdrv
-
+            
             method private rpy_complete: P.RPY.t -> unit Iom_gadget.t
             method private err_complete: P.ERR.t -> unit Iom_gadget.t
             method private ans_complete: int32 -> P.ANS.t -> unit Iom_gadget.t
             
             method private msg_complete:
                 P.MSG.t -> P.tag Beep_core.sxstate -> unit Iom_gadget.t
-
+            
             method private rpy_complete:
                 P.RPY.t -> P.tag Beep_core.sxstate ->
                 P.tag Beep_core.sxstate Iom_gadget.t
                 ?n:int32 -> P.ANS.t -> P.tag Beep_core.sxstate ->
                 (P.tag Beep_core.sxstate * int32) Iom_gadget.t
         end
-
+    
     val chform: P.tag Beep_core.chform
 end
 
 module Channel_form(P: Profile) = struct
     open Cf_cmonad.Op
     module P = P
-
+    
     module MSG = Entity_form(P.MSG)
     let msg_isimple = MSG.eform#isimple
     let msg_osimple = MSG.eform#osimple
-
+    
     module RPY = Entity_form(P.RPY)
     let rpy_isimple = RPY.eform#isimple
     let rpy_osimple = RPY.eform#osimple
-
+    
     module ERR = Entity_form(P.ERR)
     let err_isimple = ERR.eform#isimple
     let err_osimple = ERR.eform#osimple
-
+    
     module ANS = Entity_form(P.ANS)    
     let ans_isimple = ANS.eform#isimple
     let ans_osimple = ANS.eform#osimple
         method private rpy_complete _ = Iom_gadget.abort
         method private err_complete _ = Iom_gadget.abort
         method private ans_complete _ _ = Iom_gadget.abort
-
+        
         method private rsp1_octets:
             'v. ('v -> unit Iom_gadget.t) -> (Mime_entity.basic_scan_adapter ->
             Iom_octet_stream.fragment -> 'v) ->
             super#msg_octets (msg_osimple msg) core_ >>= fun cx ->
             Iom_gadget.start (self#continue cx)
     end
-
+    
     class sxdrv ?sx sxf = object(self)
         inherit [P.tag] Beep_core.sxdrv ?sx sxf as super
-    
+        
         method private msg_complete _ sx = self#continue sx
         
         method private failed:'a. exn -> 'a Iom_gadget.t =
             fun _ -> Iom_gadget.abort
-
+        
         method private msg_octets headers octets _ sx =
             match octets#more with
             | Iom_stream.More ->
                 with
                 | x ->
                     self#failed x
-
+        
         method private rpy_complete v sx = super#rpy_octets (rpy_osimple v) sx
         method private err_complete v sx = super#err_octets (err_osimple v) sx
         
             raise (Error (X_invalid_xml pos))
 end
 
-(*--- End of File [ beep_simple.ml ] ---*)
+(*--- $File$ ---*)

beep/beep_simple.mli

 (*---------------------------------------------------------------------------*
-  INTERFACE  beep_simple.mli
-
-  Copyright (c) 2007, James H. Woodyatt
+  $Change$
+  Copyright (c) 2007-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 
 module type Profile = sig
     type tag
-
+    
     module MSG: Entity
     module RPY: Entity
     module ERR: Entity
 
 module type Channel_form = sig
     module P: Profile
-
+    
     class cxdrv:
         ?cx:P.tag Beep_core.cxstate -> P.MSG.t -> P.tag Beep_core.cxfix ->
         object
             inherit [P.tag] Beep_core.cxdrv
-
+            
             method private rpy_complete: P.RPY.t -> unit Iom_gadget.t
             method private err_complete: P.ERR.t -> unit Iom_gadget.t
             method private ans_complete: int32 -> P.ANS.t -> unit Iom_gadget.t
             
             method private msg_complete:
                 P.MSG.t -> P.tag Beep_core.sxstate -> unit Iom_gadget.t
-
+            
             method private rpy_complete:
                 P.RPY.t -> P.tag Beep_core.sxstate ->
                 P.tag Beep_core.sxstate Iom_gadget.t
-                
+            
             method private err_complete:
                 P.ERR.t -> P.tag Beep_core.sxstate ->
                 P.tag Beep_core.sxstate Iom_gadget.t
 
 module Xml_entity(S: Xml_entity_sig): Entity with type t = S.t
 
-(*--- End of File [ beep_simple.mli ] ---*)
+(*--- $File$ ---*)

beep/beep_xxxxx.ml

-(*---------------------------------------------------------------------------*
-  IMPLEMENTATION  beep_xxxxx.ml
-
-  Copyright (c) 2008, James H. Woodyatt
-  All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions
-  are met:
-
-    Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-
-    Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in
-    the documentation and/or other materials provided with the
-    distribution
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-  COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-  OF THE POSSIBILITY OF SUCH DAMAGE. 
- *---------------------------------------------------------------------------*)
-
-(*--- End of File [ beep_xxxxx.ml ] ---*)

beep/beep_xxxxx.mli

-(*---------------------------------------------------------------------------*
-  INTERFACE  beep_xxxxx.mli
-
-  Copyright (c) 2008, James H. Woodyatt
-  All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions
-  are met:
-
-    Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-
-    Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in
-    the documentation and/or other materials provided with the
-    distribution
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-  COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-  OF THE POSSIBILITY OF SUCH DAMAGE. 
- *---------------------------------------------------------------------------*)
-
-(*--- End of File [ beep_xxxxx.mli ] ---*)

beep/beep_xxxxx_p.c

-/*---------------------------------------------------------------------------*
-  C MODULE  beep_xxxxx_p.c
-
-  Copyright (c) 2008, James H. Woodyatt
-  All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions
-  are met:
-
-    Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-
-    Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in
-    the documentation and/or other materials provided with the
-    distribution
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-  COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-  OF THE POSSIBILITY OF SUCH DAMAGE. 
- *---------------------------------------------------------------------------*/
-
-#include "beep_xxxxx_p.h"
-
-/*--- End of File [ beep_xxxxx_p.c ] ---*/

beep/beep_xxxxx_p.h

-/*---------------------------------------------------------------------------*
-  C HEADER  beep_xxxxx_p.h
-
-  Copyright (c) 2008, James H. Woodyatt
-  All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions
-  are met:
-
-    Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-
-    Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in
-    the documentation and/or other materials provided with the
-    distribution
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-  COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-  OF THE POSSIBILITY OF SUCH DAMAGE. 
- *---------------------------------------------------------------------------*/
-
-#ifndef _BEEP_XXXXX_P_H
-#define _BEEP_XXXXX_P_H
-
-#include "beep_common_p.h"
-
-#endif /* defined(_BEEP_XXXXX_P_H) */
-
-/*--- End of File [ beep_xxxxx_p.h ] ---*/
 (*---------------------------------------------------------------------------*
-  IMPLEMENTATION  t_beep.ml
-
-  Copyright (c) 2003-2006, James H. Woodyatt
+  $Change$
+  Copyright (c) 2003-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
         errj#fail "Unix error \"%s\" in %s(%s)" error fname arg
     | x ->
         raise x
-    
+
 class virtual ['notify] test notifyRx okayRef =
     let notifyRx = (notifyRx :> 'notify Iom_gadget.rx) in
     object(self)
         method private okay =
             okayRef := true;
             Iom_gadget.abort
-            
+        
         method private guard =
             notifyRx#get self#notify
     end
     open Beep_core
     
     let greeting_ = Cf_message.create ("\
-    	Content-type: application/beep+xml\r\n\
-    	\r\n\
-    	<greeting/>\r\n\
+        Content-type: application/beep+xml\r\n\
+        \r\n\
+        <greeting/>\r\n\
     ")
     
     let okay_ = [
-    	(let header = { channo = 0l; msgno = 0l; seqno = 0l } in
-    	`MSG (header, Iom_stream.Last, greeting_));
-    
-    	(let header = { channo = 7l; msgno = 89l; seqno = 100l } in
-    	`RPY (header, Iom_stream.More, Cf_message.create "reply!\r\n"));
-    	
-    	(let header = { channo = 123l; msgno = 456l; seqno = 7890l } in
-    	`ERR (header, Iom_stream.More, Cf_message.create "\r\n"));
-    
-    	(let header = { channo = 12l; msgno = 256l; seqno = 0l } in
-    	`ANS (header, Iom_stream.More, Cf_message.create "foo!\r\n", 666l));
-
-    	(let header = { channo = 12l; msgno = 256l; seqno = 2147483647l } in
-    	`ANS (header, Iom_stream.Last, Cf_message.create "foo!\r\n", 666l));
-
-    	`NUL { channo = 0l; msgno = 1l; seqno = 2l };
+        (let header = { channo = 0l; msgno = 0l; seqno = 0l } in
+        `MSG (header, Iom_stream.Last, greeting_));
+        
+        (let header = { channo = 7l; msgno = 89l; seqno = 100l } in
+        `RPY (header, Iom_stream.More, Cf_message.create "reply!\r\n"));
+        
+        (let header = { channo = 123l; msgno = 456l; seqno = 7890l } in
+        `ERR (header, Iom_stream.More, Cf_message.create "\r\n"));
+        
+        (let header = { channo = 12l; msgno = 256l; seqno = 0l } in
+        `ANS (header, Iom_stream.More, Cf_message.create "foo!\r\n", 666l));
+        
+        (let header = { channo = 12l; msgno = 256l; seqno = 2147483647l } in
+        `ANS (header, Iom_stream.Last, Cf_message.create "foo!\r\n", 666l));
+        
+        `NUL { channo = 0l; msgno = 1l; seqno = 2l };
     ]
-    	
+        
     let loopback_okay_ frame =
-    	let m = emit_frame frame in
-    	(* print_string (Cf_message.contents m); *)
-    	let frame', m = parse_frame m in
-    	if m <> [] then failwith "unexpected trailer";
-    	match frame, frame' with
-    	| `MSG (h1, more1, data1), `MSG (h2, more2, data2)
-    	| `RPY (h1, more1, data1), `RPY (h2, more2, data2)
-    	| `ERR (h1, more1, data1), `ERR (h2, more2, data2)
-    	  when h1 = h2 && more1 = more2 &&
-    		   Cf_message.contents data1 = Cf_message.contents data2 ->
-    		()
-    	| `ANS (h1, more1, data1, ansno1), `ANS (h2, more2, data2, ansno2)
-    	  when ansno1 = ansno2 && h1 = h2 && more1 = more2 &&
-    		   Cf_message.contents data1 = Cf_message.contents data2 ->
-    		()
-    	| `NUL h1, `NUL h2 when h1 = h2 ->
-    		()
-    	| _, _ ->
-    		failwith "loopback error!"
+        let m = emit_frame frame in
+        (* print_string (Cf_message.contents m); *)
+        let frame', m = parse_frame m in
+        if m <> [] then failwith "unexpected trailer";
+        match frame, frame' with
+        | `MSG (h1, more1, data1), `MSG (h2, more2, data2)
+        | `RPY (h1, more1, data1), `RPY (h2, more2, data2)
+        | `ERR (h1, more1, data1), `ERR (h2, more2, data2)
+          when h1 = h2 && more1 = more2 &&
+               Cf_message.contents data1 = Cf_message.contents data2 ->
+            ()
+        | `ANS (h1, more1, data1, ansno1), `ANS (h2, more2, data2, ansno2)
+          when ansno1 = ansno2 && h1 = h2 && more1 = more2 &&
+               Cf_message.contents data1 = Cf_message.contents data2 ->
+            ()
+        | `NUL h1, `NUL h2 when h1 = h2 ->
+            ()
+        | _, _ ->
+            failwith "loopback error!"
     
     let test () =
-    	List.iter loopback_okay_ okay_;
+        List.iter loopback_okay_ okay_;
 end
 
 module T2 = struct
                 let session = new session closeTx socketFix pad s in
                 session#start >>= fun () ->
                 {< listen_ = lopt; connect_ = copt; >}#next
-
+            
             method private l_notify = function
                 | `Listen dst ->
                     (*---
                     connectRx#get (self#l_connect controlTx)
             
             method private i_notify (`Failed x) = raise x
-
+            
             method private i_connect c =
                 assert (listen_ = None);
                 self#connect None None Beep_core.R_initiator c
 
 main ();;
 
-(*--- End of File [ t_beep.ml ] ---*)
+(*--- $File$ ---*)

mime/mime_atom.ml

 (*---------------------------------------------------------------------------*
-  IMPLEMENTATION  mime_atom.ml
-
-  Copyright (c) 2004-2006, James H. Woodyatt
+  $Change$
+  Copyright (c) 2004-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 module Set = Cf_rbtree.Set(Order)
 module Map = Cf_rbtree.Map(Order)
 
-(*--- End of File [ mime_atom.ml ] ---*)
+(*--- $File$ ---*)

mime/mime_atom.mli

 (*---------------------------------------------------------------------------*
-  INTERFACE  mime_atom.mli
-
-  Copyright (c) 2004-2006, James H. Woodyatt
+  $Change$
+  Copyright (c) 2004-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 module Set: Cf_set.T with module Element = Order
 module Map: Cf_map.T with module Key = Order
 
-(*--- End of File [ mime_atom.mli ] ---*)
+(*--- $File$ ---*)

mime/mime_base64.ml

 (*---------------------------------------------------------------------------*
-  IMPLEMENTATION  mime_base64.ml
-
-  Copyright (c) 2003-2006, James H. Woodyatt
+  $Change$
+  Copyright (c) 2003-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
             end
         in
         Lazy.lazy_from_val loop
-
+    
     let word_to_code_ =
         let screen = function
             | '\048'..'\057' | '\061' | '\065'..'\090' | '\097'..'\122' -> true
         fun i ->
             assert (i >= 0 && i < 64);
             Array.unsafe_get a i
-
+    
     let code_to_word_ =
         let rec loop =
             Cf_flow.Q begin fun n ->
             end
         in
         Lazy.lazy_from_val loop
-
+    
     let octets_to_code_ =
         let rec state0 = function
             | None -> Cf_flow.Z
         fun i ->
             assert (i >= 0 && i < 64);
             Array.unsafe_get a i
-
+    
     let code_to_word_ =
         let rec loop =
             Cf_flow.Q begin fun n ->
             end
         in
         loop
-
+    
     let octets_to_code_ =
         let rec state0 = function
             | More, Cf_seq.Z ->
             end
         in
         loop
-
+    
     let word_to_code_ =
         let screen = function
             | '\048'..'\057' | '\061' | '\065'..'\090' | '\097'..'\122' -> true
 end
 *)
 
-(*--- End of File [ mime_base64.ml ] ---*)
+(*--- $File$ ---*)

mime/mime_base64.mli

 (*---------------------------------------------------------------------------*
-  INTERFACE  mime_base64.mli
-
-  Copyright (c) 2003-2006, James H. Woodyatt
+  $Change$
+  Copyright (c) 2003-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 module E: Transcoding_T  (** Encoder *)
 module D: Transcoding_T  (** Decoder *)
 
-(*--- End of File [ mime_base64.mli ] ---*)
+(*--- $File$ ---*)

mime/mime_entity.ml

 (*---------------------------------------------------------------------------*
-  IMPLEMENTATION  mime_entity.ml
-
-  Copyright (c) 2003-2006, James H. Woodyatt
+  $Change$
+  Copyright (c) 2003-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
         | Some cte -> p_end_of_field >>= fun () -> ~:cte
     and p_content_length =
         L.parse_optcfws >>= fun () ->
-    	L.parse_atom >>= fun atom ->
-    	let n = Int64.of_string atom in
+        L.parse_atom >>= fun atom ->
+        let n = Int64.of_string atom in
         p_end_of_field >>= fun () ->
         ~:n
     and p_content_id =
                 end fields
             end
         in
-        object(_:'self)    		            
+        object(_:'self)                     
             method content_type = Lazy.force ctz
             method content_disposition = Lazy.force cdiz
             method content_transfer_encoding = Lazy.force ctez            
             method content_description = Lazy.force cdez
             method content_length = Lazy.force clz
             method content_id = Lazy.force cidz
-
+            
             method unstructured = Lazy.force unstructured
             
             method force =
     fun ?ct ?cdi ?cte ?cde ?cl ?cid u ->
     object(self)
         constraint 'self = #headers
-
+        
         method content_type = ct
         method content_disposition = cdi
         method content_transfer_encoding = cte
         method content_length = cl
         method content_id = cid
         method unstructured = u
-
+        
         method private emit_structured pp =
             L.emit_optional_field e_content_type pp S.content_type
                 self#content_type;
         method private emit_headers pp =
             self#emit_structured pp;
             self#emit_unstructured pp
-
+        
         method emit pp =
             self#emit_headers pp;
             Format.pp_print_newline pp ()
-
+        
         method to_message =
             let b = Buffer.create 256 in
             self#emit (L.formatter b);
 
 let emit_basic_headers ?ct ?cdi ?cte ?cde ?cl ?cid u =
     object
-    	inherit basic_emit_adapter ?ct ?cdi ?cte ?cde ?cl ?cid u as super
-    	val mutable text_ = lazy (raise Lazy.Undefined)
-    	method emit = Lazy.force text_
-    	initializer text_ <- Lazy.lazy_from_val super#emit
+        inherit basic_emit_adapter ?ct ?cdi ?cte ?cde ?cl ?cid u as super
+        val mutable text_ = lazy (raise Lazy.Undefined)
+        method emit = Lazy.force text_
+        initializer text_ <- Lazy.lazy_from_val super#emit
     end
 
-(*--- End of File [ mime_entity.ml ] ---*)
+(*--- $File$ ---*)

mime/mime_entity.mli

 (*---------------------------------------------------------------------------*
-  INTERFACE  mime_entity.mli
-
-  Copyright (c) 2003-2006, James H. Woodyatt
+  $Change$
+  Copyright (c) 2003-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
     ?ct:ct -> ?cdi:cd -> ?cte:cte -> ?cde:string -> ?cl:int64 ->
     ?cid:(string * string) -> (string * string) list -> basic_emit_adapter
 
-(*--- End of File [ mime_entity.mli ] ---*)
+(*--- $File$ ---*)
 (*---------------------------------------------------------------------------*
-  IMPLEMENTATION  mime_lex.ml
-
-  Copyright (c) 2005-2006, James H. Woodyatt
+  $Change$
+  Copyright (c) 2005-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 module Expr = struct
     let wsp = !$"[ `t]"
     let crlf = !$"`r`n"
-
+    
     let no_ws_ctl =
         !^ begin function
             | '\001'..'\008' | '\011' | '\012' | '\014'..'\031' | '\127' ->
         | '(' | ')' | '<' | '>' | '[' | ']' | ':' | ';' | '@'
         | '\\' | ',' | '.' | '"' -> true
         | _ -> false
-
+    
     let specials = !^specials_f_
-
+    
     let tspecials_f_ = function
         | '(' | ')' | '<' | '>' | '[' | ']' | ':' | ';' | '@'
         | '/' | '\\' | ',' | '?' | '=' | '"' -> true
         | _ -> false
-
+    
     let tspecials = !^tspecials_f_
         
     let utext =
         let printable_ascii_ = !$"[`033-`126]" in
         (* let obs_utext_ = !$"`n*`r*[^`010`013`128-`255]`n*`r*" in *)
         no_ws_ctl $| printable_ascii_ (* $| obs_utext_ *)
-
+    
     let quoted_pair = !$"\\[`000-`127]"
     
     let obs_fws_ = !+wsp $& !*(crlf $& !+wsp)
     let fws = (!? (!*wsp $& crlf) $& !+wsp) $| obs_fws_
     
     let optfws = !?fws
-
+    
     let ch_ctext_printable_ =
         !^ begin function
             | '\033'..'\039' | '\042'..'\091' | '\093'..'\126' -> true
             | _ -> false
         end
-
+    
     let ctext = no_ws_ctl $| ch_ctext_printable_
-
+    
     let cbegin = !:'('
     let cend = !:')'
-
+    
     let atext =
         !^ begin function
             | '\000'..'\032' -> false
             | '\128'..'\255' -> false
             | x -> not (specials_f_ x)
         end
-
+    
     let raw_atom = !+atext
-
+    
     let raw_dot_atom = raw_atom $& !*(!:'.' $& raw_atom)
-
+    
     let ttext =
         !^ begin function
             | '\000'..'\032' -> false
             | '\128'..'\255' -> false
             | x -> not (tspecials_f_ x)
         end
-
+    
     let raw_token = !+ttext
-
+    
     let dquote = !:'"'
-
+    
     let qtext =
         no_ws_ctl $|
         !^ begin function
             | '\033' | '\035'..'\091' | '\092'..'\126' -> true
             | _ -> false
         end
-
+    
     let qcontent = qtext $| quoted_pair
-
+    
     let raw_quoted_string =
         dquote $& !*(optfws $& qcontent) $& optfws $& dquote
-
+    
     let dtext =
         no_ws_ctl $|
         !^ begin function
             | '\033' | '\035'..'\091' | '\092'..'\126' -> true
             | _ -> false
         end
-
+    
     let dcontent = dtext $| quoted_pair
-
+    
     let raw_domain_literal =
         !:'[' $& !*(optfws $& dcontent) $& optfws $& !:']'
-
+    
     let ftext =
         !^ begin function
             | '\033'..'\057' | '\059'..'\126' -> true
             | _ -> false
         end
-
+    
     let field_name = !+ftext
-
+    
     let unstructured = !*(optfws $& utext) $& optfws
 end
 
     let pos, rows, tl = split_into_fields_scan_ 0 0 z in
     let field, m = Cf_message.split ~pos m in
     if pos = 2 then
-    	(List.rev_map f) acc, m
+        (List.rev_map f) acc, m
     else
-    	match parse_field_name (Cf_message.to_seq field) with
-    	| None ->
-    		raise (Error (X_field_bad_syntax (line, field)))
-    	| Some (name, z) ->
-    		let acc = (line, name, z) :: acc in
-    		split_into_fields_loop_ f (line + rows) acc m tl
+        match parse_field_name (Cf_message.to_seq field) with
+        | None ->
+            raise (Error (X_field_bad_syntax (line, field)))
+        | Some (name, z) ->
+            let acc = (line, name, z) :: acc in
+            split_into_fields_loop_ f (line + rows) acc m tl
 
 let split_into_fields_and_map f m =
     split_into_fields_loop_ f 0 [] m (Cf_message.to_seq m)
 let formatter b =
     let pp = Format.formatter_of_buffer b in
     let out, flush, _, spaces =
-    	Format.pp_get_all_formatter_output_functions pp ()
+        Format.pp_get_all_formatter_output_functions pp ()
     in
     let newline () = out crlf_string_ 0 2 in
     let pp = Format.make_formatter out flush in
     Format.pp_set_all_formatter_output_functions
-    	pp ~out ~flush ~newline ~spaces;
+        pp ~out ~flush ~newline ~spaces;
     Format.pp_set_margin pp 75;
     pp
 
     | Some v -> emit_field f pp name v
     | None -> ()
 
-(*--- End of File [ mime_lex.ml ] ---*)
+(*--- $File$ ---*)

mime/mime_lex.mli

 (*---------------------------------------------------------------------------*
-  INTERFACE  mime_lex.mli
-
-  Copyright (c) 2005-2006, James H. Woodyatt
+  $Change$
+  Copyright (c) 2005-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
     (Format.formatter -> 'a -> unit) -> Format.formatter -> string ->
     'a option -> unit
 
-(*--- End of File [ mime_lex.mli ] ---*)
+(*--- $File$ ---*)

mime/mime_stream.ml

 (*---------------------------------------------------------------------------*
-  IMPLEMENTATION  mime_stream.ml
-
-  Copyright (c) 2005-2006, James H. Woodyatt
+  $Change$
+  Copyright (c) 2005-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
         constraint 'event = #Mime_entity.basic_emit_adapter event
         inherit ['event, Iom_octet_stream.fragment] Iom_octet_stream.emitter
              ?limits flowTx mimeRx bodyTx
-
+        
         val source_ = E_src_entity (mimeRx :> 'event Iom_gadget.rx)
-
+        
         method private emit =
             let data = Cf_deque.A.to_list buffer_ in
             let m = new Iom_octet_stream.fragment more_ data in
                 consume_ = consume; buffer_ = buffer; mark_ = mark;
                 more_ = more;
             >}
-
+        
         method consume f =
             match consume_ with
             | false ->
     Iom_layer.duplex iofix
         (new entity_scanner ?limits:slim) (new entity_emitter ?limits:elim)
 
-(*--- End of File [ mime_stream.ml ] ---*)
+(*--- $File$ ---*)

mime/mime_stream.mli

 (*---------------------------------------------------------------------------*
-  INTERFACE  mime_stream.mli
-
-  Copyright (c) 2005-2006, James H. Woodyatt
+  $Change$
+  Copyright (c) 2005-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
     constraint 'adapter = #Mime_entity.basic_scan_adapter
     constraint 'event = 'adapter event
     inherit [Iom_octet_stream.fragment, 'event] Iom_octet_stream.scanner
-
+    
     val bodyTx_: Iom_octet_stream.fragment Iom_gadget.tx option
-
+    
     method private virtual headers: (string * char Cf_seq.t) list -> 'adapter
 end
 
     inherit ['event, Iom_octet_stream.fragment] Iom_octet_stream.emitter
     
     val source_: 'event emitter_source
-
+    
     method push_event: 'event -> 'self Iom_gadget.t
     method push_fragment: Iom_octet_stream.fragment -> 'self Iom_gadget.t
 end
         Iom_stream.iofix ->
     ('c, 'n) entity_duplex_fix Iom_gadget.t
 
-(*--- End of File [ mime_stream.mli ] ---*)
+(*--- $File$ ---*)
 (*---------------------------------------------------------------------------*
-  IMPLEMENTATION  t_mime.ml
-
+  $Change$
   Copyright (c) 2003-2006, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
     let f3 = "X-Unstructured: foo\r\n"
     let h = f1 ^ f2 ^ f3 ^ "\r\n"
     let b = "this is the body"
-
+    
     let m = Cf_message.create (h ^ b)
     
     let test () =
 
 module T3 = struct
     open Mime_entity
-
+    
     let cte = CTE_binary
-
+    
     let ct = {
         ct_type = CT_text;
         ct_subtype = "plain";
     module G = Iom_gadget
     module E = Mime_entity
     module S = Mime_stream
-
+    
     let cte = E.CTE_binary
-
+    
     let ct = {
         E.ct_type = E.CT_text;
         ct_subtype = "xml";
     }
         
     let body = Cf_message.create "<greeting/>\r\n"
-
+    
     let plain =
         "Content-Type: text/xml; charset=utf8\r\n" ^
         "Content-Transfer-Encoding: binary\r\n" ^
         "<greeting/>"
     
     let finished = ref false
-        
+    
     class top ijack ojack =
         let scanRx, (_, ctrlTx) = ijack in
         let emitTx, _ = ojack in
                 ctrlTx#put `Ready >>= fun () ->
                 super#start
         end
-            
+     
     let reactor k =
         let limits = { Iom_octet_stream.low = 256; high = 256 } in
         Iom_pipe.create ~limits k >>= fun (ijack, ojack) ->
     module G = Iom_gadget
     module E = Mime_entity
     module S = Mime_stream
-
+    
     let cte = E.CTE_binary
-
+    
     let ct = {
         E.ct_type = E.CT_text;
         ct_subtype = "xml";
     }
         
     let body = Cf_message.create "<greeting/>\r\n"
-
+    
     let expect =
         "Content-Type: text/xml; charset=utf8\r\n" ^
         "Content-Transfer-Encoding: binary\r\n" ^
         "<greeting/>\r\n"
     
     let finished = ref false
-        
+    
     class top ijack ojack =
         let readRx, (_, ctrlTx) = ijack in
         let emitTx, _ = ojack in
                 ctrlTx#put `Ready >>= fun () ->
                 super#start
         end
-            
+    
     let reactor k =
         let limits = { Iom_octet_stream.low = 256; high = 256 } in
         Iom_pipe.create ~limits k >>= fun (ijack, ojack) ->
 
 main ();;
 
-(*--- End of File [ t_mime.ml ] ---*)
+(*--- $File$ ---*)

sasl/sasl_anonymous.ml

 (*---------------------------------------------------------------------------*
-  IMPLEMENTATION  sasl_anonymous.ml
-
-  Copyright (c) 2004-2006, James H. Woodyatt
+  $Change$
+  Copyright (c) 2004-2010, James H. Woodyatt
   All rights reserved.
-
+  
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
-
+  
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
-
+    
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution
-
+  
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
         in
         let null_ = Cf_parser.fin >>= fun () -> ~:Null in
         Cf_parser.alt [ email_; token_; null_ ]
-
+    
     let to_string v =
         let b = Buffer.create 40 in
         let pp = Format.formatter_of_buffer b in
                 G.start (loop 0)
     end
 
-(*--- End of File [ sasl_anonymous.ml ] ---*)
+(*--- $File$ ---*)

sasl/sasl_anonymous.mli

 (*---------------------------------------------------------------------------*
-  INTERFACE  sasl_anonymous.mli
-