[Nym3-commit] r20 - trunk
nym3-devel@lists.noreply.org
nym3-devel@lists.noreply.org
Fri, 14 May 2004 23:19:15 +0200
Author: jr
Date: 2004-05-14 23:19:14 +0200 (Fri, 14 May 2004)
New Revision: 20
Modified:
trunk/message.ml
Log:
Some corrections on types
Modified: trunk/message.ml
===================================================================
--- trunk/message.ml 2004-05-13 16:52:38 UTC (rev 19)
+++ trunk/message.ml 2004-05-14 21:19:14 UTC (rev 20)
@@ -27,7 +27,7 @@
(*TODO describe explicitely which data corresponds to what (int * int * string) maybe isn't explicit enough *)
(* is it necessary to separate them *)
-type command2client =
+type command2server =
Create of string list (*add the proof of work too *)
| Create2 of string
| Surb of surb list
@@ -38,7 +38,7 @@
| Delete of string list
| Policy of config_option
-type command2server =
+type command2client =
Created of string * string
| Status of int * int * int * int * string list (* do we use native int for 4 bytes length? *)
| Summary of int * string
@@ -46,22 +46,21 @@
| Dropped of string list
| Error of string * string
-(* maybe it is too vicious to replace 2serv by C (from the client) *)
-type command =
- CommandC of command2server
- | CommandS of command2client
-
-type message = header * (command list)
+type message2client = command2client list
+type message2server = header * command2server list
-let read_command buffer start =
+let read_command2client buffer start =
0,[];;
-let read_command_list s start =
+let read_command2server buffer start =
+ 0,[];;
+
+let read_command_list f s start =
let rec aux buffer start accu =
if start > (String.length buffer) then
accu
else
- let n,e = read_command buffer start in
+ let n,e = f buffer start in
aux buffer (start + n) (e::accu)
in
aux s start [];;