Monday, November 08, 2010 at 12:06 AM.
system.verbs.builtins.tcp.im.builtinDrivers.aim.code.core.flap_to_toc
on flap_to_toc(adrSelf,ftype,strMsg) {
if ftype == 2 {
<<B is a char (byte)
<<strMsg = strMsg + struct.pack("!B", 0)
strMsg = strMsg + '\x00'};
<<bundle // python code
<<ditems = []
<<ditems.append("*")
<<ditems.append(struct.pack("!BHH", ftype, adrSelf^._seq, len(strMsg)))
<<ditems.append(strMsg)
<<data = "".join(ditems)
local {
b1;
i1;
i2;
h1;
h2};
<<on get2Byte(val, adr)
<<local
<<msB
<<lsB
<<pack( char(val / 256), @msB)
<<pack( char(val % 256), @lsB)
<<adr^ = string(msB) + string(lsB)
pack(char(ftype),@b1);
pack(short(adrSelf^._seq), @s1);
pack(short(sizeOf(strMsg)), @s2);
dItems = "*" + string(b1) + string(s1) + string(s2) + strMsg;
tcp.im.builtinDrivers.aim.code.core.derror(adrSelf, "SEND : "+ dItems );
if not tcp.writeStringToStream(adrSelf^._socket, dItems, sizeOf(dItems), 10) {
<<#maybe make less severe later
tcp.im.builtinDrivers.aim.code.core.ferror(adrSelf,"FATAL: Couldn't send all data to TOC Server\n")};
adrSelf^._seq = adrSelf^._seq + 1;
return(true)}
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.