/[mldonkey]/mldonkey/src/utils/cdk/printf2.ml
ViewVC logotype

Diff of /mldonkey/src/utils/cdk/printf2.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by spiralvoice, Thu Jul 7 00:25:46 2005 UTC revision 1.9 by spiralvoice, Sun Jul 10 23:19:16 2005 UTC
# Line 49  let format_string format s = Line 49  let format_string format s =
49      try parse_format false 1 with Failure _ -> bad_format format 0 in      try parse_format false 1 with Failure _ -> bad_format format 0 in
50    if String.length s < p then begin    if String.length s < p then begin
51      let res = String.make p ' ' in      let res = String.make p ' ' in
52      if neg      if neg
53      then String.blit s 0 res 0 (String.length s)      then String.blit s 0 res 0 (String.length s)
54      else String.blit s 0 res (p - String.length s) (String.length s);      else String.blit s 0 res (p - String.length s) (String.length s);
55      res      res
# Line 91  let extract_format fmt start stop widths Line 91  let extract_format fmt start stop widths
91     rely on the fact that we'll get a "nul" character if we access     rely on the fact that we'll get a "nul" character if we access
92     one past the end of the string.  These "nul" characters are then     one past the end of the string.  These "nul" characters are then
93     caught by the [_ -> bad_format] clauses below.     caught by the [_ -> bad_format] clauses below.
94     Don't do this at home, kids. *)     Don't do this at home, kids. *)
95    
96  let scan_format fmt pos cont_s cont_a cont_t =  let scan_format fmt pos cont_s cont_a cont_t =
97    let rec scan_flags widths i =    let rec scan_flags widths i =
# Line 163  let scan_format fmt pos cont_s cont_a co Line 163  let scan_format fmt pos cont_s cont_a co
163      | _ ->      | _ ->
164          bad_format fmt pos          bad_format fmt pos
165    in scan_flags [] (pos + 1)    in scan_flags [] (pos + 1)
166      
167  let cprintf kont fmt =  let cprintf kont fmt =
168    let fmt = (Obj.magic fmt : string) in    let fmt = (Obj.magic fmt : string) in
169    let len = String.length fmt in    let len = String.length fmt in
# Line 222  let _ = Line 222  let _ =
222              ignore (Fifo.take lprintf_fifo)              ignore (Fifo.take lprintf_fifo)
223            else            else
224              incr lprintf_size;              incr lprintf_size;
225            Fifo.put lprintf_fifo s            Fifo.put lprintf_fifo s
226    )    )
227    
228  let detach () =  let detach () =

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26