Notes on defcoms: ***************** Definition: Defcoms are Comm constructors. Explanation: Basically, a Comm can be seen as a string that can be split into words. The first word is the function to be called, and the next ones are the parameters of the defcom. More: - 2 first bytes of a comm are used to specify the size of the message. - I parameters are stored using Hexa format. - S parameters are stored between '"' characters, and their special characters are protected using '\' (This increases the size of the initial message). Defcoms - in DHDMS: ******************* dms/l/dhdms/smod.pkg fun _DMSsend(d,cli,c) .. _on_ cli Csend [d.graphDMI.idGRAPH mkscript c];; dms/l/dhdms/scomm.pkg fun _on_(c, m) = if !c.httpCLI then ( _on c.chnCLI m ) ... dms/l/dhdms/score.pkg defcom Csend = send I S;; srv -> ... <- cli dms/l/dhdms/ccomm.pkg fun __send(i, c) = _DMSreceive i c;; dms/l/dhdms/cmod.pkg fun _DMSreceive(i, c) = fireEvent i msgPending c;; dms/l/dhdms/cmod.pkg fun fireEvent(i, args)= ... else fireEvent2 d args 1;; dms/l/dhdms/cmod.pkg fun fireEvent2(d, args, k)= ... |(msgPending c -> _scriptc d.chnDMI strcat "__" c) ... What is important here is to see that Comms are only strings and that the way the DHDMS is implementing defcoms is built on a double Comm construction process. This causes double special characters protection (4x because first protection doubles the number of special characters through the \) Defcoms - Comm constructor: *************************** src/kernel/baselib.cpp MBcom() MBcom2() Defcoms - Sender side: ********************** src/kernel/scolsys.cpp SCon() src/kernel/fifo.c SCsendpile() SCwrite() SCwritebis() >SCKsend() SCKrecv() src/kernel/fifo.c >SCread() > SCreadbis() > SCreadchar() < SCreadchar ret < SCreadbis ret