summaryrefslogtreecommitdiff
path: root/appl/demo
diff options
context:
space:
mode:
Diffstat (limited to 'appl/demo')
-rw-r--r--appl/demo/camera/camera.b2557
-rw-r--r--appl/demo/camera/camera.disbin0 -> 37619 bytes
-rw-r--r--appl/demo/camera/camera.sbl6687
-rw-r--r--appl/demo/camera/camload.bitbin0 -> 53700 bytes
-rw-r--r--appl/demo/camera/camproc.bitbin0 -> 7650 bytes
-rw-r--r--appl/demo/camera/mkfile42
-rwxr-xr-xappl/demo/camera/runcam.sh3
-rwxr-xr-xappl/demo/camera/runcamlocal.sh3
-rw-r--r--appl/demo/camera/tkinterface.b2508
-rw-r--r--appl/demo/camera/tkinterface.disbin0 -> 56826 bytes
-rw-r--r--appl/demo/camera/tkinterface.sbl7950
-rw-r--r--appl/demo/chat/chat.b203
-rw-r--r--appl/demo/chat/chat.disbin0 -> 3995 bytes
-rw-r--r--appl/demo/chat/chat.sbl695
-rwxr-xr-xappl/demo/chat/chatclient.sh20
-rw-r--r--appl/demo/chat/chatsrv.b268
-rw-r--r--appl/demo/chat/chatsrv.disbin0 -> 4058 bytes
-rw-r--r--appl/demo/chat/chatsrv.sbl938
-rw-r--r--appl/demo/chat/mkfile30
-rw-r--r--appl/demo/cpupool/mkfile26
-rw-r--r--appl/demo/cpupool/regpoll.b63
-rw-r--r--appl/demo/cpupool/regpoll.disbin0 -> 904 bytes
-rw-r--r--appl/demo/cpupool/regpoll.sbl262
-rwxr-xr-xappl/demo/cpupool/runrstyx.sh50
-rw-r--r--appl/demo/lego/clockface.b367
-rw-r--r--appl/demo/lego/clockface.disbin0 -> 4676 bytes
-rw-r--r--appl/demo/lego/clockface.sbl998
-rw-r--r--appl/demo/lego/clockreg.sh17
-rw-r--r--appl/demo/lego/firmdl.b294
-rw-r--r--appl/demo/lego/firmdl.disbin0 -> 4423 bytes
-rw-r--r--appl/demo/lego/firmdl.sbl819
-rw-r--r--appl/demo/lego/legolink.b601
-rw-r--r--appl/demo/lego/legolink.disbin0 -> 6591 bytes
-rw-r--r--appl/demo/lego/legolink.sbl1298
-rw-r--r--appl/demo/lego/mkfile36
-rw-r--r--appl/demo/lego/rcxsend.b240
-rw-r--r--appl/demo/lego/rcxsend.disbin0 -> 3000 bytes
-rw-r--r--appl/demo/lego/rcxsend.m4
-rw-r--r--appl/demo/lego/rcxsend.sbl552
-rwxr-xr-xappl/demo/lego/styx.srec329
-rw-r--r--appl/demo/lego/timers.b263
-rw-r--r--appl/demo/lego/timers.disbin0 -> 1645 bytes
-rw-r--r--appl/demo/lego/timers.m15
-rw-r--r--appl/demo/lego/timers.sbl441
-rw-r--r--appl/demo/mkfile14
-rw-r--r--appl/demo/ns/mkfile27
-rw-r--r--appl/demo/ns/ns.b124
-rw-r--r--appl/demo/ns/ns.disbin0 -> 1973 bytes
-rw-r--r--appl/demo/ns/ns.sbl420
-rwxr-xr-xappl/demo/ns/runns.sh7
-rw-r--r--appl/demo/odbc/mkfile31
-rw-r--r--appl/demo/odbc/odbcmnt.b428
-rw-r--r--appl/demo/odbc/odbcmnt.disbin0 -> 8085 bytes
-rw-r--r--appl/demo/odbc/odbcmnt.sbl1602
-rwxr-xr-xappl/demo/odbc/runodbc.sh17
-rw-r--r--appl/demo/spree/mkfile23
-rwxr-xr-xappl/demo/spree/spreeclient.sh44
-rw-r--r--appl/demo/whiteboard/mkfile28
-rwxr-xr-xappl/demo/whiteboard/runwb.sh7
-rw-r--r--appl/demo/whiteboard/wbsrv.b268
-rw-r--r--appl/demo/whiteboard/wbsrv.disbin0 -> 3717 bytes
-rw-r--r--appl/demo/whiteboard/wbsrv.sbl818
-rw-r--r--appl/demo/whiteboard/whiteboard.b605
-rw-r--r--appl/demo/whiteboard/whiteboard.disbin0 -> 11229 bytes
-rw-r--r--appl/demo/whiteboard/whiteboard.sbl1880
65 files changed, 34922 insertions, 0 deletions
diff --git a/appl/demo/camera/camera.b b/appl/demo/camera/camera.b
new file mode 100644
index 00000000..9bfff91b
--- /dev/null
+++ b/appl/demo/camera/camera.b
@@ -0,0 +1,2557 @@
+implement Camera;
+
+include "sys.m";
+ sys : Sys;
+include "daytime.m";
+ daytime: Daytime;
+include "styx.m";
+ styx: Styx;
+ Rmsg, Tmsg: import styx;
+include "styxservers.m";
+ styxservers: Styxservers;
+ Fid, Navigator, Navop: import styxservers;
+ Styxserver, Eexists, Eperm, Ebadfid, Enotdir, Enotfound, Ebadarg: import styxservers;
+ nametree: Nametree;
+ Tree: import nametree;
+include "string.m";
+ str : String;
+include "draw.m";
+include "arg.m";
+
+Camera : module {
+ init : fn (nil : ref Draw->Context, argv : list of string);
+};
+
+cdp_get_product_info: con 16r01;
+cdp_get_image_specifications: con 16r02;
+cdp_get_camera_status: con 16r03;
+cdp_set_product_info: con 16r05;
+cdp_get_camera_capabilities: con 16r10;
+cdp_get_camera_state: con 16r11;
+cdp_set_camera_state: con 16r12;
+cdp_get_camera_defaults: con 16r13;
+cdp_set_camera_defaults: con 16r14;
+cdp_restore_camera_states: con 16r15;
+cdp_get_scene_analysis: con 16r18;
+cdp_get_power_mode: con 16r19;
+cdp_set_power_mode: con 16r1a;
+cdp_get_s1_mode: con 16r1d;
+cdp_set_s1_mode: con 16r1e;
+cdp_start_capture: con 16r30;
+cdp_get_file_list: con 16r40;
+cdp_get_new_file_list: con 16r41;
+cdp_get_file_data: con 16r42;
+cdp_erase_file: con 16r43;
+cdp_get_storage_status: con 16r44;
+cdp_set_file_data: con 16r47;
+cdp_get_file_tag: con 16r48;
+cdp_set_user_file_tag: con 16r49;
+cdp_get_clock: con 16r70;
+cdp_set_clock: con 16r71;
+cdp_get_error: con 16r78;
+cdp_get_interface_timeout: con 16r90;
+cdp_set_interface_timeout: con 16r91;
+
+cdp_header_len: con 12;
+
+T_DIR: con 0;
+T_CTL: con 1;
+T_ABILITIES: con 2;
+T_TIME: con 3;
+T_JPGDIR: con 4;
+T_JPG: con 5;
+T_STORAGE: con 6;
+T_POWER: con 7;
+T_THUMB: con 8;
+T_THUMBDIR: con 9;
+T_STATE: con 10;
+T_INTERFACE: con 11;
+
+MAXFILESIZE : con 5000000;
+TIMEOUT : con 4000;
+
+nextjpgqid, nexttmbqid, dirqid, Qctl, Qabl, Qstore: int;
+Qstate, Qtime, Qjpgdir, Qpwr, Qthumbdir, Qinterface : int;
+
+error_table := array [] of {
+ "No Error",
+ "Unimplemented",
+ "Unsupported Version",
+ "Application Timeout",
+ "Internal Error",
+ "Parameter Error",
+ "File System Null",
+ "File Not Found",
+ "Data Section Not Found",
+ "Invalid File Type",
+ "Unknown Drive",
+ "Drive Not Mounted",
+ "System Busy",
+ "Battery Low",
+};
+
+bintro := array [] of {
+ byte 16ra5,
+ byte 16r5a,
+ byte 16r00,
+ byte 16rc8,
+ byte 16r00,
+ byte 16r02,
+ byte 16rc9,
+};
+
+bak := array [] of {
+ byte 16r5a, # 2 byte header
+ byte 16ra5,
+ byte 16r55, # I/F Type
+ byte 16r00, # Comm Flag
+ byte 16r00,
+ byte 16r00,
+ byte 16r00,
+ byte 16r00,
+ byte 16r00,
+ byte 16r00,
+ byte 16r00,
+ byte 16r00,
+ byte 16r00,
+};
+
+pwl := array[] of {
+ byte 0,
+ byte 0,
+};
+
+pak := array [] of {
+ byte 0,
+ byte 0,
+};
+
+SERIAL, USB, IRDA: con (1<<iota);
+BEACON, BEACONRESULT: con (1<<iota);
+
+Camera_adt: adt {
+ port_type: int;
+ port_num: int;
+ command: int;
+ mode: int;
+ fd: ref Sys->FD;
+ ctlfd: ref Sys->FD;
+ cdp: array of byte;
+ bufbytes: int;
+ baud: int;
+ dfs, hfs: int; # device and host frame sizes
+ stat: int; # eia status file
+};
+
+statopt := array[] of {
+ "status",
+ "stat",
+};
+
+DL_QUANTA: con 20000;
+
+TOUT: con -1729;
+
+Partialtag: adt {
+ offset, length, filesize: int;
+};
+
+Cfile: adt {
+ driveno: int;
+ pathname: array of byte;
+ dosname: array of byte;
+ filelength: int;
+ filestatus: int;
+ thumblength: int;
+ thumbqid: int;
+};
+
+Fitem : adt {
+ qid: Sys->Qid;
+ cf: Cfile;
+};
+
+C: Camera_adt;
+
+filelist: array of Fitem;
+reslength: int;
+currentstate := "";
+wait : int;
+usecache := 0;
+connected : int;
+recon := 0;
+verbosity := 4;
+interfacepath := "";
+interfacepaths : array of string;
+camname := "";
+gpid : int;
+
+init(nil : ref Draw->Context, argv : list of string)
+{
+ err: string;
+ sys = load Sys Sys->PATH;
+ gpid = sys->pctl(Sys->NEWPGRP, nil);
+
+ str = load String String->PATH;
+ daytime = load Daytime Daytime->PATH;
+
+ styx = load Styx Styx->PATH;
+ styx->init();
+ styxservers = load Styxservers Styxservers->PATH;
+ styxservers->init(styx);
+ nametree = load Nametree Nametree->PATH;
+ nametree->init();
+ arg := load Arg Arg->PATH;
+
+ filelist = array[200] of Fitem;
+ C.port_num = 0; # XXXXX from argv
+ C.port_type = SERIAL; # Serial only for now
+ C.baud = 115200;
+ C.dfs = C.hfs = 1023;
+ C.cdp = array [DL_QUANTA] of byte;
+ C.mode = BEACON;
+
+ ex.pnum = -1;
+ ex.offset = -1;
+ cachelist = nil;
+
+ nextjpgqid = getqid(1, T_JPG);
+ nexttmbqid = getqid(1, T_THUMB);
+ dirqid = getqid(1,T_JPGDIR);
+ Qctl = getqid(Qroot,T_CTL);
+ Qabl = getqid(Qroot,T_ABILITIES);
+ Qstore = getqid(Qroot,T_STORAGE);
+ Qtime = getqid(Qroot,T_TIME);
+ Qstate = getqid(Qroot,T_STATE);
+ Qpwr = getqid(Qroot,T_POWER);
+ Qjpgdir = getqid(Qroot,T_JPGDIR);
+ Qthumbdir = getqid(Qroot,T_THUMBDIR);
+ Qinterface = getqid(Qroot,T_INTERFACE);
+
+ camname = "Camera";
+ extrafilelist: list of string = nil;
+ arg->init(argv);
+ arg->setusage("camera [-b baud] [-F framesize] [-f extrafiles] [-p port] [-n name] [-v verbosity]");
+ while ((opt := arg->opt()) != 0) {
+ case opt {
+ 'n' =>
+ camname = arg->earg();
+ 'v' =>
+ verbosity = int arg->earg();
+ 'F' =>
+ C.dfs = C.hfs = int arg->earg();
+ 'b' =>
+ C.baud = int arg->earg();
+ 'p' =>
+ C.port_num = int arg->earg();
+ 'c' =>
+ usecache = 1;
+ 'f' =>
+ extrafilelist = arg->earg() :: extrafilelist;
+ * =>
+ arg->usage();
+ }
+ }
+ arg = nil;
+ interfacepaths = array[len extrafilelist] of string;
+ # sys->print("INTERFACEPATHS: %d\n", len extrafilelist);
+ for (i := 0; i < len interfacepaths; i++) {
+ interfacepaths[i] = hd extrafilelist;
+ # sys->print("INTERFACEPATH %d: %s\n", i, hd extrafilelist);
+ extrafilelist = tl extrafilelist;
+ }
+
+ print(sys->sprint("Trying to connect to eia%d...\n",C.port_num),2);
+ case C.port_type {
+ SERIAL =>
+ # open port and return fd
+ (C.fd, C.ctlfd, err) = serialport(C.port_num);
+ if (C.fd == nil) {
+ print("Could not open serial port\n",1);
+ exit;
+ }
+ USB =>
+ ;
+ IRDA =>
+ ;
+ * =>
+ ;
+ }
+ if (connect() != 0) {;
+ print("Connection failed\n",1);
+ exit;
+ }
+ recon = 0;
+ print("Connected!\n",2);
+ set_interface_timeout();
+ set_camera_properties();
+ get_file_list();
+ connected = 1;
+ ignoreabls = nil;
+ get_camera_capabilities();
+ sync := chan of int;
+ spawn serveloop(sys->fildes(0), sync);
+ <-sync;
+}
+
+set_camera_properties()
+{
+ for (i := 0; i < len set_camera_props; i++)
+ set_camera_state(set_camera_props[i].t0,set_camera_props[i].t1);
+}
+
+set_camera_props := array[] of {
+ ("mcap", 0),
+ ("acpd", 65535),
+ ("actc", 65535),
+ ("btpd", 65535),
+ ("bttc", 65535),
+ ("flty", 1246774599),
+ ("ssvl", 0),
+};
+
+argval(argv: list of string, arg: string): string
+{
+ if (arg == "") return "";
+ if (arg[0] != '-') arg = "-" + arg;
+ while (argv != nil) {
+ if (hd argv == arg && tl argv != nil && (hd tl argv)[0] != '-')
+ return tonext(tl argv);
+ argv = tl argv;
+ }
+ return "";
+}
+
+tonext(los: list of string): string
+{
+ s := "";
+ while (los != nil) {
+ if ((hd los)[0] != '-') s += " " + hd los;
+ else break;
+ los = tl los;
+ }
+ if (s != "") s = s[1:];
+ return s;
+}
+
+int2hex(i:int): int
+{
+ i2 := 0;
+ s := string i;
+ for (k := 0; k < len s; k++)
+ i2 = (i2 * 16) + int s[k:k+1];
+ return i2;
+}
+
+connect(): int
+{
+ connected = 0;
+ datain := chan of array of byte;
+ pchan := chan of int;
+ tick := chan of int;
+ reset(C.ctlfd);
+
+ spawn timer2(tick,TIMEOUT * 2);
+ tpid := <-tick;
+
+ spawn beacon_intro(datain, pchan, C.fd);
+ pid := <- pchan;
+ # beacon phase
+ Beacon: for (;;) {
+ alt {
+ buf := <- datain =>
+ # got some data
+ case C.mode {
+ BEACON =>
+ if (beacon_ok(buf)) {
+ print("Got beacon\n",3);
+ beacon_ack(C);
+ spawn beacon_result(datain, pchan, C.fd);
+ pid = <-pchan;
+ C.mode = BEACONRESULT;
+ break;
+ }
+ else {
+ print("resetting\n",3);
+ reset(C.ctlfd);
+ }
+ BEACONRESULT =>
+ kill(tpid);
+
+ print("Checking beacon result\n",3);
+ if (beacon_comp(buf, C) == 0) {
+ return 0;
+ break Beacon;
+ }
+ return -1;
+ }
+ <- tick =>
+ kill(pid);
+ return -1; # failure
+ }
+ }
+}
+
+CTL, ABILITIES, DATA, JPG, PIC, TIME, CONV: con iota;
+NAME, FSIZE, PHOTO, THUMB: con iota;
+
+Qdir : con iota;
+
+contains(s: string, test: string): int
+{
+ num :=0;
+ if (len test > len s) return 0;
+ for (i := 0; i < (1 + (len s) - (len test)); i++) {
+ if (test == s[i:i+len test]) num++;
+ }
+ return num;
+}
+
+abilitiesfilter := array[] of {
+ "Time Format",
+ "Date Format",
+ "File Type",
+ "Video",
+ "Media",
+ "Sound",
+ "Volume",
+ "Reset Camera",
+ "Slide",
+ "Timelapse",
+ "Burst",
+ "Power",
+ "Sleep",
+};
+
+ignoreabls : list of string;
+
+defattr : list of (string, int);
+defaultattr, currentattr: array of (string, int);
+
+filterabls(pname, desc: string): int
+{
+ for (i := 0; i < len abilitiesfilter; i++) {
+ if (contains(desc, abilitiesfilter[i])) {
+ ignoreabls = pname :: ignoreabls;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+mountit(dfd, mountfd: ref sys->FD, sync: chan of int)
+{
+ sys->pctl(sys->NEWNS | sys->NEWFD, 2 :: dfd.fd :: mountfd.fd :: nil);
+ sync <-= 1;
+ mountfd = sys->fildes(mountfd.fd);
+ dfd = sys->fildes(dfd.fd);
+ if (sys->mount(mountfd, nil, "/", sys->MREPL | sys->MCREATE, nil) == -1) {
+ sys->fprint(sys->fildes(2), "cannot mount\n");
+ spawn exporterror(dfd, sys->sprint("%r"));
+ } else {
+ sync = chan of int;
+ spawn exportpath(sync, dfd);
+ <-sync;
+ }
+}
+
+exporterror(dfd: ref Sys->FD, error: string)
+{
+ tmsg := Tmsg.read(dfd, 0);
+ if (tmsg == nil) {
+ sys->fprint(sys->fildes(2), "exporterror() EOF\n");
+ exit;
+ }
+ pick t := tmsg {
+ Readerror =>
+ sys->fprint(sys->fildes(2), "exporterror() Readerror\n");
+ * =>
+ reply: ref Rmsg = ref Rmsg.Error(tmsg.tag, error);
+ data := reply.pack();
+ sys->write(dfd, data, len data);
+ }
+}
+
+exportpath(sync: chan of int, dfd: ref sys->FD)
+{
+ sync <-= 1;
+ sys->export(dfd, "/", Sys->EXPWAIT);
+}
+
+Qroot : con int iota;
+
+ss : ref Styxserver;
+uid: string;
+
+exitfid := -1;
+
+getuid()
+{
+ buf := array [100] of byte;
+ fd := sys->open("/dev/user", Sys->OREAD);
+ uidlen := sys->read(fd, buf, len buf);
+ uid = string buf[0: uidlen];
+}
+
+dir(name: string, perm: int, length: int, qid: int): Sys->Dir
+{
+ d := sys->zerodir;
+ d.name = name;
+ d.uid = uid;
+ d.gid = uid;
+ d.qid.path = big qid;
+ if (perm & Sys->DMDIR)
+ d.qid.qtype = Sys->QTDIR;
+ else {
+ d.qid.qtype = Sys->QTFILE;
+ d.length = big length;
+ }
+ d.mode = perm;
+ d.atime = d.mtime = daytime->now();
+ return d;
+}
+
+User: adt {
+ attachfid: int;
+ attr: array of (string, int);
+};
+
+users : array of User;
+
+getuser(fid: int): int
+{
+ for (i := 0; i < len users; i++)
+ if (users[i].attachfid == fid)
+ return i;
+ return -1;
+}
+
+getattr(pname: string): int
+{
+ for (i := 0; i < len defaultattr; i++)
+ if (defaultattr[i].t0 == pname)
+ return i;
+ return -1;
+}
+
+serveloop(fd : ref sys->FD, sync: chan of int)
+{
+ tchan: chan of ref Tmsg;
+ srv: ref Styxserver;
+ echan := chan of string;
+ users = array[20] of { * => User (-1, nil) };
+ sys->pctl(Sys->FORKNS, nil);
+ sync <-= 1;
+ print("serveloop\n",5);
+ getuid();
+ (tree, treeop) := nametree->start();
+ tree.create(big Qroot, dir(".",8r555 | sys->DMDIR,0,Qroot));
+ tree.create(big Qroot, dir("ctl",8r222,0,Qctl));
+ tree.create(big Qroot, dir("abilities",8r444,0,Qabl));
+ tree.create(big Qroot, dir("storage",8r444,0,Qstore));
+ tree.create(big Qroot, dir("power",8r444,0,Qpwr));
+ tree.create(big Qroot, dir("date",8r666,0,Qtime));
+ tree.create(big Qroot, dir("state",8r666,0,Qstate));
+ tree.create(big Qroot, dir("jpg",8r777 | sys->DMDIR,0,Qjpgdir));
+ tree.create(big Qroot, dir("thumb",8r777 | sys->DMDIR,0,Qthumbdir));
+ for (j := 0; j < len interfacepaths; j++) {
+ (n, idir) := sys->stat(interfacepaths[j]);
+ if (n != -1) {
+ idir.qid.path = big Qinterface;
+ # intdir := dir("",8r777,0,Qinterface);
+ # intdir.name = idir.name;
+ # intdir.length = idir.length;
+ # intdir.atime = idir.atime;
+ # intdir.mtime = idir.mtime;
+ tree.create(big Qroot, idir);
+ Qinterface += 1<<4;
+ }
+ }
+
+ tmsgqueue := Tmsgqueue.new(50);
+
+ (tchan, srv) = Styxserver.new(fd,Navigator.new(treeop), big Qroot);
+ fd = nil;
+
+ gm, lastgm: ref Tmsg;
+ gm = nil;
+
+ oldfiles = nil;
+ updatetree(tree);
+
+ print("serveloop loop\n",5);
+ alivechan := chan of int;
+ spawn keepalive(alivechan);
+ alivepid := <-alivechan;
+ retryit := 0;
+ notries := 0;
+ readfid := -1;
+ serveloop: for (;;) {
+ wait = daytime->now();
+ if (notries > 5) retryit = 0;
+ if (retryit) {
+ gm = lastgm;
+ notries++;
+ }
+ else {
+ notries = 0;
+ loop: for (;;) {
+ gm = tmsgqueue.pop(readfid);
+ if (gm != nil)
+ break;
+ alt {
+ gm = <-tchan =>
+ break loop;
+ c := <-alivechan =>
+ for (;;) {
+ s := get_clock();
+ wait = daytime->now();
+ # print(sys->sprint("got alivechan: %s",s),1);
+ if (recon) {
+ killchan := chan of int;
+ spawn noresponse(tchan,srv,killchan);
+ reconnect(-1);
+ killchan <-= 1;
+ }
+ else
+ break;
+ }
+ }
+ }
+ }
+ lastgm = gm;
+ retryit = 0;
+ if (gm == nil) {
+ sys->print("exiting!\n");
+ break serveloop; # nil => EOF => last mount was unmounted
+ }
+ print(sys->sprint("Got new GM %s tag: %d\n", gm.text(), gm.tag),4);
+ # print(sys->sprint("Got new GM %s tag: %d\n", gm.text(), gm.tag),2);
+
+ if (!connected) {
+ srv.reply(ref Rmsg.Error(gm.tag, "Could not connect to camera"));
+ print("Error: not connected to camera\n",1);
+ }
+ else pick m := gm {
+ Readerror =>
+ print(sys->sprint( "camera: fatal read error: %s\n", m.error),1);
+ break serveloop;
+ Attach =>
+ nu := getuser(-1);
+ if (nu == -1) {
+ srv.reply(ref Rmsg.Error(m.tag, "Camera in use"));
+ break;
+ }
+ m.uname = string nu;
+ srv.default(m);
+ myattr := array[len currentattr] of (string, int);
+ for (i := 0; i < len myattr; i++)
+ myattr[i] = currentattr[i];
+ users[nu] = User (m.fid, myattr);
+ print("adding user "+string nu, 2);
+ Clunk =>
+ nu := getuser(m.fid);
+ if (nu != -1) {
+ users[nu] = User (-1, nil);
+ print("removing user "+string nu, 2);
+ }
+ if (m.fid == readfid) {
+ # sys->print("readfid clunk: %d\n",readfid);
+ readfid = -1;
+ }
+ srv.default(gm);
+ Remove =>
+ print("Removing file\n",3);
+ f := srv.getfid(m.fid);
+ if (f == nil) {
+ print("Remove: Invalid fid\n",1);
+ srv.reply(ref Rmsg.Error(m.tag, Ebadfid));
+ break;
+ }
+ ftype := gettype(int f.path);
+ if (ftype != T_JPG) {
+ srv.reply(ref Rmsg.Error(m.tag, "Cannot remove file"));
+ break;
+ }
+ else {
+ for (i := 0; i < reslength; i++) {
+ if (f.path == filelist[i].qid.path) {
+ print("removing filelist\n",5);
+ if (erase_file(filelist[i].cf) != 0) {
+ if (!recon)
+ srv.reply(ref Rmsg.Error(m.tag, "Cannot remove file"));
+ break;
+ }
+
+ srv.delfid(f);
+ if (get_file_list() != 0)
+ srv.reply(ref Rmsg.Error(m.tag, "Cannot read files"));
+ else {
+ updatetree(tree);
+ srv.reply(ref Rmsg.Remove(m.tag));
+ }
+ break;
+ }
+ }
+ }
+ Read =>
+ print("got read request in serveloop\n",6);
+ (f,e) := srv.canread(m);
+ if(f == nil)
+ break;
+ if (f.qtype & Sys->QTDIR) {
+ print("reading directory\n",5);
+ srv.read(m);
+ break;
+ }
+ data : array of byte;
+ case gettype(int f.path) {
+ T_INTERFACE =>
+ (dir, intdata) := readinterface(int f.path, m.offset, m.count);
+ if (dir != nil && m.offset == big 0) {
+ dir.qid.path = f.path;
+ tree.wstat(f.path, *dir);
+ }
+ srv.reply(ref Rmsg.Read(m.tag, intdata));
+ T_POWER =>
+ print("reading power mode...\n",3);
+ data = array of byte get_power_mode();
+ if (!recon) srv.reply(styxservers->readbytes(m, data));
+
+ T_TIME =>
+ print("reading clock...\n",3);
+ data = array of byte get_clock();
+ if (!recon)
+ srv.reply(styxservers->readbytes(m, data));
+
+ T_ABILITIES =>
+ data = array of byte get_camera_capabilities();
+ if (!recon)
+ srv.reply(styxservers->readbytes(m, data));
+
+ T_JPG =>
+ # sys->print("Read Jpg: user %d\n", int f.uname);
+ if (readfid != -1 && readfid != m.fid) {
+ tmsgqueue.push(m);
+ # sys->print("in use!\n");
+ # srv.reply(ref Rmsg.Error(m.tag, "Camera in use, please wait"));
+ break;
+ }
+ readfid = m.fid;
+ data = photoread2(f.path, m,tree,0);
+ if (!recon)
+ srv.reply(ref Rmsg.Read(m.tag, data));
+
+ T_THUMB =>
+ if (readfid != -1 && readfid != m.fid) {
+ # srv.reply(ref Rmsg.Error(m.tag, "Camera in use, please wait"));
+ tmsgqueue.push(m);
+ break;
+ }
+ readfid = m.fid;
+ # sys->print("Read Thumb: user %d\n", int f.uname);
+ data = photoread2(f.path, m,tree,1);
+ if (!recon)
+ srv.reply(ref Rmsg.Read(m.tag, data));
+
+ T_STATE =>
+ if (currentstate == "") srv.reply(ref Rmsg.Error(m.tag, "No state requested"));
+ else {
+ data = array of byte get_camera_state(currentstate,int m.offset);
+ if (!recon)
+ srv.reply(ref Rmsg.Read(m.tag, data));
+ }
+
+ T_STORAGE =>
+ data = array of byte get_storage_status();
+ if (!recon) {
+ if (len data == 0)
+ srv.reply(ref Rmsg.Error(m.tag, "Could not read storage status"));
+ else
+ srv.reply(styxservers->readbytes(m, data));
+ }
+ * =>
+ srv.reply(ref Rmsg.Error(m.tag, "Cannot read file"));
+ }
+ # if (readfid != -1)
+ # sys->print("readfid set: %d\n",readfid);
+ Write =>
+ print("got write request in serveloop\n",6);
+
+ (f,e) := srv.canwrite(m);
+ if(f == nil) {
+ print("cannot write to file\n",1);
+ break;
+ }
+ wtype := gettype(int f.path);
+ (n, s) := sys->tokenize(string m.data, " \t\n");
+ if (wtype == T_TIME) {
+ if (set_clock(string m.data) != 0)
+ srv.reply(ref Rmsg.Error(m.tag, "Invalid date time format\n" +
+ "Usage: MM/DD/YY HH/MM/SS\n"));
+ else srv.reply(ref Rmsg.Write(m.tag, len m.data));
+
+ }
+ else if (wtype == T_CTL) {
+ err := "";
+ case hd s {
+ "refresh" =>
+ # for (i := 0; i < reslength; i++) {
+ # tree.remove(filelist[i].qid.path);
+ # tree.remove(big filelist[i].cf.thumbqid);
+ # }
+ if (get_file_list() != 0)
+ err = "Error: Could not read from camera";
+ else
+ updatetree(tree);
+ # for (i = 0; i < reslength; i++)
+ # buildfilelist(tree, i);
+ "snap" =>
+ nu := int f.uname;
+ print(sys->sprint("User %d taking photo\n",nu),2);
+ for (i := 0; i < len currentattr; i++) {
+ # sys->print("user: %s=%d current: %s=%d\n",
+ # users[nu].attr[i].t0,users[nu].attr[i].t1,
+ # currentattr[i].t0,currentattr[i].t1);
+ if (users[nu].attr[i].t1 != currentattr[i].t1) {
+ set_camera_state(users[nu].attr[i].t0, users[nu].attr[i].t1);
+ sys->sleep(100);
+ }
+ }
+ e1 := capture();
+ if (e1 == -1) {
+ err = "Cannot communicate with camera";
+ break;
+ }
+ if (e1 != 0) {
+ err = "Error: "+error_table[e1];
+ break;
+ }
+ sys->sleep(4000);
+ if (get_file_list() != 0) {
+ err = "Error: Could not read from camera";
+ break;
+ }
+ updatetree(tree);
+ * =>
+ if (n == 2) { # assume that it is a (string, int) tuple
+ na := getattr(hd s);
+ if (na == -1)
+ err = "Invalid command name '"+hd s+"'";
+ else {
+ e1 := set_camera_state(hd s, int hd tl s);
+ if (e1 != nil)
+ err = e;
+ else
+ users[int f.uname].attr[na].t1 = int hd tl s;
+ }
+ }
+
+ }
+
+ if (!recon) {
+ if (err != "") {
+ print(err+"\n",1);
+ srv.reply(ref Rmsg.Error(m.tag, err));
+ }
+ else srv.reply(ref Rmsg.Write(m.tag, len m.data));
+ }
+ }
+ else if (wtype == T_STATE) {
+ if (s != nil)
+ currentstate = hd s;
+ srv.reply(ref Rmsg.Write(m.tag, len m.data));
+ }
+ else srv.reply(ref Rmsg.Error(m.tag, "Could not write to file"));
+ Wstat =>
+ print("Got Wstat command in serveloop\n",6);
+ srv.reply(ref Rmsg.Error(m.tag, "Wstat failed"));
+ * =>
+ srv.default(gm);
+ }
+ if (recon) {
+ retryit = 1;
+ ok := reconnect(4);
+ if (!ok) {
+ srv.reply(ref Rmsg.Error(gm.tag, "Could not connect to camera"));
+ killchan := chan of int;
+ spawn noresponse(tchan,srv,killchan);
+ reconnect(-1);
+ killchan <-= 1;
+ retryit = 0;
+ sys->sleep(100);
+ }
+ }
+ }
+ tree.quit();
+ kill(alivepid);
+ killg(gpid);
+}
+
+Tmsgqueue: adt {
+ start, end, length: int;
+ a : array of ref Tmsg.Read;
+ new: fn (n: int): ref Tmsgqueue;
+ push: fn (t: self ref Tmsgqueue, t: ref Tmsg.Read): int;
+ pop: fn (t: self ref Tmsgqueue, readfid: int): ref Tmsg.Read;
+};
+
+Tmsgqueue.new(n: int): ref Tmsgqueue
+{
+ t : Tmsgqueue;
+ t.start = 0;
+ t.end = 0;
+ t.length = 0;
+ t.a = array[n] of ref Tmsg.Read;
+ return ref t;
+}
+
+Tmsgqueue.push(t: self ref Tmsgqueue,newt: ref Tmsg.Read): int
+{
+ if (t.length >= len t.a)
+ return -1;
+ t.a[t.end] = newt;
+ t.end++;
+ if (t.end >= len t.a)
+ t.end = 0;
+ t.length++;
+ return 0;
+}
+
+Tmsgqueue.pop(t: self ref Tmsgqueue, readfid: int): ref Tmsg.Read
+{
+ if (t.length == 0)
+ return nil;
+ m := t.a[t.start];
+ if (readfid != -1 && readfid != m.fid)
+ return nil;
+ t.start++;
+ if (t.start >= len t.a)
+ t.start = 0;
+ t.length--;
+ return m;
+}
+
+noresponse(tchan: chan of ref Tmsg, srv: ref Styxservers->Styxserver, killchan : chan of int)
+{
+ for (;;) alt {
+ k := <- killchan =>
+ return;
+ gm := <- tchan =>
+ print("noresponse: Returning Error\n",1);
+ srv.reply(ref Rmsg.Error(gm.tag, "Could not connect to camera"));
+ sys->sleep(100);
+ }
+}
+
+photoread2(qid: big, m: ref Tmsg.Read, tree: ref Nametree->Tree, isthumb: int): array of byte
+{
+ photonum := -1;
+ data : array of byte;
+ # sys->print("photoread: qid: %d resl: %d\n",int qid,reslength);
+ for (i := 0; i < reslength; i++) {
+ # sys->print("%d: %s %d\n",i, sconv(filelist[i].cf.dosname),int filelist[i].qid.path);
+ if (!isthumb && qid == filelist[i].qid.path) {
+ photonum = i;
+ break;
+ }
+ else if (isthumb && int qid == filelist[i].cf.thumbqid) {
+ photonum = i;
+ break;
+ }
+ }
+ if (photonum >= reslength || photonum < 0) {
+ print(sys->sprint( "error: photonum = %d (reslength = %d)\n", photonum,reslength),1);
+ return nil;
+ }
+ offset := int m.offset;
+ dosname := filelist[photonum].cf.dosname;
+ filelen := filelist[photonum].cf.filelength;
+ for (k := 0; k < 5; k++) {
+ if (filelen == 0) {
+ get_file_size(photonum);
+ print(sys->sprint("\tFilelen: %d => ",filelen),5);
+ filelen = filelist[photonum].cf.filelength;
+ print(sys->sprint("%d\n",filelen),5);
+ tree.wstat(qid,
+ dir(str->tolower(sconv(filelist[photonum].cf.dosname)),
+ 8r444,
+ filelen,
+ int qid));
+ sys->sleep(1000);
+ }
+ else break;
+ }
+ if (filelen == 0 && !isthumb) return nil; # doesn't matter if filesize is wrong for thumbnail
+ if (isthumb) filelen = filelist[photonum].cf.thumblength;
+ if (usecache && cachesize(dosname, isthumb) == filelen) {
+# print(sys->sprint("Is cached!\n");
+ n := m.count;
+ filesize := cachesize(dosname,isthumb);
+ if (offset >= filesize) return nil;
+ if (offset+m.count >= filesize) n = filesize - offset;
+ data = array[n] of byte;
+ fd := sys->open(cachename(dosname,isthumb), sys->OREAD);
+ if (fd == nil) cachedel(dosname,isthumb);
+ else {
+ sys->seek(fd,m.offset,sys->SEEKSTART);
+ sys->read(fd,data,len data);
+ fd = nil;
+ return data;
+ }
+ }
+# print(sys->sprint("Is NOT cached!\n");
+
+ if (photonum == ex.pnum && offset == ex.offset && ex.isthumb == isthumb)
+ data = ex.data;
+ else if (isthumb)
+ data = getthumb(photonum, offset, m.count);
+ else if (!isthumb)
+ data = getpicture2(photonum, offset, m.count);
+ if (len data > m.count) {
+ ex.pnum = photonum;
+ ex.offset = offset + m.count;
+ ex.data = array[len data - m.count] of byte;
+ ex.data[0:] = data[m.count:len data];
+ ex.isthumb = isthumb;
+ data = data[:m.count];
+ }
+ if (usecache) {
+ fd : ref sys->FD;
+ cname := cachename(dosname,isthumb);
+
+ if (offset == 0)
+ fd = sys->create(cname,sys->OWRITE,8r666);
+ else {
+ fd = sys->open(cname,sys->OWRITE);
+ if (fd != nil)
+ sys->seek(fd,big 0,sys->SEEKEND);
+ }
+ if (fd != nil) {
+ i = sys->write(fd,data,len data);
+ fd = nil;
+ }
+ (n, dir) := sys->stat(cname);
+ if (n == 0) {
+ cacheadd(dosname,isthumb,int dir.length);
+ }
+ }
+ return data;
+}
+
+cachelist : list of (string, int, int);
+
+cacheprint()
+{
+ tmp := cachelist;
+ print("cache:\n",3);
+ while (tmp != nil) {
+ (dn,i1,i2) := hd tmp;
+ print(sys->sprint("\t%s %d %d\n",dn,i1,i2),3);
+ tmp = tl tmp;
+ }
+}
+
+cacheclean()
+{
+ tmp : list of (string, int,int);
+ tmp = nil;
+ while (cachelist != nil) {
+ (dosnm,it,fl) := hd cachelist;
+ for (i := 0; i < reslength; i++) {
+ filelen := filelist[i].cf.filelength;
+ if (it) filelen = filelist[i].cf.thumblength;
+ if (sconv(filelist[i].cf.dosname) == dosnm && filelen == fl) {
+ tmp = (dosnm,it,fl) :: tmp;
+ break;
+ }
+ }
+ cachelist = tl cachelist;
+ }
+ cachelist = tmp;
+}
+
+cacheadd(dosname1: array of byte, isthumb, filelen: int)
+{
+ dosname := sconv(dosname1);
+ tmp : list of (string, int,int);
+ tmp = nil;
+ updated := 0;
+ while (cachelist != nil) {
+ (dosnm,it,fl) := hd cachelist;
+ if (dosname == dosnm && it == isthumb) {
+ updated = 1;
+ tmp = (dosnm,it,filelen) :: tmp;
+ }
+ else
+ tmp = (dosnm,it,fl) :: tmp;
+ cachelist = tl cachelist;
+ }
+ if (updated == 0)
+ tmp = (dosname,isthumb,filelen) :: tmp;
+ cachelist = tmp;
+}
+
+
+cachedel(dosname1: array of byte, isthumb: int)
+{
+ dosname := sconv(dosname1);
+ tmp : list of (string, int,int);
+ tmp = nil;
+ while (cachelist != nil) {
+ (dosnm,it,filelen) := hd cachelist;
+ if (dosname != dosnm || it != isthumb)
+ tmp = (dosnm,it,filelen) :: tmp;
+ cachelist = tl cachelist;
+ }
+ cachelist = tmp;
+}
+
+cachesize(dosname1: array of byte, isthumb: int): int
+{
+ dosname := sconv(dosname1);
+ tmp := cachelist;
+ while (tmp != nil) {
+ (dosnm,it,filelen) := hd tmp;
+ if (dosname == dosnm && isthumb == it) return filelen;
+ tmp = tl tmp;
+ }
+ return -1;
+}
+
+cachename(dosname: array of byte, isthumb: int): string
+{
+ name := "/tmp/" + str->tolower(sconv(dosname));
+ if (isthumb) name = jpg2bit(name);
+ name[len name - 1] = '~';
+ return name;
+}
+
+poll_and_wait(): int
+{
+ print("poll and wait\n",7);
+ write_n(C.fd, pwl, len pwl);
+# sys->sleep(100);
+ if (read_n_to(C.fd, pak, len pak,TIMEOUT) < 0) {
+ print("poll_and_wait: unexpected read failure, exiting...\n",1);
+ return -1;
+ }
+ return 0;
+}
+
+send_packet(): int
+{
+ # computing packet size
+ to_write := C.bufbytes;
+
+ # send the first packet
+ pwl[0] = byte ((1<<5)|(1<<4)|(1<<3)|(1<<2)|(to_write>>8));
+ pwl[1] = byte (to_write&16rff);
+
+ if (poll_and_wait() != 0)
+ return -1;
+# pak[1] == byte 2; ?
+ pak[1] = byte 2;
+
+ wrote_here := write_n(C.fd, C.cdp, to_write);
+ if (wrote_here != to_write)
+ return -1;
+ return 0;
+}
+
+send_message(): int
+{
+ v:= 0;
+ rc := chan of int;
+ tc := chan of int;
+
+ spawn timer2(tc,6000);
+ tpid := <- tc;
+ spawn write_message(rc);
+ rpid := <- rc;
+
+ try := 0;
+ alt {
+ <- tc =>
+ kill(rpid);
+ print("error: write timeout\n",1);
+ v = -2;
+ break;
+ v = <- rc =>
+ kill(tpid);
+ break;
+ }
+ return v;
+}
+
+write_message(rc: chan of int)
+{
+ print("writing msg...\n",6);
+ rc <- = sys->pctl(0, nil);
+ if (send_packet() != 0) {
+ rc <-= -1;
+ return;
+ }
+ pwl[0] = byte 0;
+ pwl[1] = byte 0;
+ wrote_here := write_n(C.fd, pwl, 2);
+ if (wrote_here != 2) {
+ rc <-= -1;
+ return;
+ }
+ rc <-= 0;
+ print("written\n",6);
+}
+
+extra: adt {
+ pnum: int;
+ offset: int;
+ length: int;
+ data: array of byte;
+ isthumb: int;
+};
+
+ex : extra;
+
+getthumb(photonum, offset, maxlength: int): array of byte
+{
+ if (offset != 0) return nil;
+ print("getting thumbnail\n",3);
+ thumbdata: array of byte;
+ err, h, w, ttype: int;
+ file := filelist[photonum].cf;
+ filesize := 13020;
+ if (offset > 0) {
+ filesize = file.thumblength;
+ if (offset >= filesize) return nil;
+ }
+ for(;;){
+ print(sys->sprint("Filesize: %d offset: %d\n",filesize, offset),5);
+ if (offset + maxlength > filesize)
+ maxlength = filesize - offset;
+ l := maxlength;
+
+ C.command = cdp_get_file_data;
+ C.bufbytes = build_cdp_header(C.cdp, 68);
+ off := cdp_header_len;
+ off = set_int(C.cdp[off:], file.driveno, off);
+ off = set_fstring(C.cdp[off:], file.pathname, off);
+ off = set_dosname(C.cdp[off:], file.dosname, off);
+ off = set_int(C.cdp[off:], 1, off);
+
+ off = set_int(C.cdp[off:], offset, off);
+ off = set_int(C.cdp[off:], l, off);
+ off = set_int(C.cdp[off:], filesize, off);
+
+ print(sys->sprint( "getthumbdata %d %d %d\n", offset, maxlength, filesize),5);
+ send_message();
+# sys->sleep(2000);
+ if ((err = receive_message()) != 0) {
+ print(sys->sprint("Error %d\n", err),1);
+ return nil;
+ }
+ off = cdp_header_len;
+ print(sys->sprint( "bufbytes = %d\n", C.bufbytes),5);
+ tmpoffset: int;
+ (tmpoffset, off) = get_int(C.cdp[off:], off);
+ (l, off) = get_int(C.cdp[off:], off);
+ (filesize, off) = get_int(C.cdp[off:], off);
+ print(sys->sprint( "getthumbdata returning %d %d %d\n", offset, l, filesize),5);
+
+ if (offset == 0) {
+ (filesize, off) = get_int(C.cdp[off:off+4], off);
+ (h, off) = get_int(C.cdp[off:off+4], off);
+ (w, off) = get_int(C.cdp[off:off+4], off);
+ (ttype, off) = get_int(C.cdp[off:off+4], off);
+ filelist[photonum].cf.thumblength = filesize;
+ thumbdata = array[filesize] of byte;
+ print(sys->sprint("Thumb (%d,%d) size: %d type: %d\n",w,h,filesize,ttype),5);
+ }
+ if (offset + l > filesize) l = filesize - offset;
+ print(sys->sprint( "Making array of size: %d\n", l),5);
+ thumbdata[offset:] = C.cdp[off:off+l];
+ offset += l;
+ if (offset >= filesize) break;
+ }
+ return thumb2bit(thumbdata,w,h);
+}
+
+getpicture2(photonum, offset, maxlength: int): array of byte
+{
+ file := filelist[photonum].cf;
+ filesize := int file.filelength;
+ print("getting image\n",3);
+ print(sys->sprint("Filesize: %d offset: %d\n",filesize, offset),5);
+ if (offset >= filesize) return nil;
+ if (offset + maxlength > filesize)
+ maxlength = filesize - offset;
+ l := maxlength;
+ C.command = cdp_get_file_data;
+ C.bufbytes = build_cdp_header(C.cdp, 68);
+ off := cdp_header_len;
+ off = set_int(C.cdp[off:], file.driveno, off);
+ off = set_fstring(C.cdp[off:], file.pathname, off);
+ off = set_dosname(C.cdp[off:], file.dosname, off);
+ off = set_int(C.cdp[off:], 0, off);
+
+ off = set_int(C.cdp[off:], offset, off);
+ off = set_int(C.cdp[off:], l, off);
+ off = set_int(C.cdp[off:], filesize, off);
+
+ print(sys->sprint( "getfiledata %d %d %d\n", offset, maxlength, filesize),5);
+ send_message();
+ if ((err := receive_message()) != 0) {
+ print(sys->sprint("Error %d\n", err),1);
+ return nil;
+ }
+ off = cdp_header_len;
+ print(sys->sprint( "bufbytes = %d\n", C.bufbytes),5);
+ (offset, off) = get_int(C.cdp[off:], off);
+ (l, off) = get_int(C.cdp[off:], off);
+ (filesize, off) = get_int(C.cdp[off:], off);
+ print(sys->sprint( "getfiledata returning %d %d %d\n", offset, maxlength, filesize),5);
+ filedata := array[l] of byte;
+ filedata[0:] = C.cdp[off:off+l];
+ return filedata;
+}
+
+erase_file(file: Cfile): int
+{
+ C.command = cdp_erase_file;
+ C.bufbytes = build_cdp_header(C.cdp, 52);
+
+ off := cdp_header_len;
+ off = set_int(C.cdp[off:], file.driveno, off);
+ off = set_fstring(C.cdp[off:], file.pathname, off);
+ off = set_dosname(C.cdp[off:], file.dosname, off);
+ send_message();
+# sys->sleep(1000);
+ if (receive_message() != 0)
+ return -1;
+ return 0;
+}
+
+
+set_power_mode(): int
+{
+ C.command = cdp_set_power_mode;
+ C.bufbytes = build_cdp_header(C.cdp, 0);
+ return (send_message());
+}
+
+get_storage_status(): string
+{
+ s := "";
+
+ C.command = cdp_get_storage_status;
+ C.bufbytes = build_cdp_header(C.cdp, 0);
+ send_message();
+# sys->sleep(2000);
+ if (receive_message() != 0) return "";
+ off := cdp_header_len;
+ taken, available, raw : int;
+ (taken, off) = get_int(C.cdp[off:], off);
+ (available, off) = get_int(C.cdp[off:], off);
+ (raw, off) = get_int(C.cdp[off:], off);
+ s += sys->sprint("Picture Memory\n\tused:\t%d\n\tfree:\t%d",taken,available);
+ if (raw == -1)
+ s += "\n";
+ else
+ s += sys->sprint(" (compressed)\n\t\t%d (raw)\n",raw);
+
+ return s;
+}
+
+get_power_mode(): string
+{
+ mode: int;
+
+ C.command = cdp_get_power_mode;
+ C.bufbytes = build_cdp_header(C.cdp, 0);
+ send_message();
+# sys->sleep(2000);
+ if (receive_message() != 0) return "Could not read power mode";
+ off := cdp_header_len;
+ (mode, off) = get_int(C.cdp[off:], off);
+ return sys->sprint("Power Mode = %d\n", mode);
+}
+
+set_clock_data(s:string): int
+{
+ err := 0;
+ if (s == "") {
+ tm := daytime->local(daytime->now());
+ off := cdp_header_len;
+ C.cdp[cdp_header_len+0] = byte 0;
+ C.cdp[cdp_header_len+1] = byte int2hex(tm.mon+1);
+ C.cdp[cdp_header_len+2] = byte int2hex(tm.mday);
+ C.cdp[cdp_header_len+3] = byte int2hex(tm.year);
+ C.cdp[cdp_header_len+4] = byte 0;
+ C.cdp[cdp_header_len+5] = byte int2hex(tm.hour);
+ C.cdp[cdp_header_len+6] = byte int2hex(tm.min);
+ C.cdp[cdp_header_len+7] = byte int2hex(tm.sec);
+ }
+ else {
+ (n,datetime) := sys->tokenize(s," ");
+ if (n != 2) return 1;
+ off := 0;
+ for (i := 0; i < 2; i++) {
+ (n2,data) := sys->tokenize(hd datetime, "./:");
+ if (n2 != 3) return 1;
+ off++;
+ for (i2 := 0; i2 < 3; i2++) {
+ C.cdp[cdp_header_len+off] = byte int2hex(int hd data);
+ off++;
+ data = tl data;
+ }
+ datetime = tl datetime;
+ }
+ }
+ return 0;
+}
+
+set_clock(s:string): int
+{
+ C.command = cdp_set_clock;
+ C.bufbytes = build_cdp_header(C.cdp, 8);
+ if (set_clock_data(s)) return 1;
+ send_message();
+ if (receive_message() != 0) return 1;
+ return 0;
+}
+
+addzeros(s: string): string
+{
+ s[len s] = ' ';
+ rs := "";
+ start := 0;
+ isnum := 0;
+ for (i := 0; i < len s; i++) {
+ if (s[i] < '0' || s[i] > '9') {
+ if (isnum && i - start < 2) rs[len rs] = '0';
+ rs += s[start:i+1];
+ start = i+1;
+ isnum = 0;
+ }
+ else isnum = 1;
+ }
+ i = len rs - 1;
+ while (i >= 0 && rs[i] == ' ') i--;
+ return rs[:i+1];
+}
+
+get_clock(): string
+{
+ C.command = cdp_get_clock;
+ C.bufbytes = build_cdp_header(C.cdp, 0);
+ send_message();
+ if (receive_message() != 0)
+ return "Could not read clock\n";
+ s := sys->sprint("%x/%x/%x %x:%x:%x", int C.cdp[13],int C.cdp[14],
+ int C.cdp[15], int C.cdp[17], int C.cdp[18], int C.cdp[19]);
+ return "date is "+addzeros(s)+"\n";
+}
+
+get_file_list(): int
+{
+ getoldfiledata();
+ print("getting file list\n",3);
+ C.command = cdp_get_file_list;
+ C.bufbytes = build_cdp_header(C.cdp, 56);
+ setfiledata();
+ send_message();
+ if (receive_message() != 0)
+ return -1;
+ display_filelist();
+ return 0;
+}
+
+setfiledata()
+{
+ off := cdp_header_len;
+ off = set_int(C.cdp[off:], 1, off); # ascending order
+ off = set_int(C.cdp[off:], 1, off); # drive a: internal RAM disk
+ off = set_fstring(C.cdp[off:], array of byte "", off); # set pathname to null
+ off = set_dosname(C.cdp[off:], array of byte "", off); # set Dos filename to null
+}
+
+get_file_size(i: int): int
+{
+ C.command = cdp_get_file_list;
+ C.bufbytes = build_cdp_header(C.cdp, 56);
+ setfiledata2(i);
+ send_message();
+ if (receive_message() != 0) return -1;
+ display_filelist();
+ return 0;
+}
+
+setfiledata2(i: int)
+{
+ off := cdp_header_len;
+ off = set_int(C.cdp[off:], 1, off); # ascending order
+ off = set_int(C.cdp[off:], 1, off); # drive a: internal RAM disk
+ off = set_fstring(C.cdp[off:], filelist[i].cf.pathname, off); # set pathname
+ off = set_dosname(C.cdp[off:], filelist[i].cf.dosname, off); # set Dos filename
+}
+
+set_interface_timeout()
+{
+ print("Setting Interface timeout\n",3);
+ C.command = cdp_set_interface_timeout;
+ C.bufbytes = build_cdp_header(C.cdp, 8);
+ off := cdp_header_len;
+ off = set_int(C.cdp[off:], 100, off);
+ off = set_int(C.cdp[off:], 5, off);
+ send_message();
+# sys->sleep(1000);
+ receive_message();
+}
+
+display_filelist(): string
+{
+ off, i: int;
+
+ off = cdp_header_len;
+ (reslength, off) = get_int(C.cdp[off:], off);
+ s := sys->sprint("Number of entries: %d\n", reslength);
+ for (i = 0; i < reslength; i++) {
+ (filelist[i].cf.driveno, off) = get_int(C.cdp[off:], off);
+ (filelist[i].cf.pathname, off) = get_fstring(C.cdp[off:], off);
+ (filelist[i].cf.dosname, off) = get_dosname(C.cdp[off:], off);
+ (filelist[i].cf.filelength, off) = get_int(C.cdp[off:], off);
+ (filelist[i].cf.filestatus, off) = get_int(C.cdp[off:], off);
+ if (filelist[i].cf.filelength < 0 || filelist[i].cf.filelength > MAXFILESIZE)
+ filelist[i].cf.filelength = 0;
+ s += sys->sprint("\t%d, %s, %s, %d\n", filelist[i].cf.driveno,
+ string filelist[i].cf.pathname,
+ string filelist[i].cf.dosname,
+ filelist[i].cf.filelength);
+ }
+ print(s,5);
+ if (usecache)
+ cacheclean();
+ return s;
+}
+
+get_camera_capabilities(): string
+{
+ print("Get capabilities\n",3);
+ C.command = cdp_get_camera_capabilities;
+ C.bufbytes = build_cdp_header(C.cdp, 0);
+ send_message();
+# sys->sleep(500);
+ if (receive_message() != -1)
+ return capabilities();
+ print("Error recieving abilities message\n",1);
+ return "";
+}
+
+Capability: adt {
+ pname: string;
+ d: string;
+ pick {
+ List =>
+ t: list of (string, int);
+ Range =>
+ min, max, default, current: int;
+ }
+};
+
+caplist: list of ref Capability;
+
+print_camera_capabilities(): string
+{
+ rs := "";
+# p : ref Capability;
+
+ pick p := hd caplist{
+ List =>
+ rs += sys->sprint("Pname = %s ", p.pname);
+ Range =>
+ rs += sys->sprint("Pname = %s min = %d max = %d default = %d ", p.pname,
+ p.min, p.max, p.default);
+ }
+# p := tl p;
+ return rs;
+}
+
+capabilities(): string
+{
+ off, i, ncaps, t: int;
+ l, m, n: int;
+ pname, desc: array of byte;
+ s: array of byte;
+ rs := "";
+ off = cdp_header_len;
+ (ncaps, off) = get_int(C.cdp[off:], off);
+ if (ncaps > 200)
+ return "error reading capabilities\n";
+ rs += sys->sprint("i = %d\n", i);
+ firsttime := 0;
+ if (ignoreabls == nil)
+ firsttime = 1;
+ for (j := 0; j < ncaps; j++) {
+ line := "";
+ (pname, off) = get_pname(C.cdp[off:], off);
+ line += sys->sprint("%s, ", string pname);
+ (t, off) = get_int(C.cdp[off:], off);
+ (desc, off) = get_fstring(C.cdp[off:], off);
+ line += sys->sprint("%s: ", string desc);
+ fact := "";
+ case t {
+ 1 =>
+ t: list of (string, int);
+
+ (l, off) = get_int(C.cdp[off:], off);
+ (m, off) = get_int(C.cdp[off:], off);
+ line += sys->sprint("items: %d factory: %d\n", l, m);
+
+ for (k := 0; k < l; k++) {
+ (s, off) = get_fstring(C.cdp[off:], off);
+ (n, off) = get_int(C.cdp[off:], off);
+ line += sys->sprint(" %s: %d\n", string s, n);
+ if (m == n)
+ fact = sconv(s);
+ t = (sconv(s), n) :: t;
+ }
+ cl := ref Capability.List (sconv(pname), sconv(desc), t);
+ 2 =>
+ (l, off) = get_int(C.cdp[off:], off);
+ (m, off) = get_int(C.cdp[off:], off);
+ (n, off) = get_int(C.cdp[off:], off);
+ line += sys->sprint("min: %d max: %d factory:%d\n", l, m, n);
+ fact = string n;
+ 3 =>
+ (l, off) = get_int(C.cdp[off:], off);
+ case l {
+ 7 =>
+ (s, off) = get_dosname(C.cdp[off:], off);
+ 8 =>
+ (s, off) = get_fstring(C.cdp[off:], off);
+ * =>
+ line += sys->sprint("Invalid type %d\n", l);
+ break;
+ }
+ fact = string s;
+ line += sys->sprint("%s\n", string s);
+ 4 to 8 =>
+ break;
+ 9 =>
+ break;
+ * =>
+ line += sys->sprint("Invalid type %d\n", t);
+ break;
+ }
+ if (firsttime) {
+ if (!filterabls(sconv(pname), string desc))
+ defattr = (sconv(pname), int fact) :: defattr;
+ }
+ if (!isin(ignoreabls, string pname))
+ rs += line;
+ }
+ if (firsttime) {
+ defaultattr = array[len defattr] of (string, int);
+ currentattr = array[len defattr] of (string, int);
+ i = 0;
+ for (;defattr != nil; defattr = tl defattr) {
+ defaultattr[i] = hd defattr;
+ currentattr[i++] = hd defattr;
+ }
+ }
+ return rs;
+}
+
+isin(los: list of string, s: string): int
+{
+ for (;los !=nil; los = tl los)
+ if (hd los == s)
+ return 1;
+ return 0;
+}
+
+set_capture_data(): int
+{
+ C.cdp[cdp_header_len+0] = byte 0;
+ C.cdp[cdp_header_len+1] = byte 0;
+ C.cdp[cdp_header_len+2] = byte 0;
+ C.cdp[cdp_header_len+3] = byte 0;
+ return 4;
+}
+
+get_camera_state(pname: string,offset: int): string
+{
+ if (offset != 0) return "";
+ print(sys->sprint( "get_camera_state(%s)\n", pname),3);
+ C.command = cdp_get_camera_state;
+ off := cdp_header_len;
+ if (pname == "")
+ C.bufbytes = build_cdp_header(C.cdp, 0);
+ else {
+ if (len pname != 4)
+ return "Invalid command name: "+pname+"\n";
+ C.cdp[off+0] = byte pname[0];
+ C.cdp[off+1] = byte pname[1];
+ C.cdp[off+2] = byte pname[2];
+ C.cdp[off+3] = byte pname[3];
+ C.bufbytes = build_cdp_header(C.cdp, 4);
+ }
+ send_message();
+ if (receive_message() != 0) return "Could not read state: "+pname+"\n";
+ off = cdp_header_len;
+ rlen: int;
+ (rlen, off) = get_int(C.cdp[off:],off);
+ s := "";
+ rlen = 1;
+ if (pname == "") {
+ for (q := off; q < len C.cdp; q++) {
+ s[0] = int C.cdp[q];
+ if (s[0] > 0) print(sys->sprint("%s",s),5);
+ }
+ print("\n",5);
+ }
+ for (i := 0; i < rlen; i++) {
+ name, data: array of byte;
+ type1, tmp: int;
+ (name,off) = get_pname(C.cdp[off:],off);
+ (type1,off) = get_int(C.cdp[off:],off);
+ print(sys->sprint( "%d: %s - %d\n", i,pname,type1),5);
+ case type1 {
+ 1 to 5 =>
+ (tmp,off) = get_int(C.cdp[off:],off);
+ data = array of byte string tmp;
+ 6 =>
+ (data,off) = get_pname(C.cdp[off:],off);
+ 7 =>
+ (data,off) = get_dosname(C.cdp[off:],off);
+ 8 =>
+ (data,off) = get_fstring(C.cdp[off:],off);
+ * =>
+ data = array of byte "!ERROR!";
+ }
+ # if (string data == "!ERROR!") return "";
+# if (rlen == 1)
+# s = string data;
+# else s += sys->sprint("%s: %s\n",string name, string data);
+ s += sys->sprint("%s: %s\n",string name, string data);
+ }
+ return s;
+}
+
+
+set_camera_state(pname: string, val: int): string
+{
+ print(sys->sprint( "set_camera_state(%s, %d)\n", pname, val),3);
+ if (len pname != 4)
+ return "Command name must be 4 characters";
+ off := cdp_header_len;
+ C.cdp[off+0] = byte pname[0];
+ C.cdp[off+1] = byte pname[1];
+ C.cdp[off+2] = byte pname[2];
+ C.cdp[off+3] = byte pname[3];
+ off += 4;
+ off = set_int(C.cdp[off:], val, off);
+
+ C.command = cdp_set_camera_state;
+ C.bufbytes = build_cdp_header(C.cdp, 8);
+ send_message();
+# sys->sleep(1000);
+ if ((e := receive_message()) == 0) {
+ na := getattr(pname);
+ if (na != -1)
+ currentattr[na].t1 = val;
+ return nil;
+ }
+ else
+ return error_table[e];
+}
+
+capture(): int
+{
+ C.command = cdp_get_camera_status;
+ C.bufbytes = build_cdp_header(C.cdp, 0);
+ send_message();
+# sys->sleep(1000);
+ if (receive_message() != 0)
+ return -1;
+
+ d := set_capture_data();
+ C.command = cdp_start_capture;
+ C.bufbytes = build_cdp_header(C.cdp, d);
+ send_message();
+# sys->sleep(3000);
+ return receive_message();
+}
+
+dump_message()
+{
+ print(sys->sprint(" Message length = %d\n", C.bufbytes),5);
+ print(sys->sprint(" CDP Length = %d\n", (int C.cdp[2]<<8)+(int C.cdp[3])),5);
+ print(sys->sprint(" CDP Version = %d\n", int C.cdp[4]),5);
+ print(sys->sprint(" CDP Command = %x\n", int ((C.cdp[8]<<8)|(C.cdp[9]))),5);
+ print(sys->sprint(" CDP Result Code = %d\n", int ((C.cdp[10]<<8)|(C.cdp[11]))),5);
+}
+
+build_cdp_header(cdp: array of byte, x: int): int
+{
+ cdp[4] = byte 0;
+ cdp[5] = byte 0;
+ cdp[6] = byte 0;
+ cdp[7] = byte 0;
+ cdp[8] = byte ((C.command>>8)&16rff);
+ cdp[9] = byte (C.command&16rff);
+ cdp[10] = byte 0;
+ cdp[11] = byte 0;
+
+ l := 8 + x;
+ cdp[0] = byte ((l>>24)&16rff);
+ cdp[1] = byte ((l>>16)&16rff);
+ cdp[2] = byte ((l>>8)&16rff);
+ cdp[3] = byte (l&16rff);
+
+ return 12+x;
+}
+
+poll_and_reply(nak: int): int
+{
+ print("poll and reply\n",7);
+ if ((read_n_to(C.fd, pwl, len pwl,TIMEOUT) < 0) && nak) {
+ pak[0] = byte 0;
+ pak[1] = byte 2; # reject
+ write_n(C.fd, pak, len pak);
+ return 0;
+ }
+ pak[0] = byte 0;
+ pak[1] = byte 1;
+ write_n(C.fd, pak, len pak);
+
+ return 1;
+}
+
+receive_packet(buf: array of byte): int
+{
+ print("receive_packet\n",6);
+ if (!poll_and_reply(!0)) {
+ print("Poll and reply failed\n",1);
+ return -1;
+ }
+
+ l := int (((int pwl[0]&3)<<8)|(int pwl[1]));
+ C.bufbytes += l;
+ r := read_n_to(C.fd, buf, l,TIMEOUT);
+ if (r != l) {
+ print(sys->sprint( "could not read packet (read %d, expected %d)\n", r, l),1);
+ return -1;
+ }
+ return 0;
+}
+
+receive_message(): int
+{
+ print("read_message\n",6);
+ C.bufbytes = 0;
+ if (receive_packet(C.cdp[0:]) != 0) {
+ recon = 1;
+ print("receive packet failed\n",1);
+ return 3;
+ # raise "error: receive packet failed";
+ }
+ dump_message();
+ rc := int C.cdp[9];
+ if ((~rc&16rff) != (C.command&16rff)) {
+ print("command & return are different\n",1);
+ consume(C.fd);
+ return 3;
+ # raise "error: command and return command are not the same\n";
+ }
+ message_len := (int C.cdp[2]<<8)+(int C.cdp[3]);
+
+ while (C.bufbytes < message_len) {
+ if (receive_packet(C.cdp[C.bufbytes:]) != 0) {
+ print("Packet is too short\n",1);
+ recon = 1;
+ return 3;
+ # raise "error: receive packet2 failed";
+ }
+ }
+# sys->sleep(500);
+ read_n_to(C.fd, pak, len pak, TIMEOUT);
+ return (int ((C.cdp[10]<<8)|(C.cdp[11]))); # result code
+}
+
+reset(fd: ref Sys->FD)
+{
+ sys->fprint(fd, "d1");
+ sys->sleep(20);
+ sys->fprint(fd, "d0");
+ sys->fprint(fd, "b9600");
+}
+
+kill(pid: int)
+{
+ pctl := sys->open("/prog/" + string pid + "/ctl", Sys->OWRITE);
+ if (pctl != nil)
+ sys->write(pctl, array of byte "kill", len "kill");
+}
+
+killg(pid: int)
+{
+ if ((fd := sys->open("/prog/" + string pid + "/ctl", Sys->OWRITE)) != nil)
+ sys->fprint(fd, "killgrp");
+}
+
+#dump_buf(buf: array of byte, i: int)
+#{
+# for (j := 0; j < i; j++)
+# sys->fprint(sys->fildes(2), "%x ", int buf[j]);
+# sys->fprint(sys->fildes(2), "\n");
+#}
+
+serialport(port : int) : (ref Sys->FD, ref Sys->FD, string)
+{
+ C.fd = nil;
+ C.ctlfd = nil;
+ C.mode = BEACON;
+
+ serport := "/dev/eia" + string port;
+ serctl := serport + "ctl";
+
+ for (i := 0; i < len statopt; i++) {
+ statfd := sys->open("/dev/eia"+string port+statopt[i],sys->OREAD);
+ if (statfd != nil)
+ C.stat = i;
+ statfd = nil;
+ }
+ readstat();
+
+ fd := sys->open(serport, Sys->ORDWR);
+ if (fd == nil)
+ return (nil, nil, sys->sprint("cannot read %s: %r", serport));
+ ctlfd := sys->open(serctl, Sys->OWRITE);
+ if (ctlfd == nil)
+ return (nil, nil, sys->sprint("cannot open %s: %r", serctl));
+
+ config := array [] of {
+ "b9600",
+ "l8",
+ "p0",
+ "m0",
+ "s1",
+ "r1",
+ "i1",
+ "f",
+ };
+
+ for (i = 0; i < len config; i++) {
+ if (sys->fprint(ctlfd,"%s", config[i]) < 0)
+ print(sys->sprint("serial config (%s): %r\n", config[i]),3);
+ }
+ sys->sleep(100);
+ consume(fd);
+ sys->fprint(ctlfd, "d1");
+ sys->sleep(40);
+ sys->fprint(ctlfd, "d0");
+ return (fd, ctlfd, nil);
+}
+
+consume(fd: ref sys->FD)
+{
+ if (fd != nil) {
+ print("Consuming...\n",6);
+ read_n_to(fd, array[1000] of byte, 1000, 1000);
+ }
+}
+
+beacon_intro(data: chan of array of byte, pchan: chan of int, fd: ref Sys->FD)
+{
+ buf := array[64] of byte;
+ cbuf: array of byte;
+ pid := sys->pctl(0, nil);
+# print(sys->sprint("b_intro: starting %d\n",pid);
+ pchan <-= pid;
+ failed := array[len bintro] of { * => byte 0 };
+ # discard characters until lead in character reached
+ print(sys->sprint("\tWaiting for: %d...\n",int bintro[0]),3);
+ do {
+ n := read_n_to(fd, buf, 1, TIMEOUT);
+ if (n == -1) {
+ data <- = failed;
+ return;
+ }
+ print(sys->sprint("\tGot: %d\n",int buf[0]),5);
+ } while (buf[0] != bintro[0]);
+ print("Getting beacon\n",3);
+ # read the next 6 bytes of beacon
+ i := read_n_to(fd, buf[1:], 6,TIMEOUT);
+ for (k := 0; k < i; k++)
+ print(sys->sprint("\tRead %d: %d (wanted %d)\n",k+1, int buf[1+k], int bintro[1+k]),5);
+ if (i != 6) {
+ print("Error reading beacon\n",3);
+ exit;
+ }
+ else {
+ print("sending beacon\n",3);
+ cbuf = buf[0:7];
+ data <- = cbuf;
+ }
+
+}
+
+beacon_result(data: chan of array of byte, pchan: chan of int, fd: ref Sys->FD)
+{
+ buf := array[64] of byte;
+ cbuf: array of byte;
+ pid := sys->pctl(0, nil);
+ pchan <-= pid;
+
+ # read the next 10 bytes of beacon
+ p := 0;
+ intro := 1;
+ for (;;) {
+ i := read_n_to(fd, buf[p:], 1, TIMEOUT);
+ if (intro) {
+ if (buf[p] != bintro[p]) {
+ intro = 0;
+ buf[0] = buf[p];
+ p = 1;
+ }
+ else {
+ p++;
+ if (p >= len bintro) p = 0;
+ }
+ }
+ else p++;
+ if (p == 10) break;
+ }
+
+ for (k := 0; k < p; k++) print(sys->sprint("\tRead %d: %d\n",k, int buf[k]),5);
+ if (p != 10) {
+ print("Error reading beacon result\n",3);
+ exit;
+ }
+ else {
+ print("reading beacon result\n",3);
+ cbuf = buf[0:10];
+ data <- = cbuf;
+ }
+}
+
+beacon_comp(buf: array of byte, C: Camera_adt): int
+{
+ speed: string;
+
+ case int buf[0] {
+ 0 =>
+ C.baud = (int buf[2]<<24)|(int buf[3]<<16)|(int buf[4]<<8)|(int buf[5]);
+ C.dfs = (int buf[6]<<8)|(int buf[7]);
+ C.hfs = (int buf[8]<<8)|(int buf[9]);
+ # do baud rate change here
+ sys->sleep(1000);
+
+ case C.baud {
+ 115200 =>
+ speed = "b115200";
+ 57600 =>
+ speed = "b57600";
+ 38400 =>
+ speed = "b38400";
+ 19200 =>
+ speed = "b19200";
+ * =>
+ speed = "b9600";
+ }
+ print(sys->sprint("Connection Details:\n Baud rate:\t%dbps\n",C.baud),3);
+ print(sys->sprint(" Host frame size:\t%dbytes\n",C.hfs),3);
+ print(sys->sprint(" Device frame size:\t%dbytes\n",C.dfs),3);
+ if (sys->fprint(C.ctlfd,"%s", speed) < 0) {
+ print(sys->sprint("Error setting baud rate %s\n", speed),3);
+ return -1;
+ }
+ -1 =>
+ print("Incompatible Data Rate\n",1);
+ return -1;
+ -2 =>
+ print("Device does not support these modes\n",1);
+ return -2;
+ * =>
+ print(sys->sprint("I'm here!? buf[0] = %d\n",int buf[0]),1);
+ return -1;
+ }
+ return 0;
+}
+
+read_n(fd: ref Sys->FD, buf: array of byte, n: int, res: chan of int)
+{
+ pid := sys->pctl(0, nil);
+# print(sys->sprint("read_n: starting %d\n",pid);
+ res <-= pid;
+ print(sys->sprint( "read_n %d\n", n),7);
+ nread := 0;
+ while (nread < n) {
+ i := sys->read(fd, buf[nread:], n-nread);
+ sys->sleep(1);
+ if (i <= 0)
+ break;
+ nread += i;
+ }
+ res <-= nread;
+# print(sys->sprint("read_n: ending %d\n",pid);
+}
+
+read_n2(fd: ref Sys->FD, buf: array of byte, n: int): int
+{
+ print(sys->sprint( "read_n2 %d\n", n),7);
+ nread := 0;
+ while (nread < n) {
+ i := sys->read(fd, buf[nread:], n-nread);
+ sys->sleep(1);
+ if (i <= 0)
+ break;
+ nread += i;
+ }
+ return nread;
+}
+
+read_n_to(fd: ref Sys->FD, buf: array of byte, n,t : int): int
+{
+ v:= 0;
+ rc := chan of int;
+ tc := chan of int;
+
+ spawn timer2(tc,t);
+ tpid := <- tc;
+ spawn read_n(fd, buf, n, rc);
+ rpid := <- rc;
+
+ try := 0;
+ alt {
+ <- tc =>
+ kill(rpid);
+ print(sys->sprint( "error: read_n timeout\n"),1);
+ recon = 1;
+ return -1;
+ v = <- rc =>
+ kill(tpid);
+ break;
+ }
+ return v;
+}
+
+write_n(fd: ref Sys->FD, buf: array of byte, n: int): int
+{
+ print(sys->sprint("write_n %d\n", n),7);
+ nwrite := 0;
+ while (nwrite < n) {
+ i := sys->write(fd, buf[nwrite:], n-nwrite);
+ sys->sleep(1);
+ if (i <= 0) {
+ print(sys->sprint("Error returned by write: %r\n"),1);
+ readstat();
+# recon = 1;
+ return nwrite;
+ }
+ nwrite += i;
+ }
+ print(sys->sprint("write_n returning %d\n", nwrite),7);
+ return nwrite;
+}
+
+readstat()
+{
+ consume(C.fd);
+ print("Serial status: ",5);
+ statfd := sys->open("/dev/eia"+string C.port_num+statopt[C.stat], sys->OREAD);
+ buf := array[100] of byte;
+ if (statfd != nil) {
+ for (;;) {
+ k := sys->read(statfd,buf,len buf);
+ if (k > 0) print(string buf[:k],2);
+ else break;
+ }
+ print("\n",2);
+ }
+ else print("cannot read serial status\n",1);
+}
+
+beacon_ack(C: Camera_adt)
+{
+ # set speed
+ i := C.baud;
+ bak[4] = byte ((i>>24)&16rff);
+ bak[5] = byte ((i>>16)&16rff);
+ bak[6] = byte ((i>>8)&16rff);
+ bak[7] = byte (i&16rff);
+
+ # set frame size to device
+ i = C.dfs;
+ bak[8] = byte ((i>>8)&16rff);
+ bak[9] = byte (i&16rff);
+
+ # set frame size to host
+ i = C.hfs;
+ bak[10] = byte ((i>>8)&16rff);
+ bak[11] = byte (i&16rff);
+ bak[12] = check_sum(bak, 12);
+
+ if (write_n(C.fd, bak, len bak) != len bak) {
+ print("Error writing beacon acknowledgement\n",3);
+ exit;
+ }
+ print("beacon acknowledgement written\n",3);
+}
+
+# timer thread send tick <- = 0 to kill
+
+timer2(tick: chan of int, delay: int)
+{
+ pid := sys->pctl(0, nil);
+ tick <-= pid;
+ sys->sleep(delay);
+ tick <- = TOUT;
+}
+
+beacon_ok(buf: array of byte): int
+{
+
+ for (i := 0; i < len bintro; i++) {
+ if (buf[i] != bintro[i]) {
+ print(sys->sprint("Beacon failed on byte %d: %d (wanted %d)\n",i,int buf[i],int bintro[i]),3);
+ return 0;
+ }
+ }
+ print("Beacon passed\n",3);
+ return 1;
+}
+
+check_sum(buf: array of byte, l: int): byte
+{
+ sum := 0;
+ for (i := 0; i < l; i++)
+ sum += int buf[i];
+ return byte (sum&16rff);
+}
+
+
+set_int(b: array of byte, i, off: int): int
+{
+ b[0] = byte (i>>24&16rff);
+ b[1] = byte (i>>16&16rff);
+ b[2] = byte (i>>8&16rff);
+ b[3] = byte (i&16rff);
+
+ return (off+4);
+}
+
+set_fstring(b: array of byte, s: array of byte, off: int): int
+{
+ for (i := 0; i < 32; i++)
+ b[i] = byte 0;
+ for (i = 0; i < len s; i++)
+ b[i] = s[i];
+ return (off+32);
+}
+
+set_dosname(b: array of byte, s: array of byte, off: int): int
+{
+ for (i := 0; i < 16; i++)
+ b[i] = byte 0;
+ for (i = 0; i < len s; i++)
+ b[i] = s[i];
+ return (off+16);
+}
+
+get_tag(b: array of byte, off: int): (int, Partialtag)
+{
+ tag: Partialtag;
+ (off, tag.offset) = get_int(b, off);
+ (off, tag.length) = get_int(b, off);
+ (off, tag.filesize) = get_int(b, off);
+ return (off, tag);
+}
+
+get_int(b: array of byte, off: int): (int, int)
+{
+ return (get_int2(b), off+4);
+}
+
+get_int2(b: array of byte): int
+{
+ i := (int b[0]<<24)|(int b[1]<<16)|(int b[2]<<8)|(int b[3]);
+ return i;
+}
+
+
+get_pname(b: array of byte, off: int): (array of byte, int)
+{
+ return get_string(b, off, 4);
+}
+
+get_dosname(b: array of byte, off: int): (array of byte, int)
+{
+ return get_string(b, off, 16);
+}
+
+get_string(b: array of byte, off: int, l: int): (array of byte, int)
+{
+ s := array[l] of byte;
+ s[0:] = b[0:l];
+ return (s, off+l);
+}
+
+get_fstring(b: array of byte, off: int): (array of byte, int)
+{
+ return get_string(b, off, 32);
+}
+
+sconv(b: array of byte): string
+{
+ s := string b;
+ i := len s-1;
+ while (i >= 0 && s[i] == 0)
+ i--;
+ return s[0:i+1];
+}
+
+name2dos(s: string): array of byte
+{
+ return array of byte str->toupper(s);
+}
+
+getqid(i, ftype: int): int
+{
+ qid := (i<<4) + ftype;
+ return qid;
+}
+
+gettype(qid: int): int
+{
+ ftype := qid & 15;
+ return ftype;
+}
+
+cutdir(ab:array of byte): string
+{
+ s := sconv(ab);
+ for (i := 0; i < len s-1; i++)
+ if (s[i] == '/')
+ return s[i+1:len s - 1];
+ return "";
+}
+
+convert_thumb(w,h: int, data: array of byte): array of byte
+{
+ rgb := array[w * h * 3] of byte;
+ index := 0;
+ rgbi := 0;
+ for (i := 0; i < (w * h) / 2; i++) {
+
+ cb := real data[index];
+ y := real data[index+1];
+ cr := real data[index+2];
+
+ rb := conv(y + (1.77200 * (cb - 128.0)));
+ gb := conv(y - (0.34414 * (cb - 128.0)) - (0.71414 * (cr - 128.0)));
+ bb := conv(y + (1.4020 * (cr - 128.0)));
+
+ for (loop := 0; loop < 2; loop++) {
+ rgb[rgbi++] = rb;
+ rgb[rgbi++] = gb;
+ rgb[rgbi++] = bb;
+ }
+ index += 4;
+ }
+ return rgb;
+}
+
+conv(a: real): byte
+{
+ r := int a;
+ if (r < 0) r = -r;
+ if (r > 255) r = 255;
+ return byte r;
+}
+
+thumb2bit(buf: array of byte, w,h: int): array of byte
+{
+ convbuf := convert_thumb(w,h,buf);
+ # assume thumbs are small so we wont gain much by compressing them
+ bitarray := array [60+len convbuf] of byte;
+ # assume chans = RGB24
+ bitarray[:] = array of byte sys->sprint("%11s %11d %11d %11d %11d ", "r8g8b8", 0, 0, w, h);
+ bitarray[60:] = convbuf;
+ return bitarray;
+}
+
+jpg2bit(s: string): string
+{
+ if (len s < 4) return s;
+ if (s[len s - 4:] != ".jpg") return s;
+ return s[:len s - 4]+".bit";
+}
+
+oldfiles : list of (string, int, int);
+
+getoldfiledata()
+{
+ oldfiles = nil;
+ for(i := 0; i < reslength; i++)
+ oldfiles = (str->tolower(sconv(filelist[i].cf.dosname)),
+ int filelist[i].qid.path,
+ filelist[i].cf.thumbqid) :: oldfiles;
+}
+
+updatetree(tree: ref Nametree->Tree)
+{
+ for (i := 0; i < reslength; i++) {
+ name := str->tolower(sconv(filelist[i].cf.dosname));
+ found := 0;
+ tmp : list of (string, int, int) = nil;
+ for (; oldfiles != nil; oldfiles = tl oldfiles) {
+ (oldname, oldqid, oldthumbqid) := hd oldfiles;
+ # sys->print("'%s' == '%s'?\n",name,oldname);
+ if (name == oldname) {
+ found = 1;
+ filelist[i].qid = (big oldqid, 0, sys->QTFILE);
+ filelist[i].cf.thumbqid = oldthumbqid;
+ }
+ else
+ tmp = hd oldfiles :: tmp;
+ }
+ oldfiles = tmp;
+ # sys->print("len oldfiles: %d\n",len oldfiles);
+ if (found)
+ updateintree(tree, name, i);
+ else
+ addtotree(tree, name, i);
+
+ }
+ for (; oldfiles != nil; oldfiles = tl oldfiles) {
+ (oldname, oldqid, oldthumbqid) := hd oldfiles;
+ # sys->print("remove from tree: %s\n",oldname);
+ tree.remove(big oldqid);
+ tree.remove(big oldthumbqid);
+ }
+}
+
+updateintree(tree: ref Nametree->Tree, name: string, i: int)
+{
+ # sys->print("update tree: %s\n",name);
+ tree.wstat(filelist[i].qid.path,
+ dir(name,
+ 8r444,
+ filelist[i].cf.filelength,
+ int filelist[i].qid.path));
+ tree.wstat(big filelist[i].cf.thumbqid,
+ dir(jpg2bit(name),
+ 8r444,
+ 13020,
+ filelist[i].cf.thumbqid));
+}
+
+addtotree(tree: ref Nametree->Tree, name: string, i: int)
+{
+ # sys->print("addtotree: %s\n",name);
+ nextjpgqid += 1<<4;
+ filelist[i].qid = (big nextjpgqid, 0, sys->QTFILE);
+ parentqid := Qjpgdir;
+ tree.create(big parentqid,
+ dir(name,
+ 8r444,
+ filelist[i].cf.filelength,
+ nextjpgqid));
+
+ nexttmbqid += 1<<4;
+ filelist[i].cf.thumbqid = nexttmbqid;
+ tree.create(big Qthumbdir,
+ dir(jpg2bit(name),
+ 8r444,
+ 13020,
+ nexttmbqid));
+}
+
+keepalive(alivechan: chan of int)
+{
+ alivechan <-= sys->pctl(0,nil);
+ for (;;) {
+ sys->sleep(300000);
+ now := daytime->now();
+ print(sys->sprint("Alive: %d idle seconds\n",now-wait),6);
+ if (now < wait)
+ wait = now - 300;
+ if (now - wait >= 300)
+ alivechan <-= 1;
+ }
+}
+
+reconnect(n: int): int
+{
+ attempt := 0;
+ connected = 0;
+ delay := 100;
+ to5 := 0;
+ for (;;) {
+ print(sys->sprint( "Attempting to reconnect (attempt %d)\n",++attempt),2);
+ sys->sleep(100);
+ (C.fd, C.ctlfd, nil) = serialport(C.port_num);
+ if (C.fd == nil || C.ctlfd == nil)
+ print(sys->sprint("Could not open serial port\n"),3);
+ else if (connect() == 0) {
+ set_interface_timeout();
+ connected = 1;
+ print("Reconnected!\n",2);
+ break;
+ }
+ if (n != -1 && attempt >= n)
+ break;
+ if (++to5 >= 5) {
+ delay *= 2;
+ to5 = 0;
+ if (delay > 600000)
+ delay = 600000;
+ }
+ sys->sleep(delay);
+ }
+ recon = 0;
+ return connected;
+}
+
+# 1: errors
+# 2: connection
+# 3: main procs
+
+print(s: string, v: int)
+{
+ if (s != nil && s[len s - 1] == '\n')
+ s = s[:len s - 1];
+ if (v <= verbosity)
+ sys->fprint(sys->fildes(2), "%s (%s)\n",s,camname);
+}
+
+readinterface(qid : int, offset: big, size: int): (ref sys->Dir, array of byte)
+{
+ i := qid >> 4;
+ buf := array[size] of byte;
+ fd := sys->open(interfacepaths[i], sys->OREAD);
+ if (fd == nil)
+ return (nil,nil);
+ (n, dir) := sys->fstat(fd);
+ if (offset >= dir.length)
+ return (nil,nil);
+ sys->seek(fd, offset, sys->SEEKSTART);
+ i = sys->read(fd,buf,size);
+ return (ref dir, buf[:i]);
+}
+
+readfile(f: string): string
+{
+ fd := sys->open(f, sys->OREAD);
+ if(fd == nil)
+ return nil;
+
+ buf := array[8192] of byte;
+ n := sys->read(fd, buf, len buf);
+ if(n < 0)
+ return nil;
+
+ return string buf[0:n];
+}
diff --git a/appl/demo/camera/camera.dis b/appl/demo/camera/camera.dis
new file mode 100644
index 00000000..c099686a
--- /dev/null
+++ b/appl/demo/camera/camera.dis
Binary files differ
diff --git a/appl/demo/camera/camera.sbl b/appl/demo/camera/camera.sbl
new file mode 100644
index 00000000..451ffc0c
--- /dev/null
+++ b/appl/demo/camera/camera.sbl
@@ -0,0 +1,6687 @@
+limbo .sbl 2.1
+Camera
+8
+camera.b
+sys.m
+daytime.m
+styx.m
+styxservers.m
+string.m
+draw.m
+arg.m
+5417
+192.1,25 0
+193.1,36 1
+18,30 1
+32,35 1
+1,36 1
+1,36 1
+195.1,31 2
+196.1,37 3
+198.1,28 4
+199.1,13 5
+1,13 5
+200.1,49 6
+201.1,24 7
+19,23 7
+1,24 7
+202.1,40 8
+203.1,17 9
+1,17 9
+204.1,26 10
+206.1,31 11
+207.1,15 12
+208.1,21 13
+209.1,16 14
+210.9,21 15
+1,21 15
+211.1,34 16
+212.1,16 17
+214.1,13 18
+215.1,15 19
+216.1,16 20
+218.1,30 21
+21,22 21
+24,29 21
+1,30 21
+1,30 21
+219.1,32 22
+21,22 22
+24,31 22
+1,32 22
+1,32 22
+220.1,28 23
+17,18 23
+19,27 23
+1,28 23
+1,28 23
+221.1,27 24
+15,20 24
+21,26 24
+1,27 24
+1,27 24
+222.1,33 25
+15,20 25
+21,32 25
+1,33 25
+1,33 25
+223.1,33 26
+17,22 26
+23,32 26
+1,33 26
+1,33 26
+224.1,29 27
+16,21 27
+22,28 27
+1,29 27
+1,29 27
+225.1,31 28
+17,22 28
+23,30 28
+1,31 28
+1,31 28
+226.1,29 29
+15,20 29
+21,28 29
+1,29 29
+1,29 29
+227.1,33 30
+18,23 30
+24,32 30
+1,33 30
+1,33 30
+228.1,37 31
+20,25 31
+26,36 31
+1,37 31
+1,37 31
+229.1,39 32
+21,26 32
+27,38 32
+1,39 32
+1,39 32
+231.1,19 33
+232.33,36 34
+233.1,16 35
+11,15 35
+1,16 35
+234.1,100 36
+15,99 36
+1,100 36
+235.8,27 37
+8,27 37
+8,27 37
+8,27 37
+8,32 37
+236.7,10 38
+238.3,24 39
+3,24 39
+3,24 39
+3,24 38
+240.19,30 40
+19,30 40
+19,30 40
+3,30 40
+3,30 41
+3,30 38
+242.23,34 42
+23,34 42
+23,34 42
+11,34 42
+11,34 43
+3,34 42
+3,34 38
+244.16,27 44
+16,27 44
+16,27 44
+3,27 44
+3,27 45
+3,27 38
+246.20,31 46
+20,31 46
+20,31 46
+3,31 46
+3,31 47
+3,31 38
+248.3,15 48
+3,15 38
+250.19,30 49
+19,30 49
+19,30 49
+3,47 49
+3,47 50
+3,47 38
+252.3,15 51
+3,15 51
+3,15 38
+255.1,10 52
+256.24,41 53
+1,52 53
+258.6,12 54
+18,36 55
+14,36 55
+259.2,19 56
+2,38 56
+261.2,34 57
+258.38,41 58
+38,41 58
+264.7,64 59
+19,52 59
+53,63 59
+7,64 59
+7,64 59
+1,67 59
+1,67 59
+1,67 60
+65,66 59
+1,67 59
+265.6,17 61
+6,17 61
+6,17 61
+6,17 61
+268.26,48 62
+37,47 62
+26,48 62
+26,48 62
+4,8 62
+10,17 62
+19,22 62
+19,22 63
+19,22 64
+19,22 65
+269.7,18 66
+270.4,43 67
+10,40 67
+41,42 67
+4,43 67
+271.4,8 68
+273.2,5 61
+275.2,6 61
+277.2,3 61
+280.5,14 69
+5,14 69
+5,14 69
+5,19 69
+281.2,32 70
+8,29 70
+30,31 70
+2,32 70
+282.2,6 71
+284.1,10 72
+285.1,24 73
+7,21 73
+22,23 73
+1,24 73
+286.1,24 74
+1,24 74
+287.1,24 75
+1,24 75
+288.1,16 76
+1,16 76
+1,16 76
+289.1,14 77
+290.1,17 78
+291.1,26 79
+1,26 79
+1,26 79
+1,26 80
+292.1,20 81
+293.17,31 82
+29,30 82
+17,31 82
+17,31 82
+1,38 82
+1,38 82
+1,38 83
+33,37 82
+1,38 82
+294.1,7 84
+295.0,1 85
+299.6,12 86
+18,38 87
+14,38 87
+300.2,65 88
+19,38 88
+19,41 88
+42,61 88
+42,64 88
+2,65 88
+2,65 88
+2,65 89
+299.40,43 90
+40,43 90
+301.0,1 91
+327.1,8 92
+328.8,18 93
+329.6,14 94
+6,17 94
+6,17 95
+6,24 94
+37,43 96
+31,43 96
+26,43 96
+26,43 97
+26,43 98
+331.2,14 99
+2,14 99
+333.5,12 100
+14,23 101
+14,23 101
+334.8,9 102
+1,9 102
+339.1,8 103
+340.1,14 104
+341.6,12 105
+18,23 106
+14,23 106
+342.7,16 107
+27,30 107
+23,24 107
+23,31 107
+19,31 107
+19,31 108
+2,31 107
+341.25,28 109
+25,28 109
+343.8,10 110
+1,10 110
+348.1,14 111
+349.1,32 112
+350.1,21 113
+351.1,20 114
+352.1,15 115
+7,14 115
+1,15 115
+354.1,31 116
+14,18 116
+19,30 116
+1,31 116
+355.1,15 117
+357.1,40 118
+20,26 118
+28,33 118
+35,39 118
+1,40 118
+358.1,16 119
+362.13,19 120
+13,19 120
+388.6,10 120
+6,10 120
+361.2,8 120
+2,8 120
+2,8 120
+2,8 120
+364.9,15 121
+366.10,24 122
+20,23 122
+10,24 122
+10,24 122
+10,24 122
+367.7,30 123
+13,27 123
+28,29 123
+7,30 123
+368.7,20 124
+18,19 124
+7,20 124
+369.7,47 125
+27,33 125
+35,40 125
+42,46 125
+7,47 125
+370.7,20 126
+371.7,28 127
+372.7,12 128
+375.7,29 129
+13,26 129
+27,28 129
+7,29 129
+376.7,21 130
+13,20 130
+7,21 130
+7,21 121
+379.6,16 131
+11,15 131
+6,16 131
+381.6,41 132
+12,38 132
+39,40 132
+6,41 132
+382.10,29 133
+22,25 133
+27,28 133
+10,29 133
+10,29 133
+10,34 133
+383.14,15 134
+7,15 134
+386.13,15 135
+6,15 135
+6,15 136
+6,15 120
+389.4,13 137
+9,12 137
+4,13 137
+390.11,13 138
+4,13 138
+402.1,8 139
+403.16,21 140
+5,13 140
+5,21 140
+30,31 141
+23,31 141
+404.6,12 142
+23,30 143
+19,30 143
+33,43 143
+18,44 143
+14,44 143
+405.20,28 144
+18,28 144
+14,15 144
+14,29 144
+6,29 144
+6,29 145
+31,36 146
+404.46,49 147
+46,49 147
+407.8,11 148
+1,11 148
+433.6,12 149
+18,37 150
+14,37 150
+434.6,40 151
+15,19 151
+21,39 151
+21,39 151
+6,40 151
+6,40 151
+6,40 151
+435.3,35 152
+436.10,11 153
+3,11 153
+433.39,42 154
+39,42 154
+439.8,9 155
+1,9 155
+460.1,26 156
+19,22 156
+24,25 156
+1,26 156
+1,26 156
+461.5,16 157
+462.14,28 158
+26,27 158
+14,28 158
+14,28 158
+2,52 158
+2,52 158
+2,52 159
+30,51 158
+2,52 158
+2,52 158
+463.2,6 160
+465.6,15 161
+6,15 161
+467.14,28 162
+26,27 162
+14,28 162
+14,28 162
+2,58 162
+2,58 162
+2,58 163
+30,57 162
+2,58 162
+2,58 162
+473.0,1 164
+469.20,51 165
+24,51 165
+35,43 165
+45,50 165
+20,51 165
+20,51 166
+470.2,22 167
+10,15 167
+2,22 167
+2,22 167
+471.2,33 168
+13,16 168
+18,22 168
+24,32 168
+2,33 168
+2,33 168
+2,33 169
+2,33 170
+473.0,1 164
+477.1,11 171
+478.1,36 172
+13,16 172
+18,21 172
+23,35 172
+1,36 172
+1,36 172
+479.0,1 173
+490.1,27 174
+491.1,41 175
+17,28 175
+30,40 175
+1,41 175
+1,41 175
+492.1,38 176
+21,23 176
+25,28 176
+30,37 176
+1,38 176
+1,38 176
+493.14,17 177
+14,28 177
+1,28 177
+1,28 178
+494.0,1 179
+1:41.18,21 180
+23,26 180
+28,31 180
+33,36 180
+39,44 180
+46,47 180
+49,50 180
+53,54 180
+56,57 180
+59,60 180
+62,67 180
+69,70 180
+72,73 180
+0:499.1,14 181
+500.1,12 182
+501.1,12 183
+502.1,21 184
+503.5,22 185
+5,22 185
+504.2,26 186
+2,26 187
+506.2,27 188
+507.2,23 189
+509.1,14 190
+510.11,35 191
+11,35 191
+11,35 191
+1,35 191
+511.8,9 192
+1,9 192
+523.6,12 193
+18,27 194
+14,27 194
+524.6,14 195
+6,31 195
+525.10,11 196
+3,11 196
+523.29,32 197
+29,32 197
+526.8,10 198
+1,10 198
+531.6,12 199
+18,33 200
+14,33 200
+532.6,20 201
+6,32 201
+533.10,11 202
+3,11 202
+531.35,38 203
+35,38 203
+534.8,10 204
+1,10 204
+541.1,24 205
+542.1,45 206
+29,43 206
+29,43 206
+29,43 206
+35,37 206
+39,42 206
+29,43 206
+29,43 206
+29,43 206
+543.1,28 207
+11,22 207
+24,27 207
+1,28 207
+1,28 207
+544.1,11 208
+545.1,23 209
+7,20 209
+21,22 209
+1,23 209
+546.1,9 210
+1,9 210
+547.19,36 211
+19,36 211
+19,36 211
+548.24,59 212
+28,31 212
+32,50 212
+51,52 212
+53,58 212
+24,59 212
+24,59 212
+1,60 212
+1,5 212
+13,22 212
+13,22 212
+13,22 213
+13,22 214
+13,22 215
+13,22 216
+1,60 212
+1,60 212
+1,60 217
+549.24,47 218
+28,33 218
+34,39 218
+40,41 218
+42,46 218
+24,47 218
+24,47 218
+1,48 218
+1,5 218
+13,22 218
+13,22 218
+13,22 219
+13,22 220
+13,22 221
+13,22 222
+1,48 218
+1,48 218
+1,48 223
+550.24,53 224
+28,39 224
+40,45 224
+46,47 224
+48,52 224
+24,53 224
+24,53 224
+1,54 224
+1,5 224
+13,22 224
+13,22 224
+13,22 225
+13,22 226
+13,22 227
+13,22 228
+1,54 224
+1,54 224
+1,54 229
+551.24,53 230
+28,37 230
+38,43 230
+44,45 230
+46,52 230
+24,53 230
+24,53 230
+1,54 230
+1,5 230
+13,22 230
+13,22 230
+13,22 231
+13,22 232
+13,22 233
+13,22 234
+1,54 230
+1,54 230
+1,54 235
+552.24,49 236
+28,35 236
+36,41 236
+42,43 236
+44,48 236
+24,49 236
+24,49 236
+1,50 236
+1,5 236
+13,22 236
+13,22 236
+13,22 237
+13,22 238
+13,22 239
+13,22 240
+1,50 236
+1,50 236
+1,50 241
+553.24,49 242
+28,34 242
+35,40 242
+41,42 242
+43,48 242
+24,49 242
+24,49 242
+1,50 242
+1,5 242
+13,22 242
+13,22 242
+13,22 243
+13,22 244
+13,22 245
+13,22 246
+1,50 242
+1,50 242
+1,50 247
+554.24,51 248
+28,35 248
+36,41 248
+42,43 248
+44,50 248
+24,51 248
+24,51 248
+1,52 248
+1,5 248
+13,22 248
+13,22 248
+13,22 249
+13,22 250
+13,22 251
+13,22 252
+1,52 248
+1,52 248
+1,52 253
+555.24,63 254
+28,33 254
+34,52 254
+53,54 254
+55,62 254
+24,63 254
+24,63 254
+1,64 254
+1,5 254
+13,22 254
+13,22 254
+13,22 255
+13,22 256
+13,22 257
+13,22 258
+1,64 254
+1,64 254
+1,64 259
+556.24,67 260
+28,35 260
+36,54 260
+55,56 260
+57,66 260
+24,67 260
+24,67 260
+1,68 260
+1,5 260
+13,22 260
+13,22 260
+13,22 261
+13,22 262
+13,22 263
+13,22 264
+1,68 260
+1,68 260
+1,68 265
+557.6,12 266
+18,36 267
+14,36 267
+558.15,43 268
+25,42 268
+25,42 268
+15,43 268
+15,43 268
+559.6,13 269
+560.3,33 270
+566.3,31 271
+3,7 271
+15,24 271
+26,30 271
+3,31 271
+3,31 271
+3,31 272
+567.3,21 273
+3,21 274
+3,21 275
+3,21 276
+3,21 277
+3,21 278
+3,21 279
+3,21 280
+3,21 281
+557.38,41 282
+38,41 282
+571.1,31 283
+28,30 283
+1,31 283
+1,31 283
+573.34,55 284
+48,54 284
+34,55 284
+34,55 284
+16,67 284
+31,33 284
+31,33 284
+31,33 285
+57,66 284
+16,67 284
+16,67 284
+2,7 284
+9,12 284
+9,12 286
+9,12 287
+574.1,9 288
+577.1,9 289
+579.1,15 290
+580.1,17 291
+12,16 291
+1,17 291
+582.1,28 292
+7,25 292
+26,27 292
+1,28 292
+583.1,25 293
+584.1,27 294
+17,26 294
+1,27 294
+585.1,24 295
+586.1,13 296
+587.1,13 297
+588.1,14 298
+590.2,23 299
+2,23 299
+2,23 299
+591.6,17 300
+19,30 301
+592.6,13 302
+593.3,14 303
+594.3,12 304
+3,12 305
+597.3,14 306
+599.4,31 307
+9,18 307
+23,30 307
+4,31 307
+4,31 307
+600.8,17 308
+601.5,10 309
+603.11,16 310
+11,16 310
+605.11,20 310
+11,20 310
+602.4,10 310
+4,10 310
+4,10 310
+4,10 310
+604.5,10 311
+607.6,22 312
+6,22 312
+6,22 312
+608.6,27 313
+6,27 313
+6,27 313
+610.10,15 314
+611.7,30 315
+612.7,43 316
+24,29 316
+30,33 316
+34,42 316
+7,43 316
+613.7,20 317
+17,19 317
+7,20 317
+7,20 317
+614.7,21 318
+7,21 319
+7,21 320
+7,21 321
+617.7,12 322
+7,12 323
+7,12 323
+622.2,13 324
+623.2,13 325
+624.6,15 326
+625.3,27 327
+14,26 327
+3,27 327
+3,27 327
+626.3,8 328
+628.47,56 329
+47,49 329
+47,56 329
+47,56 329
+8,65 329
+20,45 329
+20,45 329
+20,45 330
+58,64 329
+8,65 329
+8,65 329
+2,68 329
+2,68 329
+2,68 331
+66,67 329
+2,68 329
+631.7,16 332
+632.3,67 333
+3,6 333
+13,66 333
+17,66 333
+28,34 333
+36,65 333
+13,66 333
+13,66 334
+3,67 333
+3,67 333
+633.3,46 335
+9,43 335
+44,45 335
+3,46 335
+3,46 336
+635.12,19 337
+12,19 337
+637.9,64 338
+22,54 338
+56,63 338
+9,64 338
+9,64 338
+3,67 338
+3,67 338
+3,67 339
+65,66 338
+3,67 338
+638.3,8 340
+640.3,20 341
+17,19 341
+3,20 341
+3,20 341
+641.7,15 342
+642.4,53 343
+4,7 343
+14,52 343
+18,52 343
+29,34 343
+36,51 343
+14,52 343
+14,52 344
+4,53 343
+4,53 343
+4,53 345
+643.4,9 346
+645.3,22 347
+646.3,17 348
+3,6 348
+15,16 348
+3,17 348
+647.19,34 349
+3,52 349
+648.8,14 350
+20,30 351
+16,30 351
+649.4,13 352
+16,30 352
+4,30 352
+648.32,35 353
+32,35 353
+650.21,26 354
+28,34 354
+3,12 354
+3,35 354
+3,35 355
+651.3,37 356
+24,33 356
+9,33 356
+9,33 357
+35,36 356
+3,37 356
+3,37 358
+3,37 337
+653.3,23 359
+17,22 359
+3,23 359
+3,23 359
+654.7,15 360
+655.22,24 361
+26,29 361
+4,13 361
+4,30 361
+4,30 362
+656.4,40 363
+27,36 363
+10,36 363
+10,36 364
+38,39 363
+4,40 363
+658.7,23 365
+660.4,16 366
+662.3,18 367
+3,6 367
+15,17 367
+3,18 367
+3,18 337
+664.3,29 368
+9,26 368
+27,28 368
+3,29 368
+665.3,25 369
+8,11 369
+19,24 369
+3,25 369
+3,25 369
+666.7,15 370
+667.4,36 371
+10,33 371
+34,35 371
+4,36 371
+668.4,45 372
+4,7 372
+14,44 372
+18,44 372
+29,34 372
+36,43 372
+14,44 372
+14,44 373
+4,45 372
+4,45 372
+4,45 374
+669.4,9 375
+671.3,31 376
+20,30 376
+3,31 376
+3,31 376
+672.7,21 377
+673.4,58 378
+4,7 378
+14,57 378
+18,57 378
+29,34 378
+36,56 378
+14,57 378
+14,57 379
+4,58 378
+4,58 378
+4,58 380
+674.4,9 381
+677.9,15 382
+17,30 383
+678.19,30 384
+9,15 384
+9,39 384
+679.6,36 385
+12,33 385
+34,35 385
+6,36 385
+680.10,36 386
+21,32 386
+21,35 386
+10,36 386
+10,36 386
+10,41 386
+681.12,17 387
+682.8,62 388
+8,11 388
+18,61 388
+22,61 388
+33,38 388
+40,60 388
+18,61 388
+18,61 389
+8,62 388
+8,62 388
+683.7,12 390
+686.6,19 391
+6,9 391
+17,18 391
+6,19 391
+687.10,25 392
+10,25 392
+10,25 392
+10,30 392
+688.7,60 393
+7,10 393
+17,59 393
+21,59 393
+32,37 393
+39,58 393
+17,59 393
+17,59 394
+7,60 393
+7,60 393
+7,60 395
+690.7,23 396
+18,22 396
+7,23 396
+691.7,40 397
+7,10 397
+17,39 397
+21,39 397
+33,38 397
+17,39 397
+17,39 398
+7,40 397
+7,40 397
+693.6,11 399
+677.32,35 400
+32,35 400
+32,35 401
+32,35 337
+698.3,45 402
+9,42 402
+43,44 402
+3,45 402
+699.12,26 403
+12,15 403
+24,25 403
+12,26 403
+12,26 403
+700.6,14 404
+6,14 405
+6,14 406
+6,14 407
+6,14 408
+701.4,9 409
+702.7,27 410
+7,27 410
+703.4,34 411
+10,31 411
+32,33 411
+4,34 411
+704.4,15 412
+4,7 412
+13,14 412
+4,15 412
+4,15 412
+4,15 413
+4,15 414
+4,15 415
+4,15 416
+4,15 417
+705.4,9 418
+708.8,27 419
+16,26 419
+8,27 419
+8,27 419
+8,27 419
+8,27 419
+8,27 419
+8,27 419
+710.22,66 420
+36,46 420
+48,56 420
+58,65 420
+22,66 420
+22,66 420
+711.8,18 421
+22,39 421
+712.5,26 422
+713.5,29 423
+5,9 423
+16,22 423
+24,28 423
+5,29 423
+5,29 423
+5,29 424
+715.4,44 425
+4,7 425
+14,43 425
+18,43 425
+28,33 425
+35,42 425
+14,43 425
+14,43 426
+4,44 425
+4,44 425
+4,44 427
+4,44 428
+4,44 429
+4,44 419
+717.4,38 430
+10,35 430
+36,37 430
+4,38 430
+718.25,41 431
+25,41 431
+25,41 431
+4,41 431
+4,41 432
+719.9,14 433
+26,57 434
+49,50 434
+52,56 434
+26,57 434
+26,57 434
+16,58 434
+16,19 434
+16,19 434
+16,19 435
+16,58 434
+16,58 434
+16,58 419
+722.4,33 436
+10,30 436
+31,32 436
+4,33 436
+723.25,36 437
+25,36 437
+25,36 437
+4,36 437
+4,36 438
+724.9,14 439
+725.15,46 440
+38,39 440
+41,45 440
+15,46 440
+15,46 440
+5,47 440
+5,8 440
+5,8 440
+5,8 441
+5,47 440
+5,47 440
+5,47 419
+728.25,50 442
+25,50 442
+25,50 442
+4,50 442
+4,50 443
+729.9,14 444
+730.15,46 445
+38,39 445
+41,45 445
+15,46 445
+15,46 445
+5,47 445
+5,8 445
+5,8 445
+5,8 446
+5,47 445
+5,47 445
+5,47 419
+734.8,21 447
+25,41 447
+735.5,22 448
+5,14 448
+20,21 448
+5,22 448
+5,22 448
+738.5,10 449
+740.4,19 450
+741.4,39 451
+22,28 451
+30,31 451
+32,36 451
+37,38 451
+4,39 451
+4,39 451
+742.9,14 452
+743.5,42 453
+5,8 453
+15,41 453
+19,41 453
+29,34 453
+36,40 453
+15,41 453
+15,41 454
+5,42 453
+5,42 453
+5,42 419
+746.8,21 455
+25,41 455
+748.5,22 456
+5,14 456
+20,21 456
+5,22 456
+5,22 456
+749.5,10 457
+751.4,19 458
+753.4,39 459
+22,28 459
+30,31 459
+32,36 459
+37,38 459
+4,39 459
+4,39 459
+754.9,14 460
+755.5,42 461
+5,8 461
+15,41 461
+19,41 461
+29,34 461
+36,40 461
+15,41 461
+15,41 462
+5,42 461
+5,42 461
+5,42 419
+758.8,26 463
+28,82 464
+28,31 464
+38,81 464
+42,81 464
+53,58 464
+60,80 464
+38,81 464
+38,81 465
+28,82 464
+28,82 464
+28,82 466
+760.26,69 467
+43,55 467
+56,68 467
+26,69 467
+26,69 467
+5,69 467
+5,69 468
+761.10,15 469
+762.6,43 470
+6,9 470
+16,42 470
+20,42 470
+30,35 470
+37,41 470
+16,42 470
+16,42 471
+6,43 470
+6,43 470
+6,43 419
+766.25,45 472
+25,45 472
+25,45 472
+4,45 472
+4,45 473
+767.9,14 474
+768.9,17 475
+9,22 475
+769.6,71 476
+6,9 476
+16,70 476
+20,70 476
+31,36 476
+38,69 476
+16,70 476
+16,70 477
+6,71 476
+6,71 476
+6,71 478
+771.16,47 479
+39,40 479
+42,46 479
+16,47 479
+16,47 479
+6,48 479
+6,9 479
+6,9 479
+6,9 480
+6,48 479
+6,48 479
+6,48 419
+774.4,56 481
+4,7 481
+14,55 481
+18,55 481
+29,34 481
+36,54 481
+14,55 481
+14,55 482
+4,56 481
+4,56 481
+4,56 419
+4,56 483
+4,56 484
+4,56 485
+4,56 486
+4,56 337
+779.3,46 487
+9,43 487
+44,45 487
+3,46 487
+781.12,27 488
+12,15 488
+25,26 488
+12,27 488
+12,27 488
+782.6,14 489
+783.4,37 490
+10,34 490
+35,36 490
+4,37 490
+4,37 491
+4,37 492
+4,37 493
+4,37 494
+784.4,9 495
+786.3,31 496
+20,30 496
+3,31 496
+3,31 496
+787.13,50 497
+27,40 497
+42,49 497
+13,50 497
+13,50 497
+788.7,22 498
+789.8,32 499
+18,31 499
+8,32 499
+8,32 499
+8,37 499
+790.5,791.40 500
+790.5,8 500
+15,791.39 500
+790.19,791.39 500
+790.30,35 500
+37,791.38 500
+790.15,791.39 500
+790.15,791.39 501
+790.5,791.40 500
+790.5,791.40 500
+790.5,791.40 502
+792.9,53 503
+9,12 503
+19,52 503
+23,52 503
+34,39 503
+41,51 503
+19,52 503
+19,52 504
+9,53 503
+9,53 503
+9,53 505
+795.12,26 506
+796.4,13 507
+797.9,13 508
+9,13 508
+803.9,24 509
+9,24 509
+9,24 509
+9,29 509
+804.6,47 510
+6,47 511
+806.6,22 512
+17,21 512
+6,22 512
+6,22 508
+810.5,22 513
+811.11,51 514
+23,47 514
+48,50 514
+11,51 514
+11,51 514
+5,54 514
+5,54 514
+5,54 515
+52,53 514
+5,54 514
+812.10,16 516
+22,37 517
+18,37 517
+816.34,48 518
+34,51 518
+10,19 518
+10,27 518
+10,51 518
+817.7,67 519
+24,33 519
+24,41 519
+24,44 519
+46,55 519
+46,63 519
+46,66 519
+7,67 519
+7,67 519
+7,67 520
+818.7,22 521
+18,21 521
+7,22 521
+7,22 521
+812.39,42 522
+39,42 522
+821.5,20 523
+5,20 523
+5,20 523
+822.9,17 524
+823.6,44 525
+824.6,11 526
+826.9,16 527
+827.22,37 528
+6,37 528
+828.6,11 529
+830.5,21 530
+16,20 530
+5,21 530
+5,21 530
+831.9,24 531
+9,24 531
+9,24 531
+9,29 531
+832.6,47 532
+833.6,11 533
+835.5,21 534
+16,20 534
+5,21 534
+5,21 508
+837.9,15 535
+838.6,25 536
+20,24 536
+6,25 536
+6,25 536
+839.10,18 537
+840.38,42 538
+13,42 538
+7,46 538
+7,46 539
+7,46 540
+842.7,48 541
+30,34 541
+43,47 541
+40,47 541
+36,47 541
+36,47 542
+7,48 541
+7,48 541
+843.11,20 543
+844.8,15 544
+8,15 545
+846.14,25 546
+8,26 546
+8,35 546
+48,52 546
+45,52 546
+8,52 546
+8,52 547
+8,52 548
+8,52 508
+852.9,14 549
+853.9,18 550
+854.6,23 551
+12,20 551
+21,22 551
+6,23 551
+855.6,43 552
+6,9 552
+16,42 552
+20,42 552
+31,36 552
+38,41 552
+16,42 552
+16,42 553
+6,43 552
+6,43 552
+6,43 554
+857.10,54 555
+10,13 555
+20,53 555
+24,53 555
+35,40 555
+42,52 555
+20,53 555
+20,53 556
+10,54 555
+10,54 555
+10,54 557
+10,54 558
+860.12,28 559
+861.8,16 560
+862.5,24 561
+863.4,48 562
+4,7 562
+14,47 562
+18,47 562
+29,34 562
+36,46 562
+14,47 562
+14,47 563
+4,48 562
+4,48 562
+4,48 564
+865.8,67 565
+8,11 565
+18,66 565
+22,66 565
+33,38 565
+40,65 565
+18,66 565
+18,66 566
+8,67 565
+8,67 565
+8,67 567
+8,67 568
+8,67 569
+8,67 570
+8,67 571
+8,67 337
+867.3,46 572
+9,43 572
+44,45 572
+3,46 572
+868.3,51 573
+3,6 573
+13,50 573
+17,50 573
+28,33 573
+35,49 573
+13,50 573
+13,50 574
+3,51 573
+3,51 573
+3,51 337
+870.3,18 575
+3,6 575
+15,17 575
+3,18 575
+3,18 337
+872.6,11 576
+873.3,14 577
+874.3,21 578
+19,20 578
+3,21 578
+3,21 578
+875.8,10 579
+876.4,68 580
+4,7 580
+14,67 580
+18,67 580
+29,35 580
+37,66 580
+14,67 580
+14,67 581
+4,68 580
+4,68 580
+877.4,27 582
+878.4,40 583
+21,26 583
+27,30 583
+31,39 583
+4,40 583
+879.4,17 584
+14,16 584
+4,17 584
+4,17 584
+880.4,18 585
+881.4,15 586
+882.4,19 587
+15,18 587
+4,19 587
+4,19 587
+4,19 588
+4,19 588
+886.1,12 589
+1,5 589
+1,12 589
+887.1,15 590
+6,14 590
+1,15 590
+888.1,12 591
+7,11 591
+1,12 591
+889.0,1 592
+902.1,12 593
+903.1,10 594
+904.1,13 595
+905.1,32 596
+906.8,13 597
+8,13 597
+8,13 597
+8,13 598
+1,13 597
+911.17,24 599
+5,13 599
+5,24 599
+912.9,11 600
+2,11 600
+913.1,11 601
+1,18 601
+914.1,8 602
+915.14,21 603
+5,10 603
+5,21 603
+916.2,11 604
+917.1,11 605
+918.8,9 606
+1,9 606
+923.5,18 607
+924.9,12 608
+2,12 608
+925.6,18 609
+1,18 609
+926.5,18 610
+22,38 610
+927.9,12 611
+2,12 611
+928.1,10 612
+929.16,23 613
+5,12 613
+5,23 613
+930.2,13 614
+931.1,11 615
+932.8,9 616
+1,9 616
+938.10,18 617
+10,18 617
+940.11,16 617
+11,16 617
+937.10,16 617
+10,16 617
+10,16 617
+10,16 617
+939.3,9 618
+941.3,43 619
+9,40 619
+41,42 619
+3,43 619
+942.3,67 620
+3,6 620
+13,66 620
+17,66 620
+28,34 620
+36,65 620
+13,66 620
+13,66 621
+3,67 620
+3,67 620
+943.3,18 622
+14,17 622
+3,18 622
+3,18 622
+3,18 623
+3,18 617
+949.1,15 624
+952.6,12 625
+14,27 626
+954.7,14 627
+25,36 627
+18,45 627
+955.3,15 628
+956.3,8 629
+958.11,18 630
+33,44 630
+33,56 630
+22,29 630
+22,56 630
+959.3,15 631
+960.3,8 632
+952.29,32 633
+29,32 633
+963.5,26 634
+30,42 634
+964.8,83 635
+21,62 635
+64,72 635
+73,82 635
+8,83 635
+8,83 635
+2,86 635
+2,86 635
+2,86 636
+84,85 635
+2,86 635
+965.9,12 637
+2,12 637
+967.1,23 638
+968.12,30 639
+1,41 639
+969.12,30 640
+1,44 640
+970.6,12 641
+14,19 642
+971.6,18 643
+972.3,26 644
+17,25 644
+3,26 644
+3,26 644
+973.9,49 645
+21,40 645
+41,48 645
+9,49 645
+9,49 645
+3,52 645
+3,52 645
+3,52 646
+50,51 645
+3,52 645
+974.13,31 647
+3,45 647
+975.9,36 648
+21,27 648
+28,35 648
+9,36 648
+9,36 648
+3,39 648
+3,39 648
+3,39 649
+37,38 648
+3,39 648
+977.22,58 650
+28,46 650
+28,57 650
+22,58 650
+22,58 650
+9,59 650
+9,59 650
+9,59 651
+9,59 650
+9,59 650
+5,980.13 650
+977.5,980.13 650
+977.5,980.13 652
+978.5,10 650
+979.5,12 650
+980.5,12 650
+977.5,980.13 650
+977.5,980.13 650
+976.3,980.14 650
+976.3,7 650
+14,17 650
+14,17 650
+14,17 653
+14,17 654
+14,17 655
+14,17 656
+3,980.14 650
+976.3,980.14 650
+976.3,980.14 657
+981.3,19 658
+14,18 658
+3,19 658
+3,19 658
+3,19 659
+970.21,24 660
+21,24 660
+985.5,17 661
+22,29 661
+38,41 662
+31,41 662
+986.5,12 663
+24,42 664
+14,57 664
+987.5,13 665
+17,44 665
+27,34 665
+36,43 665
+17,44 665
+17,44 665
+17,55 665
+989.2,14 666
+990.2,40 667
+24,31 667
+32,39 667
+2,40 667
+2,40 667
+991.6,24 668
+33,36 669
+26,36 669
+992.6,20 670
+6,32 670
+34,55 671
+993.2,25 672
+994.18,44 673
+28,35 673
+36,43 673
+18,44 673
+18,44 673
+2,57 673
+2,57 673
+2,57 674
+46,56 673
+2,57 673
+2,57 673
+995.6,15 675
+17,42 676
+26,33 676
+34,41 676
+17,42 676
+17,42 677
+997.3,40 678
+13,15 678
+16,24 678
+25,39 678
+3,40 678
+3,40 678
+998.3,30 679
+13,15 679
+16,20 679
+21,29 679
+3,30 679
+3,30 679
+999.3,11 680
+1000.10,14 681
+3,14 681
+3,14 682
+1005.5,24 683
+28,47 683
+51,72 683
+1006.2,16 684
+2,16 685
+1007.10,17 686
+1008.2,44 687
+18,26 687
+28,34 687
+36,43 687
+2,44 687
+2,44 687
+2,44 688
+1009.11,18 689
+1010.2,47 690
+21,29 690
+31,37 690
+39,46 690
+2,47 690
+2,47 690
+1011.5,13 691
+16,23 691
+5,23 691
+1012.2,20 692
+1013.2,30 693
+1014.18,26 694
+18,36 694
+2,45 694
+1015.29,37 695
+16,20 695
+16,38 695
+2,38 695
+2,38 696
+1016.2,22 697
+1017.15,22 698
+2,23 698
+1019.5,13 699
+1021.2,37 700
+21,28 700
+29,36 700
+2,37 700
+2,37 700
+1023.6,17 701
+1024.3,44 702
+20,25 702
+26,37 702
+38,43 702
+3,44 702
+3,44 702
+3,44 703
+1026.3,36 704
+18,23 704
+24,35 704
+3,36 704
+3,36 704
+1027.7,16 705
+1028.4,36 706
+14,16 706
+17,22 706
+23,35 706
+4,36 706
+4,36 706
+1030.6,15 707
+1031.3,35 708
+18,20 708
+21,25 708
+26,34 708
+3,35 708
+3,35 708
+1032.3,11 709
+1034.14,30 710
+24,29 710
+14,30 710
+14,30 710
+3,4 710
+6,9 710
+6,9 711
+6,9 712
+6,9 713
+6,9 714
+1035.6,12 715
+1036.3,43 716
+12,19 716
+20,27 716
+28,42 716
+3,43 716
+3,43 717
+3,43 718
+3,43 719
+3,43 720
+3,43 721
+3,43 722
+1039.8,12 723
+1,12 723
+1058.1,10 724
+1059.8,24 725
+1060.19,31 726
+1061.7,13 727
+15,28 728
+1062.14,25 729
+3,39 729
+1063.7,9 730
+21,32 731
+11,47 731
+1064.7,36 732
+13,24 732
+13,35 732
+7,36 732
+7,36 732
+7,45 732
+7,45 733
+49,62 732
+1065.10,23 734
+4,30 734
+4,30 735
+1066.4,9 736
+1061.30,33 737
+30,33 737
+1069.2,26 738
+2,26 739
+2,26 739
+1071.1,16 740
+1072.0,1 741
+1076.1,27 742
+18,26 742
+1,27 742
+1,27 742
+1078.1,10 743
+1079.1,13 744
+1080.8,24 745
+1081.19,31 746
+1082.6,22 747
+26,39 747
+1083.3,14 748
+1084.10,15 749
+16,18 749
+19,26 749
+3,34 749
+3,34 750
+3,34 751
+1087.9,22 752
+3,29 752
+3,29 753
+1088.2,26 754
+2,26 755
+2,26 755
+1090.5,17 756
+1091.9,16 757
+17,24 757
+25,32 757
+2,40 757
+2,40 758
+1092.1,16 759
+1093.0,1 760
+1098.1,27 761
+18,26 761
+1,27 761
+1,27 761
+1100.1,10 762
+1101.8,24 763
+1102.24,36 764
+1103.6,22 765
+26,39 765
+1104.9,27 766
+3,34 766
+3,34 767
+1105.2,26 768
+2,26 769
+2,26 769
+1107.1,16 770
+1108.0,1 771
+1112.1,27 772
+18,26 772
+1,27 772
+1,27 772
+1113.1,17 773
+1114.8,18 774
+1115.24,30 775
+1116.6,22 776
+26,39 776
+48,55 777
+41,55 777
+1117.2,14 778
+2,14 779
+2,14 779
+1119.8,10 780
+1,10 780
+1124.32,46 781
+38,45 781
+32,46 781
+32,46 781
+19,47 781
+19,47 781
+19,47 782
+19,47 781
+19,47 781
+1,47 781
+1,47 783
+1125.5,12 784
+14,34 785
+29,33 785
+14,34 785
+14,34 785
+1126.6,14 786
+6,18 786
+1,25 786
+1127.8,12 787
+1,12 787
+1132.1,27 788
+7,24 788
+25,26 788
+1,27 788
+1133.1,28 789
+9,13 789
+15,18 789
+20,27 789
+1,28 789
+1,28 789
+1135.5,42 790
+15,19 790
+21,24 790
+26,33 790
+34,41 790
+5,42 790
+5,42 790
+5,46 790
+1136.3,66 791
+9,63 791
+64,65 791
+3,66 791
+1137.10,12 792
+3,12 792
+1139.8,9 793
+1,9 793
+1145.1,23 794
+1148.1,7 795
+44,57 795
+15,58 795
+1,58 795
+1149.1,7 796
+15,31 796
+1,31 796
+1151.5,20 797
+5,20 797
+5,20 797
+5,25 797
+1152.9,11 798
+2,11 798
+1154.1,7 799
+1,16 799
+1156.1,45 800
+23,27 800
+29,34 800
+36,44 800
+1,45 800
+1,45 800
+1157.5,27 801
+1158.9,11 802
+2,11 802
+1159.8,9 803
+1,9 803
+1164.1,6 804
+1165.1,18 805
+1166.1,18 806
+1168.1,22 807
+14,16 807
+17,21 807
+1,22 807
+1169.1,14 808
+1170.1,24 809
+21,23 809
+1,24 809
+1171.1,14 810
+1173.1,9 811
+1175.5,7 812
+5,7 812
+1180.9,11 812
+9,11 812
+1174.1,7 812
+1,7 812
+1,7 812
+1,7 812
+1176.3,13 813
+8,12 813
+3,13 813
+1177.3,36 814
+9,33 814
+34,35 814
+3,36 814
+1178.3,9 815
+1179.3,8 816
+1181.3,13 817
+8,12 817
+3,13 817
+1182.3,8 818
+1184.8,9 819
+1,9 819
+1189.1,28 820
+7,25 820
+26,27 820
+1,28 820
+1190.9,26 821
+19,20 821
+22,25 821
+9,26 821
+9,26 821
+1,26 821
+1191.5,18 822
+5,18 822
+5,18 822
+5,23 822
+1192.2,11 823
+1193.2,8 824
+1195.1,7 825
+1,16 825
+1196.1,7 826
+1,16 826
+1197.1,36 827
+23,27 827
+29,32 827
+34,35 827
+1,36 827
+1,36 827
+1198.5,20 828
+1199.2,11 829
+1200.2,8 830
+1202.1,9 831
+1203.1,21 832
+7,18 832
+19,20 832
+1,21 832
+1204.0,1 833
+1218.5,16 834
+25,28 835
+18,28 835
+1219.1,31 836
+7,28 836
+29,30 836
+1,31 836
+1222.9,27 837
+1,30 837
+1223.1,18 838
+1224.5,15 839
+1225.2,29 840
+1226.6,24 841
+33,36 842
+26,36 842
+1229.8,65 843
+20,47 843
+48,56 843
+58,64 843
+8,65 843
+8,65 843
+2,68 843
+2,68 843
+2,68 844
+66,67 843
+2,68 843
+1230.6,24 845
+6,35 845
+1231.3,32 846
+1232.2,16 847
+1234.2,31 848
+1235.2,42 849
+32,37 849
+39,41 849
+2,42 849
+2,42 849
+1236.2,23 850
+1237.2,47 851
+16,27 851
+16,21 851
+16,27 851
+29,41 851
+43,46 851
+2,47 851
+2,47 851
+1238.2,52 852
+20,31 852
+20,25 852
+20,31 852
+33,46 852
+48,51 852
+2,52 852
+2,52 852
+1239.2,51 853
+20,31 853
+20,25 853
+20,31 853
+33,45 853
+47,50 853
+2,51 853
+2,51 853
+1240.2,36 854
+16,27 854
+16,21 854
+16,27 854
+29,30 854
+32,35 854
+2,36 854
+2,36 854
+1242.2,41 855
+16,27 855
+16,21 855
+16,27 855
+29,35 855
+37,40 855
+2,41 855
+2,41 855
+1243.2,36 856
+16,27 856
+16,21 856
+16,27 856
+29,30 856
+32,35 856
+2,36 856
+2,36 856
+1244.2,43 857
+16,27 857
+16,21 857
+16,27 857
+29,37 857
+39,42 857
+2,43 857
+2,43 857
+1246.8,76 858
+21,46 858
+48,54 858
+56,65 858
+67,75 858
+8,76 858
+8,76 858
+2,79 858
+2,79 858
+2,79 859
+77,78 858
+2,79 858
+1247.2,16 860
+2,16 860
+2,16 860
+1249.6,31 861
+6,31 861
+6,31 861
+6,31 861
+6,36 861
+1250.9,39 862
+21,33 862
+35,38 862
+9,39 862
+9,39 862
+3,42 862
+3,42 862
+3,42 863
+40,41 862
+3,42 862
+1251.10,13 864
+3,13 864
+1253.2,22 865
+1254.8,52 866
+21,39 866
+41,51 866
+8,52 866
+8,52 866
+2,55 866
+2,55 866
+2,55 867
+53,54 866
+2,55 866
+1256.21,46 868
+29,40 868
+29,34 868
+29,40 868
+21,46 868
+21,46 868
+21,46 868
+3,12 868
+14,17 868
+1257.13,38 869
+21,32 869
+21,26 869
+21,32 869
+13,38 869
+13,38 869
+13,38 869
+3,4 869
+6,9 869
+1258.20,45 870
+28,39 870
+28,33 870
+28,39 870
+20,45 870
+20,45 870
+20,45 870
+3,11 870
+13,16 870
+1259.8,78 871
+21,56 871
+58,64 871
+66,67 871
+69,77 871
+8,78 871
+8,78 871
+2,81 871
+2,81 871
+2,81 872
+79,80 871
+2,81 871
+1261.6,17 873
+1262.21,51 874
+39,44 874
+29,34 874
+29,45 874
+21,51 874
+21,51 874
+21,51 874
+4,12 874
+14,17 874
+1263.14,44 875
+32,37 875
+22,27 875
+22,38 875
+14,44 875
+14,44 875
+14,44 875
+4,5 875
+7,10 875
+1264.14,44 876
+32,37 876
+22,27 876
+22,38 876
+14,44 876
+14,44 876
+14,44 876
+4,5 876
+7,10 876
+1265.18,48 877
+36,41 877
+26,31 877
+26,42 877
+18,48 877
+18,48 877
+18,48 877
+4,9 877
+11,14 877
+1266.3,21 878
+3,47 878
+1267.3,38 879
+1268.9,76 880
+21,56 880
+57,58 880
+59,60 880
+61,69 880
+70,75 880
+9,76 880
+9,76 880
+3,79 880
+3,79 880
+3,79 881
+77,78 880
+3,79 880
+1270.6,16 882
+6,27 882
+29,50 883
+1271.8,53 884
+21,49 884
+51,52 884
+8,53 884
+8,53 884
+2,56 884
+2,56 884
+2,56 885
+54,55 884
+2,56 884
+1272.33,38 886
+23,28 886
+23,39 886
+2,39 886
+2,39 887
+1273.2,13 888
+1274.6,24 889
+26,31 890
+1276.8,32 891
+18,27 891
+28,29 891
+30,31 891
+8,32 891
+8,32 891
+1,32 891
+1281.9,27 892
+1,30 892
+1282.1,32 893
+1283.1,27 894
+7,24 894
+25,26 894
+1,27 894
+1284.7,64 895
+19,46 895
+47,55 895
+57,63 895
+7,64 895
+7,64 895
+1,67 895
+1,67 895
+1,67 896
+65,66 895
+1,67 895
+1285.5,23 897
+32,35 898
+25,35 898
+1286.5,23 899
+5,34 899
+1287.2,31 900
+1288.1,15 901
+1289.1,30 902
+1290.1,41 903
+31,36 903
+38,40 903
+1,41 903
+1,41 903
+1291.1,22 904
+1292.1,46 905
+15,26 905
+15,20 905
+15,26 905
+28,40 905
+42,45 905
+1,46 905
+1,46 905
+1293.1,51 906
+19,30 906
+19,24 906
+19,30 906
+32,45 906
+47,50 906
+1,51 906
+1,51 906
+1294.1,50 907
+19,30 907
+19,24 907
+19,30 907
+32,44 907
+46,49 907
+1,50 907
+1,50 907
+1295.1,35 908
+15,26 908
+15,20 908
+15,26 908
+28,29 908
+31,34 908
+1,35 908
+1,35 908
+1297.1,40 909
+15,26 909
+15,20 909
+15,26 909
+28,34 909
+36,39 909
+1,40 909
+1,40 909
+1298.1,35 910
+15,26 910
+15,20 910
+15,26 910
+28,29 910
+31,34 910
+1,35 910
+1,35 910
+1299.1,42 911
+15,26 911
+15,20 911
+15,26 911
+28,36 911
+38,41 911
+1,42 911
+1,42 911
+1301.7,74 912
+20,44 912
+46,52 912
+54,63 912
+65,73 912
+7,74 912
+7,74 912
+1,77 912
+1,77 912
+1,77 913
+75,76 912
+1,77 912
+1302.1,15 914
+1,15 914
+1,15 914
+1303.5,31 915
+5,31 915
+5,31 915
+5,31 915
+5,36 915
+1304.8,38 916
+20,32 916
+34,37 916
+8,38 916
+8,38 916
+2,41 916
+2,41 916
+2,41 917
+39,40 916
+2,41 916
+1305.9,12 918
+2,12 918
+1307.1,21 919
+1308.7,51 920
+20,38 920
+40,50 920
+7,51 920
+7,51 920
+1,54 920
+1,54 920
+1,54 921
+52,53 920
+1,54 920
+1309.17,42 922
+25,36 922
+25,30 922
+25,36 922
+17,42 922
+17,42 922
+17,42 922
+2,8 922
+10,13 922
+1310.12,37 923
+20,31 923
+20,25 923
+20,31 923
+12,37 923
+12,37 923
+12,37 923
+2,3 923
+5,8 923
+1311.19,44 924
+27,38 924
+27,32 924
+27,38 924
+19,44 924
+19,44 924
+19,44 924
+2,10 924
+12,15 924
+1312.7,84 925
+20,54 925
+56,62 925
+64,73 925
+75,83 925
+7,84 925
+7,84 925
+1,87 925
+1,87 925
+1,87 926
+85,86 925
+1,87 925
+1313.1,29 927
+1314.26,31 928
+16,21 928
+16,32 928
+1,32 928
+1,32 929
+1315.8,16 930
+1,16 930
+1320.1,27 931
+1321.1,41 932
+31,36 932
+38,40 932
+1,41 932
+1,41 932
+1323.1,22 933
+1324.1,46 934
+15,26 934
+15,20 934
+15,26 934
+28,40 934
+42,45 934
+1,46 934
+1,46 934
+1325.1,51 935
+19,30 935
+19,24 935
+19,30 935
+32,45 935
+47,50 935
+1,51 935
+1,51 935
+1326.1,50 936
+19,30 936
+19,24 936
+19,30 936
+32,44 936
+46,49 936
+1,50 936
+1,50 936
+1327.1,15 937
+1,15 937
+1,15 937
+1329.5,22 938
+5,22 938
+5,22 938
+5,27 938
+1330.9,11 939
+2,11 939
+1331.8,9 940
+1,9 940
+1344.1,8 941
+1346.1,35 942
+1347.1,40 943
+31,36 943
+38,39 943
+1,40 943
+1,40 943
+1348.1,15 944
+1,15 944
+1,15 944
+1350.5,22 945
+5,22 945
+5,22 945
+5,27 945
+36,38 946
+29,38 946
+1351.1,22 947
+1353.16,41 948
+24,35 948
+24,29 948
+24,35 948
+16,41 948
+16,41 948
+16,41 948
+2,7 948
+9,12 948
+1354.20,45 949
+28,39 949
+28,33 949
+28,39 949
+20,45 949
+20,45 949
+20,45 949
+2,11 949
+13,16 949
+1355.14,39 950
+22,33 950
+22,27 950
+22,33 950
+14,39 950
+14,39 950
+14,39 950
+2,5 950
+7,10 950
+1356.6,77 951
+18,60 951
+61,66 951
+67,76 951
+6,77 951
+6,77 951
+1,77 951
+1,77 952
+1357.5,14 953
+1358.2,11 954
+2,11 955
+1360.7,55 956
+19,50 956
+51,54 956
+7,55 956
+7,55 956
+2,55 956
+2,55 957
+1362.8,9 958
+1,9 958
+1369.1,31 959
+1370.1,40 960
+31,36 960
+38,39 960
+1,40 960
+1,40 960
+1371.1,15 961
+1,15 961
+1,15 961
+1373.5,22 962
+5,22 962
+5,22 962
+5,27 962
+36,63 963
+29,63 963
+1374.1,22 964
+1375.15,40 965
+23,34 965
+23,28 965
+23,34 965
+15,40 965
+15,40 965
+15,40 965
+2,6 965
+8,11 965
+1376.8,46 966
+20,39 966
+41,45 966
+8,46 966
+8,46 966
+1,46 966
+1381.1,9 967
+1382.5,12 968
+1383.23,37 969
+23,37 969
+23,37 969
+2,38 969
+2,38 969
+2,38 969
+2,38 969
+1384.2,23 970
+1385.2,25 971
+2,34 971
+1386.2,25 972
+33,50 972
+41,49 972
+33,50 972
+33,50 972
+2,50 972
+1387.2,25 973
+33,49 973
+41,48 973
+33,49 973
+33,49 973
+2,49 973
+1388.2,25 974
+33,49 974
+41,48 974
+33,49 974
+33,49 974
+2,49 974
+1389.2,25 975
+2,34 975
+1390.2,25 976
+33,49 976
+41,48 976
+33,49 976
+33,49 976
+2,49 976
+1391.2,25 977
+33,48 977
+41,47 977
+33,48 977
+33,48 977
+2,48 977
+1392.2,25 978
+33,48 978
+41,47 978
+33,48 978
+33,48 978
+2,48 978
+2,48 979
+2,48 980
+1395.18,38 981
+32,33 981
+34,37 981
+18,38 981
+18,38 981
+1396.6,12 982
+21,22 983
+14,22 983
+1397.2,10 984
+1398.7,13 985
+15,20 986
+1399.16,49 987
+30,41 987
+43,48 987
+16,49 987
+16,49 987
+1400.7,14 988
+23,24 989
+16,24 989
+1401.3,8 990
+1402.8,15 991
+17,23 992
+1403.10,28 993
+4,29 993
+37,57 993
+49,56 993
+45,56 993
+45,56 994
+37,57 993
+37,57 993
+4,57 993
+1404.4,9 995
+1405.4,18 996
+1402.25,29 997
+25,29 997
+1407.3,25 998
+3,25 999
+3,25 1000
+1398.22,25 1001
+22,25 1001
+22,25 1002
+22,25 1003
+1410.8,9 1004
+1,9 1004
+1415.1,26 1005
+1416.1,40 1006
+31,36 1006
+38,39 1006
+1,40 1006
+1,40 1006
+1417.5,22 1007
+20,21 1007
+5,22 1007
+5,22 1007
+5,22 1007
+31,32 1008
+24,32 1008
+1418.1,15 1009
+1,15 1009
+1,15 1009
+1419.5,22 1010
+5,22 1010
+5,22 1010
+5,27 1010
+36,37 1011
+29,37 1011
+1420.8,9 1012
+1,9 1012
+1425.3,8 1013
+1,15 1013
+1426.1,9 1014
+1427.1,11 1015
+1428.1,11 1016
+1429.6,12 1017
+18,23 1018
+14,23 1018
+1430.6,10 1019
+6,16 1019
+20,24 1019
+20,30 1019
+1431.7,12 1020
+16,25 1020
+16,29 1020
+34,40 1021
+31,47 1021
+1432.17,20 1022
+9,10 1022
+9,21 1022
+3,21 1022
+3,21 1023
+1433.3,14 1024
+1434.3,12 1025
+3,12 1026
+1436.7,16 1027
+1429.25,28 1028
+25,28 1028
+1438.5,11 1029
+1,15 1029
+1439.8,14 1030
+18,23 1030
+18,30 1030
+32,35 1031
+32,35 1031
+1440.12,15 1032
+8,10 1032
+8,16 1032
+1,16 1032
+1445.1,26 1033
+1446.1,40 1034
+31,36 1034
+38,39 1034
+1,40 1034
+1,40 1034
+1447.1,15 1035
+1,15 1035
+1,15 1035
+1448.5,22 1036
+5,22 1036
+5,22 1036
+5,27 1036
+1449.9,33 1037
+2,33 1037
+1450.1,1451.61 1038
+1450.18,37 1038
+43,52 1038
+39,52 1038
+57,66 1038
+53,66 1038
+1451.6,15 1038
+2,15 1038
+21,30 1038
+17,30 1038
+36,45 1038
+32,45 1038
+51,60 1038
+47,60 1038
+1450.1,1451.61 1038
+1450.1,1451.61 1038
+1452.19,30 1039
+28,29 1039
+19,30 1039
+19,30 1039
+8,30 1039
+8,35 1039
+8,35 1040
+1,35 1039
+1457.1,17 1041
+1,17 1041
+1458.1,31 1042
+7,28 1042
+29,30 1042
+1,31 1042
+1459.1,30 1043
+1460.1,41 1044
+31,36 1044
+38,40 1044
+1,41 1044
+1,41 1044
+1461.1,14 1045
+1,14 1045
+1462.1,15 1046
+1,15 1046
+1,15 1046
+1463.5,22 1047
+5,22 1047
+5,22 1047
+5,27 1047
+1464.9,11 1048
+2,11 1048
+1465.1,19 1049
+1,19 1049
+1,19 1049
+1,19 1050
+1466.8,9 1051
+1,9 1051
+1471.1,22 1052
+1472.1,35 1053
+15,26 1053
+15,20 1053
+15,26 1053
+28,29 1053
+31,34 1053
+1,35 1053
+1,35 1053
+1473.1,35 1054
+15,26 1054
+15,20 1054
+15,26 1054
+28,29 1054
+31,34 1054
+1,35 1054
+1,35 1054
+1474.1,54 1055
+19,30 1055
+19,24 1055
+19,30 1055
+32,48 1055
+50,53 1055
+1,54 1055
+1,54 1055
+1475.1,54 1056
+19,30 1056
+19,24 1056
+19,30 1056
+32,48 1056
+50,53 1056
+1,54 1056
+1,54 1056
+1476.0,1 1057
+1480.1,30 1058
+1481.1,41 1059
+31,36 1059
+38,40 1059
+1,41 1059
+1,41 1059
+1482.1,16 1060
+14,15 1060
+1,16 1060
+1483.1,15 1061
+1,15 1061
+1,15 1061
+1484.5,22 1062
+5,22 1062
+5,22 1062
+5,27 1062
+36,38 1063
+29,38 1063
+1485.1,19 1064
+1,19 1064
+1,19 1064
+1,19 1065
+1486.8,9 1066
+1,9 1066
+1491.1,22 1067
+1492.1,35 1068
+15,26 1068
+15,20 1068
+15,26 1068
+28,29 1068
+31,34 1068
+1,35 1068
+1,35 1068
+1493.1,35 1069
+15,26 1069
+15,20 1069
+15,26 1069
+28,29 1069
+31,34 1069
+1,35 1069
+1,35 1069
+1494.1,61 1070
+19,30 1070
+19,24 1070
+19,30 1070
+32,43 1070
+32,55 1070
+57,60 1070
+1,61 1070
+1,61 1070
+1495.1,60 1071
+19,30 1071
+19,24 1071
+19,30 1071
+32,43 1071
+32,54 1071
+56,59 1071
+1,60 1071
+1,60 1071
+1496.0,1 1072
+1500.1,39 1073
+7,36 1073
+37,38 1073
+1,39 1073
+1501.1,38 1074
+1502.1,40 1075
+31,36 1075
+38,39 1075
+1,40 1075
+1,40 1075
+1503.1,22 1076
+1504.1,37 1077
+15,26 1077
+15,20 1077
+15,26 1077
+28,31 1077
+33,36 1077
+1,37 1077
+1,37 1077
+1505.1,35 1078
+15,26 1078
+15,20 1078
+15,26 1078
+28,29 1078
+31,34 1078
+1,35 1078
+1,35 1078
+1506.1,15 1079
+1,15 1079
+1,15 1079
+1508.1,18 1080
+1,18 1080
+1,18 1080
+1509.0,1 1081
+1515.1,21 1082
+1516.20,45 1083
+28,39 1083
+28,33 1083
+28,39 1083
+20,45 1083
+20,45 1083
+20,45 1083
+2,11 1083
+13,16 1083
+1517.1,55 1084
+18,43 1084
+45,54 1084
+1,55 1084
+1,55 1084
+1518.6,11 1085
+13,26 1086
+1519.34,59 1087
+42,53 1087
+42,47 1087
+42,53 1087
+34,59 1087
+34,59 1087
+34,59 1087
+3,14 1087
+3,25 1087
+27,30 1087
+1520.35,64 1088
+47,58 1088
+47,52 1088
+47,58 1088
+60,63 1088
+35,64 1088
+35,64 1088
+35,64 1088
+3,14 1088
+3,26 1088
+28,31 1088
+28,31 1089
+1521.34,63 1090
+46,57 1090
+46,51 1090
+46,57 1090
+59,62 1090
+34,63 1090
+34,63 1090
+34,63 1090
+3,14 1090
+3,25 1090
+27,30 1090
+27,30 1091
+1522.37,62 1092
+45,56 1092
+45,50 1092
+45,56 1092
+37,62 1092
+37,62 1092
+37,62 1092
+3,14 1092
+3,28 1092
+30,33 1092
+1523.37,62 1093
+45,56 1093
+45,50 1093
+45,56 1093
+37,62 1093
+37,62 1093
+37,62 1093
+3,14 1093
+3,28 1093
+30,33 1093
+1524.6,17 1094
+6,35 1094
+39,50 1094
+39,78 1094
+39,78 1094
+1525.3,14 1095
+3,32 1095
+1526.7,1529.30 1096
+1526.19,39 1096
+41,52 1096
+41,63 1096
+1527.11,22 1096
+4,34 1096
+1528.11,22 1096
+4,33 1096
+1529.4,15 1096
+4,29 1096
+1526.7,1529.30 1096
+1526.7,1529.30 1096
+1526.2,1529.30 1096
+1526.2,1529.30 1097
+1518.28,31 1098
+28,31 1098
+1531.1,11 1099
+7,8 1099
+9,10 1099
+1,11 1099
+1532.5,13 1100
+1533.2,14 1101
+2,14 1101
+1534.8,9 1102
+1,9 1102
+1539.1,30 1103
+7,27 1103
+28,29 1103
+1,30 1103
+1540.1,40 1104
+1541.1,40 1105
+31,36 1105
+38,39 1105
+1,40 1105
+1,40 1105
+1542.1,15 1106
+1,15 1106
+1,15 1106
+1544.5,22 1107
+5,22 1107
+5,22 1107
+5,28 1107
+1545.9,23 1108
+9,23 1108
+9,23 1108
+2,23 1108
+1546.1,47 1109
+7,44 1109
+45,46 1109
+1,47 1109
+1547.8,10 1110
+1,10 1110
+1585.1,9 1111
+1586.1,21 1112
+1587.16,41 1113
+24,35 1113
+24,29 1113
+24,35 1113
+16,41 1113
+16,41 1113
+16,41 1113
+2,7 1113
+9,12 1113
+1588.5,16 1114
+1589.9,39 1115
+2,39 1115
+1590.7,33 1116
+19,29 1116
+31,32 1116
+7,33 1116
+7,33 1116
+1,33 1116
+1,33 1117
+1591.1,15 1118
+1592.5,22 1119
+1593.2,15 1120
+1594.6,12 1121
+14,23 1122
+1595.2,12 1123
+1596.17,44 1124
+27,38 1124
+27,32 1124
+27,38 1124
+40,43 1124
+17,44 1124
+17,44 1124
+17,44 1124
+3,8 1124
+10,13 1124
+10,13 1125
+1597.10,44 1126
+22,29 1126
+31,43 1126
+10,44 1126
+10,44 1126
+2,44 1126
+2,44 1127
+1598.13,38 1128
+21,32 1128
+21,26 1128
+21,32 1128
+13,38 1128
+13,38 1128
+13,38 1128
+3,4 1128
+6,9 1128
+1599.16,45 1129
+28,39 1129
+28,33 1129
+28,39 1129
+41,44 1129
+16,45 1129
+16,45 1129
+16,45 1129
+3,7 1129
+9,12 1129
+9,12 1130
+1600.10,43 1131
+22,29 1131
+31,42 1131
+10,43 1131
+10,43 1131
+2,43 1131
+2,43 1132
+1601.2,12 1133
+1602.7,8 1134
+7,8 1134
+7,8 1134
+7,8 1134
+1606.15,40 1135
+23,34 1135
+23,28 1135
+23,34 1135
+15,40 1135
+15,40 1135
+15,40 1135
+5,6 1135
+8,11 1135
+1607.15,40 1136
+23,34 1136
+23,28 1136
+23,34 1136
+15,40 1136
+15,40 1136
+15,40 1136
+5,6 1136
+8,11 1136
+1608.12,57 1137
+24,50 1137
+52,53 1137
+55,56 1137
+12,57 1137
+12,57 1137
+4,57 1137
+4,57 1138
+1610.9,15 1139
+17,22 1140
+1611.16,45 1141
+28,39 1141
+28,33 1141
+28,39 1141
+41,44 1141
+16,45 1141
+16,45 1141
+16,45 1141
+6,7 1141
+9,12 1141
+9,12 1142
+1612.16,41 1143
+24,35 1143
+24,29 1143
+24,35 1143
+16,41 1143
+16,41 1143
+16,41 1143
+6,7 1143
+9,12 1143
+1613.13,51 1144
+25,37 1144
+39,47 1144
+49,50 1144
+13,51 1144
+13,51 1144
+5,51 1144
+5,51 1145
+1614.9,15 1146
+1615.6,21 1147
+19,20 1147
+6,21 1147
+6,21 1147
+1616.10,18 1148
+16,17 1148
+10,18 1148
+10,18 1148
+20,21 1148
+5,27 1148
+5,27 1149
+1610.24,27 1150
+24,27 1150
+1618.4,60 1151
+14,60 1151
+31,43 1151
+37,42 1151
+31,43 1151
+31,43 1151
+45,56 1151
+51,55 1151
+45,56 1151
+45,56 1151
+58,59 1151
+4,60 1151
+4,60 1152
+4,60 1153
+4,60 1154
+4,60 1134
+1620.15,40 1155
+23,34 1155
+23,28 1155
+23,34 1155
+15,40 1155
+15,40 1155
+15,40 1155
+5,6 1155
+8,11 1155
+1621.15,40 1156
+23,34 1156
+23,28 1156
+23,34 1156
+15,40 1156
+15,40 1156
+15,40 1156
+5,6 1156
+8,11 1156
+1622.15,40 1157
+23,34 1157
+23,28 1157
+23,34 1157
+15,40 1157
+15,40 1157
+15,40 1157
+5,6 1157
+8,11 1157
+1623.12,68 1158
+24,58 1158
+60,61 1158
+63,64 1158
+66,67 1158
+12,68 1158
+12,68 1158
+4,68 1158
+4,68 1159
+1624.4,19 1160
+4,19 1134
+1626.15,40 1161
+23,34 1161
+23,28 1161
+23,34 1161
+15,40 1161
+15,40 1161
+15,40 1161
+5,6 1161
+8,11 1161
+1627.9,10 1162
+1629.17,46 1163
+29,40 1163
+29,34 1163
+29,40 1163
+42,45 1163
+17,46 1163
+17,46 1163
+17,46 1163
+7,8 1163
+10,13 1163
+10,13 1164
+10,13 1162
+1631.17,46 1165
+29,40 1165
+29,34 1165
+29,40 1165
+42,45 1165
+17,46 1165
+17,46 1165
+17,46 1165
+7,8 1165
+10,13 1165
+10,13 1166
+10,13 1162
+1633.14,49 1167
+26,45 1167
+47,48 1167
+14,49 1167
+14,49 1167
+6,49 1167
+6,49 1168
+1634.6,11 1169
+1636.4,19 1170
+1637.12,41 1171
+24,30 1171
+32,40 1171
+12,41 1171
+12,41 1171
+4,41 1171
+4,41 1172
+4,41 1134
+1639.4,9 1173
+1641.4,9 1174
+1643.12,47 1175
+24,43 1175
+45,46 1175
+12,47 1175
+12,47 1175
+4,47 1175
+4,47 1176
+1644.4,9 1177
+1646.6,15 1178
+1647.19,31 1179
+25,30 1179
+19,31 1179
+19,31 1179
+8,45 1179
+8,45 1179
+8,45 1180
+33,44 1179
+8,45 1179
+8,45 1179
+8,45 1179
+1648.15,27 1181
+21,26 1181
+15,27 1181
+15,27 1181
+29,37 1181
+4,49 1181
+4,49 1182
+1650.7,37 1183
+12,22 1183
+24,36 1183
+7,37 1183
+7,37 1183
+7,37 1183
+1651.3,13 1184
+3,13 1185
+3,13 1186
+1594.25,28 1187
+25,28 1187
+1653.5,14 1188
+1654.22,33 1189
+2,51 1189
+1655.22,33 1190
+2,51 1190
+1656.2,7 1191
+1657.8,22 1192
+1658.3,17 1193
+3,30 1193
+1659.15,18 1194
+15,18 1194
+3,19 1194
+3,32 1194
+1657.24,44 1195
+24,44 1195
+1662.8,10 1196
+1,10 1196
+1667.7,16 1197
+1668.6,12 1198
+6,17 1198
+6,17 1199
+1669.10,11 1200
+3,11 1200
+1667.18,30 1201
+18,30 1201
+1670.8,9 1202
+1,9 1202
+1675.1,24 1203
+1,33 1203
+1676.1,24 1204
+1,33 1204
+1677.1,24 1205
+1,33 1205
+1678.1,24 1206
+1,33 1206
+1679.8,9 1207
+1,9 1207
+1684.5,16 1208
+25,27 1209
+18,27 1209
+1685.7,52 1210
+20,44 1210
+46,51 1210
+7,52 1210
+7,52 1210
+1,55 1210
+1,55 1210
+1,55 1211
+53,54 1210
+1,55 1210
+1686.1,33 1212
+1687.1,22 1213
+1688.5,16 1214
+1689.2,41 1215
+32,37 1215
+39,40 1215
+2,41 1215
+2,41 1215
+2,41 1216
+1691.6,15 1217
+6,20 1217
+1692.10,40 1218
+10,45 1218
+10,45 1219
+3,45 1218
+1693.2,14 1220
+22,30 1220
+2,30 1220
+1694.8,13 1221
+2,14 1221
+22,30 1221
+2,30 1221
+1695.8,13 1222
+2,14 1222
+22,30 1222
+2,30 1222
+1696.8,13 1223
+2,14 1223
+22,30 1223
+2,30 1223
+1697.2,41 1224
+32,37 1224
+39,40 1224
+2,41 1224
+2,41 1224
+1699.1,15 1225
+1,15 1225
+1,15 1225
+1700.5,22 1226
+5,22 1226
+5,22 1226
+5,27 1226
+36,66 1227
+36,71 1227
+36,71 1228
+29,71 1227
+1701.1,21 1229
+1703.15,39 1230
+23,34 1230
+23,28 1230
+23,34 1230
+15,39 1230
+15,39 1230
+15,39 1230
+2,6 1230
+8,11 1230
+1704.1,8 1231
+1705.1,9 1232
+1706.5,16 1233
+1707.7,15 1234
+21,30 1235
+17,30 1235
+1708.14,22 1236
+10,22 1236
+3,22 1236
+1709.7,11 1237
+7,15 1237
+23,42 1238
+35,39 1238
+40,41 1238
+23,42 1238
+23,42 1238
+17,45 1238
+17,45 1238
+17,45 1239
+43,44 1238
+17,45 1238
+1707.32,35 1240
+32,35 1240
+1711.2,15 1241
+8,12 1241
+13,14 1241
+2,15 1241
+1713.6,12 1242
+14,22 1243
+1716.15,41 1244
+25,36 1244
+25,30 1244
+25,36 1244
+37,40 1244
+15,41 1244
+15,41 1244
+15,41 1244
+3,7 1244
+8,11 1244
+8,11 1245
+1717.16,40 1246
+24,35 1246
+24,29 1246
+24,35 1246
+16,40 1246
+16,40 1246
+16,40 1246
+3,8 1246
+9,12 1246
+1718.8,52 1247
+21,36 1247
+38,39 1247
+40,45 1247
+46,51 1247
+8,52 1247
+8,52 1247
+2,55 1247
+2,55 1247
+2,55 1248
+53,54 1247
+2,55 1247
+1719.7,12 1249
+7,12 1249
+7,12 1249
+7,12 1249
+1721.16,40 1250
+24,35 1250
+24,29 1250
+24,35 1250
+16,40 1250
+16,40 1250
+16,40 1250
+5,8 1250
+9,12 1250
+1722.25,35 1251
+4,35 1251
+4,35 1252
+4,35 1249
+1724.17,43 1253
+27,38 1253
+27,32 1253
+27,38 1253
+39,42 1253
+17,43 1253
+17,43 1253
+17,43 1253
+5,9 1253
+10,13 1253
+10,13 1254
+10,13 1249
+1726.17,45 1255
+29,40 1255
+29,34 1255
+29,40 1255
+41,44 1255
+17,45 1255
+17,45 1255
+17,45 1255
+5,9 1255
+10,13 1255
+10,13 1256
+10,13 1249
+1728.17,45 1257
+29,40 1257
+29,34 1257
+29,40 1257
+41,44 1257
+17,45 1257
+17,45 1257
+17,45 1257
+5,9 1257
+10,13 1257
+10,13 1258
+10,13 1249
+1730.4,34 1259
+4,34 1249
+1736.7,55 1260
+19,29 1260
+30,41 1260
+43,54 1260
+7,55 1260
+7,55 1260
+2,55 1260
+2,55 1261
+2,55 1262
+2,55 1263
+1713.24,27 1264
+24,27 1264
+1738.8,9 1265
+1,9 1265
+1744.7,61 1266
+20,48 1266
+50,55 1266
+57,60 1266
+7,61 1266
+7,61 1266
+1,64 1266
+1,64 1266
+1,64 1267
+62,63 1266
+1,64 1266
+1745.5,14 1268
+5,19 1268
+1746.9,44 1269
+2,44 1269
+1747.1,22 1270
+1748.1,13 1271
+21,29 1271
+1,29 1271
+1749.7,12 1272
+1,13 1272
+21,29 1272
+1,29 1272
+1750.7,12 1273
+1,13 1273
+21,29 1273
+1,29 1273
+1751.7,12 1274
+1,13 1274
+21,29 1274
+1,29 1274
+1752.1,9 1275
+1753.1,37 1276
+15,26 1276
+15,20 1276
+15,26 1276
+28,31 1276
+33,36 1276
+1,37 1276
+1,37 1276
+1755.1,33 1277
+1756.1,40 1278
+31,36 1278
+38,39 1278
+1,40 1278
+1,40 1278
+1757.1,15 1279
+1,15 1279
+1,15 1279
+1759.5,29 1280
+5,29 1280
+5,29 1280
+5,29 1280
+5,34 1280
+1760.2,22 1281
+16,21 1281
+2,22 1281
+2,22 1281
+1761.6,14 1282
+1762.3,18 1283
+3,28 1283
+1763.9,12 1284
+2,12 1284
+1766.9,23 1285
+9,23 1285
+2,23 1285
+1771.1,34 1286
+1772.1,40 1287
+31,36 1287
+38,39 1287
+1,40 1287
+1,40 1287
+1773.1,15 1288
+1,15 1288
+1,15 1288
+1775.5,22 1289
+5,22 1289
+5,22 1289
+5,27 1289
+1776.9,11 1290
+2,11 1290
+1778.1,24 1291
+1,24 1291
+1,24 1291
+1779.1,30 1292
+1780.1,40 1293
+31,36 1293
+38,39 1293
+1,40 1293
+1,40 1293
+1781.1,15 1294
+1,15 1294
+1,15 1294
+1783.8,25 1295
+8,25 1295
+8,25 1295
+1,25 1295
+1788.7,56 1296
+19,43 1296
+45,55 1296
+7,56 1296
+7,56 1296
+1,59 1296
+1,59 1296
+1,59 1297
+57,58 1296
+1,59 1296
+1789.7,74 1298
+19,39 1298
+46,54 1298
+42,54 1298
+41,58 1298
+64,72 1298
+59,73 1298
+41,73 1298
+7,74 1298
+7,74 1298
+1,77 1298
+1,77 1298
+1,77 1299
+75,76 1298
+1,77 1298
+1790.7,55 1300
+19,40 1300
+46,54 1300
+42,54 1300
+7,55 1300
+7,55 1300
+1,58 1300
+1,58 1300
+1,58 1301
+56,57 1300
+1,58 1300
+1791.7,73 1302
+19,40 1302
+48,56 1302
+48,56 1302
+47,60 1302
+61,71 1302
+46,72 1302
+42,72 1302
+7,73 1302
+7,73 1302
+1,76 1302
+1,76 1302
+1,76 1303
+74,75 1302
+1,76 1302
+1792.7,79 1304
+19,44 1304
+52,61 1304
+52,61 1304
+51,65 1304
+66,77 1304
+50,78 1304
+46,78 1304
+7,79 1304
+7,79 1304
+1,82 1304
+1,82 1304
+1,82 1305
+80,81 1304
+1,82 1304
+1793.0,1 1306
+1797.1,7 1307
+1,16 1307
+1798.1,7 1308
+1,16 1308
+1799.1,7 1309
+1,16 1309
+1800.1,7 1310
+1,16 1310
+1801.1,7 1311
+16,30 1311
+15,37 1311
+1,37 1311
+1802.1,7 1312
+15,32 1312
+1,32 1312
+1803.1,8 1313
+1,17 1313
+1804.1,8 1314
+1,17 1314
+1806.1,11 1315
+1807.1,7 1316
+16,23 1316
+15,30 1316
+1,30 1316
+1808.1,7 1317
+16,23 1317
+15,30 1317
+1,30 1317
+1809.1,7 1318
+16,22 1318
+15,29 1318
+1,29 1318
+1810.1,7 1319
+15,24 1319
+1,24 1319
+1812.8,12 1320
+1,12 1320
+1817.1,28 1321
+7,25 1321
+26,27 1321
+1,28 1321
+1818.6,43 1322
+16,20 1322
+22,25 1322
+27,34 1322
+35,42 1322
+6,43 1322
+6,43 1322
+5,48 1322
+52,55 1322
+1819.2,8 1323
+2,17 1323
+1820.2,8 1324
+2,17 1324
+1821.2,29 1325
+10,14 1325
+16,19 1325
+21,28 1325
+2,29 1325
+2,29 1325
+1822.9,10 1326
+2,10 1326
+1824.1,7 1327
+1,16 1327
+1825.1,7 1328
+1,16 1328
+1826.1,28 1329
+9,13 1329
+15,18 1329
+20,27 1329
+1,28 1329
+1,28 1329
+1828.8,9 1330
+1,9 1330
+1833.1,28 1331
+7,25 1331
+26,27 1331
+1,28 1331
+1834.6,24 1332
+21,23 1332
+6,24 1332
+6,24 1332
+6,24 1332
+1835.2,36 1333
+8,33 1333
+34,35 1333
+2,36 1333
+1836.9,11 1334
+2,11 1334
+1839.17,23 1335
+13,23 1335
+12,26 1335
+11,30 1335
+36,42 1335
+31,43 1335
+1,44 1335
+1840.1,16 1336
+1841.1,37 1337
+16,20 1337
+22,25 1337
+27,28 1337
+29,36 1337
+1,37 1337
+1,37 1337
+1842.5,11 1338
+1843.8,76 1339
+21,69 1339
+71,72 1339
+74,75 1339
+8,76 1339
+8,76 1339
+2,79 1339
+2,79 1339
+2,79 1340
+77,78 1339
+2,79 1339
+1844.9,11 1341
+2,11 1341
+1846.8,9 1342
+1,9 1342
+1851.1,26 1343
+7,23 1343
+24,25 1343
+1,26 1343
+1852.1,15 1344
+1853.5,30 1345
+20,29 1345
+20,25 1345
+20,29 1345
+5,30 1345
+5,30 1345
+5,35 1345
+1854.2,11 1346
+1855.2,36 1347
+8,33 1347
+34,35 1347
+2,36 1347
+1856.9,10 1348
+2,10 1348
+1859.1,15 1349
+1,15 1349
+1860.11,19 1350
+1,19 1350
+1861.20,37 1351
+6,9 1351
+5,16 1351
+5,37 1351
+1862.2,45 1352
+8,42 1352
+43,44 1352
+2,45 1352
+1863.2,15 1353
+10,14 1353
+2,15 1353
+1864.9,10 1354
+2,10 1354
+1867.21,29 1355
+17,29 1355
+16,33 1355
+39,47 1355
+34,48 1355
+1,48 1355
+1869.8,32 1356
+1870.6,40 1357
+21,39 1357
+21,26 1357
+21,39 1357
+6,40 1357
+6,40 1357
+6,45 1357
+1871.3,35 1358
+9,32 1358
+33,34 1358
+3,35 1358
+1872.3,12 1359
+1873.10,11 1360
+3,11 1360
+1878.1,39 1361
+11,15 1361
+17,20 1361
+22,29 1361
+31,38 1361
+1,39 1361
+1,39 1361
+1879.16,25 1362
+16,25 1362
+15,29 1362
+30,41 1362
+14,42 1362
+9,43 1362
+1,43 1362
+1884.1,22 1363
+13,15 1363
+17,21 1363
+1,22 1363
+1,22 1363
+1885.1,15 1364
+12,14 1364
+1,15 1364
+1,15 1364
+1886.1,22 1365
+13,15 1365
+17,21 1365
+1,22 1365
+1,22 1365
+1887.1,25 1366
+13,15 1366
+17,24 1366
+1,25 1366
+1,25 1366
+1888.0,1 1367
+1892.1,63 1368
+30,40 1368
+19,40 1368
+19,49 1368
+19,49 1369
+51,62 1368
+1,63 1368
+1,63 1368
+1893.5,16 1370
+1894.2,52 1371
+13,17 1371
+19,39 1371
+41,51 1371
+2,52 1371
+2,52 1371
+1895.0,1 1372
+1899.5,67 1373
+33,43 1373
+22,43 1373
+22,52 1373
+22,52 1374
+54,65 1373
+5,67 1373
+5,67 1373
+5,67 1373
+5,74 1373
+5,74 1375
+1900.2,28 1376
+14,16 1376
+18,27 1376
+2,28 1376
+2,28 1376
+1901.0,1 1377
+1912.1,11 1378
+1913.1,14 1379
+1914.1,16 1380
+1916.25,36 1381
+1,36 1381
+1,36 1382
+1917.1,26 1383
+1919.6,12 1384
+18,29 1385
+14,29 1385
+1920.2,67 1386
+33,44 1386
+22,44 1386
+45,55 1386
+22,55 1386
+22,55 1387
+56,66 1386
+2,67 1386
+2,67 1386
+1921.6,19 1388
+1922.3,13 1389
+1923.2,14 1390
+2,14 1391
+1919.31,34 1392
+31,34 1392
+1925.1,11 1393
+1,11 1393
+1927.1,37 1394
+17,24 1394
+26,36 1394
+1,37 1394
+1,37 1394
+1928.5,14 1395
+1929.10,13 1396
+15,18 1396
+20,62 1396
+32,52 1396
+54,61 1396
+20,62 1396
+20,62 1396
+2,63 1396
+1930.1,40 1397
+20,26 1397
+28,39 1397
+1,40 1397
+1,40 1397
+1931.5,17 1398
+1932.10,13 1399
+15,18 1399
+20,61 1399
+32,52 1399
+54,60 1399
+20,61 1399
+20,61 1399
+2,62 1399
+1934.1,1943.2 1400
+1935.2,9 1400
+2,9 1400
+1936.2,6 1400
+2,6 1400
+1937.2,6 1400
+2,6 1400
+1938.2,6 1400
+2,6 1400
+1939.2,6 1400
+2,6 1400
+1940.2,6 1400
+2,6 1400
+1941.2,6 1400
+2,6 1400
+1942.2,5 1400
+2,5 1400
+1945.6,11 1401
+17,27 1402
+13,27 1402
+1946.6,40 1403
+18,23 1403
+24,28 1403
+30,39 1403
+30,39 1403
+6,40 1403
+6,40 1403
+6,44 1403
+1947.9,59 1404
+21,47 1404
+49,58 1404
+49,58 1404
+9,59 1404
+9,59 1404
+3,62 1404
+3,62 1404
+3,62 1405
+60,61 1404
+3,62 1404
+1945.29,32 1406
+29,32 1406
+1949.1,16 1407
+12,15 1407
+1,16 1407
+1,16 1407
+1950.1,12 1408
+9,11 1408
+1,12 1408
+1951.1,25 1409
+13,18 1409
+20,24 1409
+1,25 1409
+1,25 1409
+1952.1,15 1410
+12,14 1410
+1,15 1410
+1,15 1410
+1953.1,25 1411
+13,18 1411
+20,24 1411
+1,25 1411
+1,25 1411
+1954.9,11 1412
+13,18 1412
+20,23 1412
+1,24 1412
+1959.5,14 1413
+1960.2,27 1414
+8,24 1414
+25,26 1414
+2,27 1414
+1961.2,48 1415
+12,14 1415
+16,35 1415
+37,41 1415
+43,47 1415
+2,48 1415
+2,48 1415
+1963.0,1 1416
+1967.1,25 1417
+1969.1,25 1418
+18,19 1418
+21,24 1418
+1,25 1418
+1,25 1418
+1971.1,14 1419
+1972.17,27 1420
+1,47 1420
+39,45 1420
+39,45 1420
+39,45 1420
+39,45 1420
+39,45 1420
+39,45 1420
+1974.7,58 1421
+19,43 1421
+48,57 1421
+44,57 1421
+7,58 1421
+7,58 1421
+1,61 1421
+1,61 1421
+1,61 1422
+59,60 1421
+1,61 1421
+1976.2,37 1423
+17,19 1423
+21,24 1423
+26,27 1423
+29,36 1423
+2,37 1423
+2,37 1423
+1977.6,13 1424
+1978.3,19 1425
+1979.3,9 1426
+1981.8,45 1427
+20,33 1427
+38,44 1427
+34,44 1427
+8,45 1427
+8,45 1427
+2,48 1427
+2,48 1427
+2,48 1428
+46,47 1427
+2,48 1427
+1982.20,29 1429
+20,29 1429
+10,16 1429
+10,29 1429
+1983.1,28 1430
+7,25 1430
+26,27 1430
+1,28 1430
+1985.1,39 1431
+16,18 1431
+20,27 1431
+20,23 1431
+20,27 1431
+29,30 1431
+31,38 1431
+1,39 1431
+1,39 1431
+1986.6,12 1432
+14,19 1433
+1987.8,85 1434
+20,49 1434
+50,53 1434
+63,66 1434
+59,67 1434
+55,67 1434
+80,83 1434
+73,84 1434
+69,84 1434
+8,85 1434
+8,85 1434
+2,88 1434
+2,88 1434
+2,88 1435
+86,87 1434
+2,88 1434
+1986.21,24 1436
+21,24 1436
+1988.5,11 1437
+1989.2,35 1438
+8,32 1438
+33,34 1438
+2,35 1438
+1990.2,6 1439
+1993.2,29 1440
+8,26 1440
+27,28 1440
+2,29 1440
+1994.9,12 1441
+2,17 1441
+1995.2,16 1442
+1998.0,1 1443
+2002.1,25 1444
+2004.1,25 1445
+18,19 1445
+21,24 1445
+1,25 1445
+1,25 1445
+2005.1,14 1446
+2008.1,7 1447
+2009.1,11 1448
+2011.2,41 1449
+17,19 1449
+21,28 1449
+21,24 1449
+21,28 1449
+30,31 1449
+33,40 1449
+2,41 1449
+2,41 1449
+2012.6,11 1450
+2013.17,26 1451
+17,26 1451
+7,13 1451
+7,26 1451
+2014.4,13 1452
+2015.4,10 1453
+13,19 1453
+4,19 1453
+2016.4,9 1454
+4,9 1455
+2019.4,7 1456
+2020.13,23 1457
+8,23 1457
+25,30 1458
+25,30 1459
+2023.7,10 1460
+2024.6,13 1461
+15,20 1462
+2027.6,12 1463
+14,19 1464
+32,76 1465
+44,61 1465
+62,63 1465
+69,75 1465
+65,75 1465
+32,76 1465
+32,76 1465
+26,79 1465
+26,79 1465
+26,79 1466
+77,78 1465
+26,79 1465
+21,24 1467
+21,24 1467
+2028.5,12 1468
+2029.2,42 1469
+8,39 1469
+40,41 1469
+2,42 1469
+2030.2,6 1470
+2033.2,36 1471
+8,33 1471
+34,35 1471
+2,36 1471
+2034.9,12 1472
+2,18 1472
+2035.2,16 1473
+2037.0,1 1474
+2043.10,16 1475
+6,16 1475
+6,16 1475
+6,16 1475
+6,16 1475
+6,16 1475
+2045.17,23 1476
+13,23 1476
+12,28 1476
+34,40 1476
+30,40 1476
+29,45 1476
+12,45 1476
+51,57 1476
+47,57 1476
+46,61 1476
+12,61 1476
+67,73 1476
+62,74 1476
+3,74 1476
+2046.16,22 1477
+12,22 1477
+11,26 1477
+32,38 1477
+27,39 1477
+3,39 1477
+2047.16,22 1478
+12,22 1478
+11,26 1478
+32,38 1478
+27,39 1478
+3,39 1478
+2049.3,19 1479
+14,18 1479
+3,19 1479
+3,19 1479
+2051.8,14 1480
+2053.5,22 1481
+5,22 1480
+2055.5,21 1482
+5,21 1480
+2057.5,21 1483
+5,21 1480
+2059.5,21 1484
+5,21 1480
+2061.5,20 1485
+5,20 1480
+2063.9,73 1486
+21,65 1486
+66,72 1486
+9,73 1486
+9,73 1486
+3,76 1486
+3,76 1486
+3,76 1487
+74,75 1486
+3,76 1486
+2064.9,59 1488
+21,52 1488
+53,58 1488
+9,59 1488
+9,59 1488
+3,62 1488
+3,62 1488
+3,62 1489
+60,61 1488
+3,62 1488
+2065.9,61 1490
+21,54 1490
+55,60 1490
+9,61 1490
+9,61 1490
+3,64 1490
+3,64 1490
+3,64 1491
+62,63 1490
+3,64 1490
+2066.7,39 1492
+19,26 1492
+27,31 1492
+33,38 1492
+7,39 1492
+7,39 1492
+7,43 1492
+2067.10,60 1493
+22,52 1493
+54,59 1493
+10,60 1493
+10,60 1493
+4,63 1493
+4,63 1493
+4,63 1494
+61,62 1493
+4,63 1493
+2068.11,13 1495
+4,13 1495
+2071.3,38 1496
+9,35 1496
+36,37 1496
+3,38 1496
+2072.10,12 1497
+3,12 1497
+2074.3,51 1498
+9,48 1498
+49,50 1498
+3,51 1498
+2075.10,12 1499
+3,12 1499
+2077.9,59 1500
+21,47 1500
+52,58 1500
+48,58 1500
+9,59 1500
+9,59 1500
+3,62 1500
+3,62 1500
+3,62 1501
+60,61 1500
+3,62 1500
+2078.10,12 1502
+3,12 1502
+2080.8,9 1503
+1,9 1503
+2085.1,25 1504
+18,19 1504
+21,24 1504
+1,25 1504
+1,25 1504
+2087.1,12 1505
+2088.7,37 1506
+20,33 1506
+35,36 1506
+7,37 1506
+7,37 1506
+1,40 1506
+1,40 1506
+1,40 1507
+38,39 1506
+1,40 1506
+2089.1,11 1508
+2090.8,17 1509
+2091.2,42 1510
+17,19 1510
+21,32 1510
+21,24 1510
+21,32 1510
+34,41 1510
+2,42 1510
+2,42 1510
+2092.2,15 1511
+13,14 1511
+2,15 1511
+2,15 1511
+2093.6,12 1512
+2094.3,8 1513
+2095.2,12 1514
+2,12 1514
+2097.1,14 1515
+2099.0,1 1516
+2117.1,6 1517
+2118.1,18 1518
+2119.1,18 1519
+2121.1,19 1520
+14,16 1520
+17,18 1520
+1,19 1520
+2122.1,14 1521
+2123.1,29 1522
+14,16 1522
+18,21 1522
+23,24 1522
+26,28 1522
+1,29 1522
+2124.1,14 1523
+2126.1,9 1524
+2128.5,7 1525
+5,7 1525
+2133.9,11 1525
+9,11 1525
+2127.1,7 1525
+1,7 1525
+1,7 1525
+1,7 1525
+2129.3,13 1526
+8,12 1526
+3,13 1526
+2130.9,48 1527
+22,47 1527
+9,48 1527
+9,48 1527
+3,51 1527
+3,51 1527
+3,51 1528
+49,50 1527
+3,51 1527
+2131.3,12 1529
+2132.10,12 1530
+3,12 1530
+2134.3,13 1531
+8,12 1531
+3,13 1531
+2135.3,8 1532
+2137.8,9 1533
+1,9 1533
+2142.7,37 1534
+19,33 1534
+35,36 1534
+7,37 1534
+7,37 1534
+1,40 1534
+1,40 1534
+1,40 1535
+38,39 1534
+1,40 1534
+2143.1,12 1536
+2144.8,18 1537
+2145.2,45 1538
+18,20 1538
+22,34 1538
+22,25 1538
+22,34 1538
+36,44 1538
+2,45 1538
+2,45 1538
+2146.2,15 1539
+13,14 1539
+2,15 1539
+2,15 1539
+2147.6,12 1540
+2148.9,53 1541
+21,52 1541
+9,53 1541
+9,53 1541
+3,56 1541
+3,56 1541
+3,56 1542
+54,55 1541
+3,56 1541
+2149.3,13 1543
+3,13 1543
+2151.10,16 1544
+3,16 1544
+2153.2,13 1545
+2,13 1545
+2155.7,52 1546
+19,43 1546
+45,51 1546
+7,52 1546
+7,52 1546
+1,55 1546
+1,55 1546
+1,55 1547
+53,54 1546
+1,55 1546
+2156.8,14 1548
+1,14 1548
+2161.1,14 1549
+9,13 1549
+1,14 1549
+2162.1,27 1550
+7,24 1550
+25,26 1550
+1,27 1550
+2163.1,78 1551
+32,49 1551
+21,49 1551
+50,65 1551
+21,65 1551
+21,65 1552
+67,77 1551
+1,78 1551
+1,78 1551
+2164.1,26 1553
+2165.5,18 1554
+2167.3,37 1555
+18,24 1555
+25,28 1555
+29,36 1555
+3,37 1555
+3,37 1555
+2168.7,12 1556
+14,37 1557
+27,30 1557
+27,34 1557
+20,34 1557
+20,34 1558
+35,36 1557
+14,37 1557
+14,37 1559
+2171.2,15 1560
+8,12 1560
+13,14 1560
+2,15 1560
+2174.0,1 1561
+2173.6,44 1562
+12,41 1562
+42,43 1562
+6,44 1562
+2174.0,1 1561
+2179.1,12 1563
+2180.1,7 1564
+16,23 1564
+15,30 1564
+1,30 1564
+2181.1,7 1565
+16,23 1565
+15,30 1565
+1,30 1565
+2182.1,7 1566
+16,22 1566
+15,29 1566
+1,29 1566
+2183.1,7 1567
+15,24 1567
+1,24 1567
+2186.1,10 1568
+2187.1,7 1569
+16,22 1569
+15,29 1569
+1,29 1569
+2188.1,7 1570
+15,24 1570
+1,24 1570
+2191.1,10 1571
+2192.1,8 1572
+17,23 1572
+16,30 1572
+1,30 1572
+2193.1,8 1573
+16,25 1573
+1,25 1573
+2194.1,8 1574
+1,29 1574
+21,24 1574
+26,28 1574
+1,29 1574
+1,29 1574
+2196.5,32 1575
+13,17 1575
+19,22 1575
+24,31 1575
+5,32 1575
+5,32 1575
+36,43 1575
+5,43 1575
+2197.2,51 1576
+8,48 1576
+49,50 1576
+2,51 1576
+2198.2,6 1577
+2200.1,44 1578
+7,41 1578
+42,43 1578
+1,44 1578
+2201.0,1 1579
+2207.1,25 1580
+18,19 1580
+21,24 1580
+1,25 1580
+1,25 1580
+2208.1,13 1581
+2209.1,18 1582
+12,17 1582
+1,18 1582
+1,18 1582
+2210.1,15 1583
+2211.0,1 1584
+2216.6,12 1585
+18,28 1586
+14,28 1586
+2217.16,25 1587
+16,25 1587
+6,12 1587
+6,25 1587
+2218.9,93 1588
+21,65 1588
+66,67 1588
+72,78 1588
+68,78 1588
+83,92 1588
+79,92 1588
+9,93 1588
+9,93 1588
+3,96 1588
+3,96 1588
+3,96 1589
+94,95 1588
+3,96 1588
+2219.10,11 1590
+3,11 1590
+2216.30,33 1591
+30,33 1591
+2222.1,27 1592
+7,24 1592
+25,26 1592
+1,27 1592
+2223.8,9 1593
+1,9 1593
+2228.1,9 1594
+2229.7,13 1595
+15,20 1596
+2230.13,19 1597
+9,19 1597
+2,19 1597
+2229.22,25 1598
+22,25 1598
+2231.15,26 1599
+10,26 1599
+3,26 1599
+2237.1,5 1600
+14,19 1600
+13,26 1600
+1,26 1600
+2238.1,5 1601
+14,19 1601
+13,26 1601
+1,26 1601
+2239.1,5 1602
+14,18 1602
+13,25 1602
+1,25 1602
+2240.1,5 1603
+13,22 1603
+1,22 1603
+2242.8,15 1604
+1,15 1604
+2247.6,12 1605
+14,20 1606
+2248.2,6 1607
+2,15 1607
+2247.22,25 1608
+22,25 1608
+2249.6,11 1609
+17,22 1610
+13,22 1610
+2250.2,6 1611
+9,13 1611
+2,13 1611
+2249.24,27 1612
+24,27 1612
+2251.8,16 1613
+1,16 1613
+2256.6,12 1614
+14,20 1615
+2257.2,6 1616
+2,15 1616
+2256.22,25 1617
+22,25 1617
+2258.6,11 1618
+17,22 1619
+13,22 1619
+2259.2,6 1620
+9,13 1620
+2,13 1620
+2258.24,27 1621
+24,27 1621
+2260.8,16 1622
+1,16 1622
+2279.11,15 1623
+7,15 1623
+6,20 1623
+26,30 1623
+22,30 1623
+21,35 1623
+6,35 1623
+41,45 1623
+37,45 1623
+36,49 1623
+6,49 1623
+55,59 1623
+50,60 1623
+1,60 1623
+2280.8,9 1624
+1,9 1624
+2296.1,22 1625
+2297.9,10 1626
+9,15 1626
+1,15 1626
+1,15 1627
+2298.9,10 1628
+12,17 1628
+1,18 1628
+2308.1,14 1629
+2309.6,11 1630
+1,13 1630
+2310.8,14 1631
+18,22 1631
+18,27 1631
+2311.2,5 1632
+2,5 1632
+2312.12,15 1633
+8,9 1633
+8,16 1633
+1,16 1633
+2322.8,14 1634
+1,22 1634
+2323.8,11 1635
+1,11 1635
+2328.1,18 1636
+2329.8,13 1637
+1,13 1637
+2343.14,19 1638
+14,23 1638
+1,32 1638
+2344.1,11 1639
+2345.1,10 1640
+2346.6,12 1641
+18,25 1642
+18,29 1642
+14,29 1642
+2348.13,24 1643
+13,24 1643
+2,24 1643
+2349.17,24 1644
+12,25 1644
+12,25 1644
+2,25 1644
+2350.18,25 1645
+13,26 1645
+13,26 1645
+2,26 1645
+2352.2,42 1646
+28,40 1646
+17,41 1646
+13,41 1646
+2,42 1646
+2,42 1646
+2353.2,69 1647
+28,40 1647
+17,41 1647
+13,41 1647
+55,67 1647
+44,68 1647
+13,68 1647
+2,69 1647
+2,69 1647
+2354.2,41 1648
+27,39 1648
+17,40 1648
+13,40 1648
+2,41 1648
+2,41 1648
+2356.7,16 1649
+18,26 1650
+2357.7,13 1651
+7,13 1651
+3,14 1651
+3,19 1651
+2358.7,13 1652
+7,13 1652
+3,14 1652
+3,19 1652
+2359.7,13 1653
+7,13 1653
+3,14 1653
+3,19 1653
+2356.28,34 1654
+28,34 1654
+2361.2,12 1655
+2346.31,34 1656
+31,34 1656
+2363.8,11 1657
+1,11 1657
+2368.1,11 1658
+2369.5,10 1659
+12,18 1660
+2370.5,12 1661
+14,21 1662
+2371.8,14 1663
+1,14 1663
+2376.1,34 1664
+26,27 1664
+28,29 1664
+30,33 1664
+1,34 1664
+1,34 1664
+2378.23,34 1665
+20,34 1665
+1,43 1665
+2380.29,91 1666
+41,68 1666
+70,78 1666
+80,81 1666
+83,84 1666
+86,87 1666
+89,90 1666
+29,91 1666
+29,91 1666
+15,91 1666
+1,91 1666
+1,91 1667
+2381.1,24 1668
+2382.8,16 1669
+1,16 1669
+2387.5,10 1670
+5,14 1670
+23,24 1671
+16,24 1671
+2388.5,18 1672
+7,12 1672
+7,16 1672
+5,6 1672
+5,18 1672
+5,28 1672
+5,28 1673
+37,38 1674
+30,38 1674
+2389.11,16 1675
+11,20 1675
+8,9 1675
+8,21 1675
+8,28 1675
+8,28 1676
+1,28 1675
+2396.1,15 1677
+2397.5,11 1678
+13,26 1679
+2398.27,56 1680
+33,44 1680
+33,55 1680
+27,56 1680
+27,56 1680
+14,57 1680
+14,57 1680
+14,57 1681
+14,57 1680
+14,57 1680
+2399.8,19 1680
+4,28 1680
+2400.4,15 1680
+4,27 1680
+2398.2,2400.40 1680
+2398.2,2400.40 1682
+2397.28,31 1683
+28,31 1683
+2401.0,1 1684
+2405.6,12 1685
+14,27 1686
+2406.23,52 1687
+29,40 1687
+29,51 1687
+23,52 1687
+23,52 1687
+2,53 1687
+2,53 1687
+2,53 1688
+2,53 1687
+2,53 1687
+2407.2,12 1689
+2408.37,40 1690
+2409.9,24 1691
+2410.37,48 1692
+2412.7,22 1693
+2413.4,13 1694
+2414.23,33 1695
+35,36 1695
+38,49 1695
+4,15 1695
+4,50 1695
+2415.4,15 1696
+4,41 1696
+4,41 1697
+2418.10,21 1698
+4,28 1698
+4,28 1699
+4,28 1700
+2409.26,48 1701
+26,48 1701
+2420.2,16 1702
+2422.6,11 1703
+2423.3,30 1704
+16,20 1704
+22,26 1704
+28,29 1704
+3,30 1704
+3,30 1705
+2425.3,27 1706
+13,17 1706
+19,23 1706
+25,26 1706
+3,27 1706
+3,27 1707
+3,27 1708
+2405.29,32 1709
+29,32 1709
+2428.8,23 1710
+2429.36,47 1711
+2431.2,25 1712
+2,6 1712
+14,24 1712
+2,25 1712
+2,25 1712
+2,25 1713
+2432.2,30 1714
+2,6 1714
+14,29 1714
+2,30 1714
+2,30 1714
+2,30 1715
+2,30 1716
+2428.25,47 1717
+25,47 1717
+2434.0,1 1718
+2440.3,2443.29 1719
+2440.7,11 1719
+2441.4,9 1719
+2442.4,15 1719
+4,29 1719
+2443.8,19 1719
+4,28 1719
+2440.3,2443.29 1719
+2440.3,2443.29 1719
+2439.1,2443.30 1719
+2439.1,5 1719
+12,23 1719
+12,32 1719
+12,32 1719
+12,32 1720
+12,32 1721
+12,32 1722
+12,32 1723
+1,2443.30 1719
+2439.1,2443.30 1719
+2439.1,2443.30 1724
+2445.7,20 1725
+15,19 1725
+7,20 1725
+7,20 1725
+3,2448.28 1725
+2445.3,2448.28 1725
+2445.3,2448.28 1726
+2446.4,9 1725
+2447.4,9 1725
+2448.4,15 1725
+4,27 1725
+2445.3,2448.28 1725
+2445.3,2448.28 1725
+2444.1,2448.29 1725
+2444.1,5 1725
+16,27 1725
+12,39 1725
+12,39 1725
+12,39 1727
+12,39 1728
+12,39 1729
+12,39 1730
+1,2448.29 1725
+2444.1,2448.29 1725
+2444.1,2448.29 1731
+2449.0,1 1732
+2454.1,19 1733
+2455.20,34 1734
+36,37 1734
+39,50 1734
+1,12 1734
+1,51 1734
+2456.1,21 1735
+2458.4,2461.15 1736
+2458.8,12 1736
+2459.4,9 1736
+2460.4,15 1736
+4,29 1736
+2461.4,14 1736
+2458.4,2461.15 1736
+2458.4,2461.15 1736
+2457.1,2461.16 1736
+2457.1,5 1736
+13,26 1736
+13,26 1736
+13,26 1737
+13,26 1738
+13,26 1739
+13,26 1740
+1,2461.16 1736
+2457.1,2461.16 1736
+2457.1,2461.16 1741
+2463.1,19 1742
+2464.1,12 1743
+1,37 1743
+2466.7,20 1744
+15,19 1744
+7,20 1744
+7,20 1744
+3,2469.14 1744
+2466.3,2469.14 1744
+2466.3,2469.14 1745
+2467.3,8 1744
+2468.3,8 1744
+2469.3,13 1744
+2466.3,2469.14 1744
+2466.3,2469.14 1744
+2465.1,2469.15 1744
+2465.1,5 1744
+13,26 1744
+13,26 1744
+13,26 1746
+13,26 1747
+13,26 1748
+13,26 1749
+1,2469.15 1744
+2465.1,2469.15 1744
+2465.1,2469.15 1750
+2470.0,1 1751
+2474.15,31 1752
+25,26 1752
+27,30 1752
+15,31 1752
+15,31 1752
+1,31 1752
+2476.2,20 1753
+13,19 1753
+2,20 1753
+2,20 1753
+2477.2,23 1754
+2,23 1754
+2,23 1754
+2478.8,56 1755
+20,46 1755
+47,55 1755
+8,56 1755
+8,56 1755
+2,59 1755
+2,59 1755
+2,59 1756
+57,58 1755
+2,59 1755
+2479.6,16 1757
+2480.3,19 1758
+2481.6,16 1759
+6,23 1759
+2482.3,18 1760
+3,18 1760
+2488.1,13 1761
+2489.1,14 1762
+2490.1,13 1763
+2491.1,9 1764
+2493.8,72 1765
+21,61 1765
+62,71 1765
+62,71 1765
+8,72 1765
+8,72 1765
+2,75 1765
+2,75 1765
+2,75 1766
+73,74 1765
+2,75 1765
+2494.2,17 1767
+13,16 1767
+2,17 1767
+2,17 1767
+2495.25,47 1768
+36,46 1768
+25,47 1768
+25,47 1768
+3,7 1768
+9,16 1768
+9,16 1769
+9,16 1770
+9,16 1771
+2496.6,17 1772
+21,35 1772
+2497.9,52 1773
+21,51 1773
+9,52 1773
+9,52 1773
+3,55 1773
+3,55 1773
+3,55 1774
+53,54 1773
+3,55 1773
+3,55 1775
+2498.11,20 1776
+11,20 1776
+11,20 1776
+11,25 1776
+2499.3,26 1777
+3,26 1777
+2500.3,16 1778
+2501.3,28 1779
+9,25 1779
+26,27 1779
+3,28 1779
+2502.3,8 1780
+2504.6,13 1781
+17,29 1781
+2505.3,8 1782
+2506.6,11 1783
+6,11 1783
+6,16 1783
+2507.3,14 1784
+2508.3,10 1785
+2509.7,21 1786
+2510.4,18 1787
+2512.2,19 1788
+13,18 1788
+2,19 1788
+2,19 1788
+2,19 1788
+2514.1,10 1789
+2515.8,17 1790
+1,17 1790
+2524.5,13 1791
+19,24 1791
+19,28 1791
+17,29 1791
+17,37 1791
+2525.9,14 1792
+9,18 1792
+2,19 1792
+2526.5,19 1793
+2527.14,28 1794
+26,27 1794
+14,28 1794
+14,28 1794
+2,52 1794
+2,52 1794
+2,52 1795
+30,41 1794
+42,43 1794
+44,51 1794
+2,52 1794
+2,52 1794
+2528.0,1 1796
+2532.1,14 1797
+2533.1,27 1798
+2534.1,47 1799
+17,34 1799
+17,34 1799
+36,46 1799
+1,47 1799
+1,47 1799
+2535.5,14 1800
+2536.10,13 1801
+14,17 1801
+2,18 1801
+2537.13,27 1802
+24,26 1802
+13,27 1802
+13,27 1802
+2538.5,25 1803
+2539.10,13 1804
+14,17 1804
+2,18 1804
+2540.1,38 1805
+11,13 1805
+15,21 1805
+23,37 1805
+1,38 1805
+1,38 1805
+2541.1,27 1806
+15,17 1806
+18,21 1806
+22,26 1806
+1,27 1806
+1,27 1806
+2542.9,16 1807
+9,16 1807
+9,16 1807
+9,16 1808
+18,21 1807
+18,25 1807
+1,26 1807
+29
+aSys->Dir 1:26.1,39.2 64
+11
+0:name:28.2,6 s
+4:uid:29.2,5 s
+8:gid:30.2,5 s
+12:muid:31.2,6 s
+16:qid:32.2,5 @1
+
+32:mode:33.2,6 i
+36:atime:34.2,7 i
+40:mtime:35.2,7 i
+48:length:36.2,8 B
+56:dtype:37.2,7 i
+60:dev:38.2,5 i
+aSys->Qid 11.1,16.2 16
+3
+0:path:13.2,6 B
+8:vers:14.2,6 i
+12:qtype:15.2,7 i
+aDraw->Chans 6:70.1,82.2 4
+1
+0:desc:72.2,6 i
+aDraw->Context 274.1,279.2 12
+3
+0:display:276.2,9 R@4
+
+4:screen:277.2,8 R@8
+
+8:wm:278.2,4 Ct8.2
+0:t0:15,21 s
+4:t1:15,21 Ct8.2
+0:t0:32,38 s
+4:t1:32,38 R@9
+
+
+
+aDraw->Display 201.1,230.2 20
+5
+0:image:203.2,7 R@5
+
+4:white:204.2,7 R@5
+
+8:black:205.2,7 R@5
+
+12:opaque:206.2,8 R@5
+
+16:transparent:207.2,13 R@5
+
+aDraw->Image 142.1,198.2 56
+8
+0:r:146.2,3 @6
+
+16:clipr:147.2,7 @6
+
+32:depth:148.2,7 i
+36:chans:149.2,7 @2
+
+40:repl:150.2,6 i
+44:display:151.2,9 R@4
+
+48:screen:152.2,8 R@8
+
+52:iname:153.2,7 s
+aDraw->Rect 116.1,139.2 16
+2
+0:min:118.2,5 @7
+
+8:max:119.2,5 @7
+
+aDraw->Point 99.1,113.2 8
+2
+0:x:101.2,3 i
+4:y:102.2,3 i
+aDraw->Screen 249.1,263.2 16
+4
+0:id:251.2,4 i
+4:image:252.2,7 R@5
+
+8:fill:253.2,6 R@5
+
+12:display:254.2,9 R@4
+
+aDraw->Wmcontext 282.1,291.2 28
+7
+0:kbd:284.2,5 Ci
+4:ptr:285.2,5 CR@10
+
+8:ctl:286.2,5 Cs
+12:wctl:287.2,6 Cs
+16:images:288.2,8 CR@5
+
+20:connfd:289.2,8 R@11
+
+24:ctxt:290.2,6 R@3
+
+aDraw->Pointer 266.1,271.2 16
+3
+0:buttons:268.2,9 i
+4:xy:269.2,4 @7
+
+12:msec:270.2,6 i
+aSys->FD 1:45.1,48.2 4
+1
+0:fd:47.2,4 i
+aTmsgqueue 0:891.0,897.1 16
+4
+0:start:892.1,6 i
+4:end:8,11 i
+8:length:13,19 i
+12:a:893.1,2 AR@13
+
+pStyx->Tmsg 3:75.1,123.2 0
+1
+4:tag:76.2,5 i
+14
+Readerror:78.2,11 12
+1
+8:error:79.3,8 s
+Version:80.2,9 16
+2
+8:msize:81.3,8 i
+12:version:82.3,10 s
+Auth:83.2,6 20
+3
+8:afid:84.3,7 i
+12:uname:85.3,8 s
+16:aname:10,15 s
+Attach:86.2,8 24
+4
+8:fid:87.3,6 i
+12:afid:8,12 i
+16:uname:88.3,8 s
+20:aname:10,15 s
+Flush:89.2,7 12
+1
+8:oldtag:90.3,9 i
+Walk:91.2,6 20
+3
+8:fid:92.3,6 i
+12:newfid:8,14 i
+16:names:93.3,8 As
+Open:94.2,6 16
+2
+8:fid:95.3,6 i
+12:mode:8,12 i
+Create:96.2,8 24
+4
+8:fid:97.3,6 i
+12:name:98.3,7 s
+16:perm:99.3,7 i
+20:mode:9,13 i
+Read:100.2,6 32
+3
+8:fid:101.3,6 i
+16:offset:102.3,9 B
+24:count:103.3,8 i
+Write:104.2,7 32
+3
+8:fid:105.3,6 i
+16:offset:106.3,9 B
+24:data:107.3,7 Ab
+Clunk:108.2,7 12
+1
+8:fid:111.3,6 i
+Stat:109.2,6
+Remove:110.2,8
+Wstat:112.2,7 80
+2
+8:fid:113.3,6 i
+16:stat:114.3,7 @0
+
+aStyxservers->Styxserver 4:44.1,82.2 32
+7
+0:fd:45.2,4 R@11
+
+4:fids:46.2,6 ALR@15
+
+8:fidlock:47.2,9 Ci
+12:t:48.2,3 R@16
+
+16:rootpath:49.2,10 B
+24:msize:50.2,7 i
+28:replychan:51.2,11 CR@18
+
+aStyxservers->Fid 5.1,19.2 48
+9
+0:fid:6.2,5 i
+8:path:7.2,6 B
+16:qtype:8.2,7 i
+20:isopen:9.2,8 i
+24:mode:10.2,6 i
+28:doffset:11.2,9 t8.2
+0:t0:12,15 i
+4:t1:12,15 i
+
+36:uname:12.2,7 s
+40:param:13.2,7 s
+44:data:14.2,6 Ab
+aStyxservers->Navigator 21.1,29.2 8
+2
+0:c:22.2,3 CR@17
+
+4:reply:23.2,7 Ct8.2
+0:t0:18,30 R@0
+
+4:t1:18,30 s
+
+pStyxservers->Navop 31.1,42.2 0
+2
+4:reply:32.2,7 Ct8.2
+0:t0:18,30 R@0
+
+4:t1:18,30 s
+
+8:path:33.2,6 B
+3
+Stat:35.2,6 16
+0
+Walk:36.2,6 24
+1
+16:name:37.3,7 s
+Readdir:38.2,9 24
+2
+16:offset:39.3,9 i
+20:count:40.3,8 i
+pStyx->Rmsg 3:125.1,163.2 0
+1
+4:tag:126.2,5 i
+15
+Readerror:128.2,11 12
+1
+8:error:129.3,8 s
+Version:130.2,9 16
+2
+8:msize:131.3,8 i
+12:version:132.3,10 s
+Auth:133.2,6 24
+1
+8:aqid:134.3,7 @1
+
+Attach:135.2,8 24
+1
+8:qid:136.3,6 @1
+
+Flush:137.2,7 8
+0
+Error:138.2,7 12
+1
+8:ename:139.3,8 s
+Clunk:140.2,7 8
+0
+Remove:141.2,8
+Wstat:142.2,7
+Walk:143.2,6 12
+1
+8:qids:144.3,7 A@1
+
+Create:145.2,8 32
+2
+8:qid:147.3,6 @1
+
+24:iounit:148.3,9 i
+Open:146.2,6
+Read:149.2,6 12
+1
+8:data:150.3,7 Ab
+Write:151.2,7 12
+1
+8:count:152.3,8 i
+Stat:153.2,6 72
+1
+8:stat:154.3,7 @0
+
+aNametree->Tree 4:112.1,121.2 8
+2
+0:c:113.2,3 CR@20
+
+4:reply:114.2,7 Cs
+pNametree->Treeop 122.1,132.2 0
+2
+4:reply:123.2,7 Cs
+8:q:124.2,3 B
+4
+Create:126.2,8 80
+1
+16:d:128.3,4 @0
+
+Wstat:127.2,7
+Remove:129.2,8 16
+0
+Getpath:130.2,9 16
+0
+aCfile 0:159.0,167.1 28
+7
+0:driveno:160.1,8 i
+4:pathname:161.1,9 Ab
+8:dosname:162.1,8 Ab
+12:filelength:163.1,11 i
+16:filestatus:164.1,11 i
+20:thumblength:165.1,12 i
+24:thumbqid:166.1,9 i
+aCamera_adt 132.0,144.1 48
+12
+0:port_type:133.1,10 i
+4:port_num:134.1,9 i
+8:command:135.1,8 i
+12:mode:136.1,5 i
+16:fd:137.1,3 R@11
+
+20:ctlfd:138.1,6 R@11
+
+24:cdp:139.1,4 Ab
+28:bufbytes:140.1,9 i
+32:baud:141.1,5 i
+36:dfs:142.1,4 i
+40:hfs:6,9 i
+44:stat:143.1,5 i
+aPartialtag 155.0,157.1 12
+3
+0:offset:156.1,7 i
+4:length:9,15 i
+8:filesize:17,25 i
+aFitem 169.0,172.1 48
+2
+0:qid:170.1,4 @1
+
+16:cf:171.1,3 @21
+
+aextra 1206.0,1212.1 20
+5
+0:pnum:1207.1,5 i
+4:offset:1208.1,7 i
+8:length:1209.1,7 i
+12:data:1210.1,5 Ab
+16:isthumb:1211.1,8 i
+aUser 514.0,517.1 8
+2
+0:attachfid:515.1,10 i
+4:attr:516.1,5 At8.2
+0:t0:17,23 s
+4:t1:17,23 i
+
+aDaytime->Tm 2:5.1,16.2 40
+10
+0:sec:6.2,5 i
+4:min:7.2,5 i
+8:hour:8.2,6 i
+12:mday:9.2,6 i
+16:mon:10.2,5 i
+20:year:11.2,6 i
+24:wday:12.2,6 i
+28:yday:13.2,6 i
+32:zone:14.2,6 s
+36:tzoff:15.2,7 i
+pCapability 0:1550.0,1559.1 0
+2
+4:pname:1551.1,6 s
+8:d:1552.1,2 s
+2
+List:1554.2,6 16
+1
+12:t:1555.3,4 Lt8.2
+0:t0:15,21 s
+4:t1:15,21 i
+
+Range:1556.2,7 28
+4
+12:min:1557.3,6 i
+16:max:8,11 i
+20:default:13,20 i
+24:current:22,29 i
+91
+0:init
+1
+36:argv:189.30,34 Ls
+6
+40:arg:204.1,4 mArg
+7:1.0,14.1 0
+
+44:extrafilelist:0:232.1,14 Ls
+48:i:258.6,7 i
+52:sync:292.1,5 Ci
+56:opt:235.9,12 i
+72:err:191.1,4 s
+n227:set_camera_properties
+0
+1
+32:i:299.6,7 i
+n241:tonext
+1
+32:los:325.7,10 Ls
+1
+36:s:327.1,2 s
+s259:int2hex
+1
+32:i:337.8,9 i
+3
+36:k:341.6,7 i
+40:i2:339.1,3 i
+44:s:340.1,2 s
+i275:connect
+0
+6
+32:pchan:350.1,6 Ci
+36:datain:349.1,7 CAb
+40:tick:351.1,5 Ci
+44:buf:362.3,6 Ab
+48:pid:358.1,4 i
+52:tpid:355.1,5 i
+i354:contains
+2
+32:s:400.9,10 s
+36:test:20,24 s
+2
+40:i:404.6,7 i
+44:num:402.1,4 i
+i377:filterabls
+2
+32:pname:431.11,16 s
+36:desc:18,22 s
+1
+40:i:433.6,7 i
+i394:exporterror
+2
+32:dfd:458.12,15 R@11
+
+36:error:30,35 s
+4
+40:tmsg:460.1,5 R@13
+
+44:data:470.2,6 Ab
+48:reply:469.2,7 R@18
+
+52:t:465.6,7 R@13
+
+n443:exportpath
+2
+32:sync:475.11,15 Ci
+36:dfd:30,33 R@11
+
+0
+n451:getuid
+0
+3
+32:buf:490.1,4 Ab
+36:fd:491.1,3 R@11
+
+40:uidlen:492.1,7 i
+n468:dir
+4
+32:name:496.4,8 s
+36:perm:18,22 i
+40:length:29,35 i
+44:qid:42,45 i
+1
+56:d:498.1,2 @0
+
+@0
+498:getuser
+1
+32:fid:521.8,11 i
+1
+36:i:523.6,7 i
+i509:getattr
+1
+32:pname:529.8,13 s
+1
+36:i:531.6,7 i
+i520:serveloop
+2
+32:fd:537.10,12 R@11
+
+36:sync:28,32 Ci
+45
+40:m:635.12,13 R@13
+
+44:srv:540.1,4 R@14
+
+48:tree:547.2,6 R@19
+
+52:treeop:8,14 CR@17
+
+56:data:707.3,7 Ab
+60:gm:576.1,3 R@13
+
+64:err:796.4,7 s
+68:readfid:588.1,8 i
+72:f:699.4,5 R@15
+
+76:e:6,7 s
+80:i:812.10,11 i
+84:retryit:586.1,8 i
+88:f:665.3,4 R@15
+
+92:f:781.4,5 R@15
+
+96:e:6,7 s
+100:i:648.8,9 i
+104:alivechan:583.1,10 Ci
+108:dir:710.5,8 R@0
+
+112:intdata:10,17 Ab
+116:e1:821.5,7 i
+120:j:557.6,7 i
+124:myattr:647.3,9 At8.2
+0:t0:40,46 s
+4:t1:40,46 i
+
+128:notries:587.1,8 i
+132:tchan:539.1,6 CR@13
+
+136:tmsgqueue:571.1,10 R@12
+
+140:killchan:611.7,15 Ci
+144:killchan:877.4,12 Ci
+148:alivepid:585.1,9 i
+152:e1:842.7,9 s
+156:lastgm:576.5,11 R@13
+
+160:n:558.3,4 i
+168:idir:6,10 @0
+
+232:n:787.4,5 i
+236:s:7,8 Ls
+260:c:605.4,5 i
+264:echan:541.1,6 Cs
+268:s:607.6,7 s
+100:i:677.9,10 i
+260:nu:640.3,5 i
+100:nu:810.5,7 i
+260:nu:653.3,5 i
+260:wtype:786.3,8 i
+100:na:838.6,8 i
+260:ftype:671.3,8 i
+260:ok:874.3,5 i
+n1599:Tmsgqueue.new
+1
+32:n:899.14,15 i
+1
+40:t:901.1,2 @12
+
+R@12
+1608:Tmsgqueue.push
+2
+32:t:909.15,16 R@12
+
+36:newt:37,41 R@13
+
+0
+i1623:Tmsgqueue.pop
+2
+32:t:921.14,15 R@12
+
+36:readfid:37,44 i
+1
+40:m:925.1,2 R@13
+
+R@13
+1640:noresponse
+3
+32:tchan:935.11,16 CR@13
+
+36:srv:36,39 R@14
+
+40:killchan:70,78 Ci
+2
+44:gm:940.2,4 R@13
+
+60:k:938.2,3 i
+n1669:photoread2
+4
+32:qid:947.11,14 B
+40:m:21,22 R@13
+
+44:tree:39,43 R@19
+
+48:isthumb:65,72 i
+14
+52:data:950.1,5 Ab
+56:photonum:949.1,9 i
+60:filelen:969.1,8 i
+64:offset:967.1,7 i
+68:i:952.6,7 i
+72:dosname:968.1,8 Ab
+76:fd:1020.2,4 R@11
+
+80:fd:994.2,4 R@11
+
+84:cname:1021.2,7 s
+88:filesize:990.2,10 i
+92:k:970.6,7 i
+96:n:989.2,3 i
+104:n:1034.3,4 i
+112:dir:6,9 @0
+
+Ab1925:cacheclean
+0
+6
+32:i:1061.7,8 i
+36:tmp:1057.1,4 Lt12.3
+0:t0:16,22 s
+4:t1:16,22 i
+8:t2:16,22 i
+
+40:dosnm:1060.3,8 s
+44:it:9,11 i
+48:fl:12,14 i
+52:filelen:1062.3,10 i
+n1954:cacheadd
+3
+32:dosname1:1074.9,17 Ab
+36:isthumb:34,41 i
+40:filelen:43,50 i
+6
+44:tmp:1077.1,4 Lt12.3
+0:t0:16,22 s
+4:t1:16,22 i
+8:t2:16,22 i
+
+48:dosnm:1081.3,8 s
+52:it:9,11 i
+56:fl:12,14 i
+60:dosname:1076.1,8 s
+64:updated:1079.1,8 i
+n1985:cachedel
+2
+32:dosname1:1096.9,17 Ab
+36:isthumb:34,41 i
+5
+40:tmp:1099.1,4 Lt12.3
+0:t0:16,22 s
+4:t1:16,22 i
+8:t2:16,22 i
+
+44:dosnm:1102.3,8 s
+48:it:9,11 i
+52:filelen:12,19 i
+56:dosname:1098.1,8 s
+n2002:cachesize
+2
+32:dosname1:1110.10,18 Ab
+36:isthumb:35,42 i
+5
+40:tmp:1113.1,4 Lt12.3
+0:t0:1042.21,27 s
+4:t1:21,27 i
+8:t2:21,27 i
+
+44:dosname:1112.1,8 s
+48:dosnm:1115.3,8 s
+52:it:9,11 i
+56:filelen:12,19 i
+i2018:cachename
+2
+32:dosname:1122.10,17 Ab
+36:isthumb:34,41 i
+1
+40:name:1124.1,5 s
+s2039:poll_and_wait
+0
+0
+i2065:send_packet
+0
+2
+32:to_write:1145.1,9 i
+36:wrote_here:1156.1,11 i
+i2092:send_message
+0
+6
+32:rc:1165.1,3 Ci
+36:tc:1166.1,3 Ci
+40:v:1164.1,2 i
+44:rpid:1171.1,5 i
+48:tpid:1169.1,5 i
+60:try:1173.1,4 i
+i2128:write_message
+1
+32:rc:1187.14,16 Ci
+1
+36:wrote_here:1197.1,11 i
+n2163:getthumb
+3
+32:photonum:1216.9,17 i
+36:offset:19,25 i
+40:maxlength:27,36 i
+10
+44:off:1236.2,5 i
+48:filesize:1223.1,9 i
+52:l:1232.2,3 i
+56:h:1221.6,7 i
+60:thumbdata:1220.1,10 Ab
+64:w:1221.9,10 i
+68:err:1,4 i
+72:ttype:12,17 i
+88:tmpoffset:1255.2,11 i
+100:file:1222.1,5 @21
+
+Ab2419:getpicture2
+3
+32:photonum:1279.12,20 i
+36:offset:22,28 i
+40:maxlength:30,39 i
+6
+44:off:1291.1,4 i
+48:filesize:1282.1,9 i
+52:l:1288.1,2 i
+56:filedata:1313.1,9 Ab
+60:err:1303.6,9 i
+76:file:1281.1,5 @21
+
+Ab2597:erase_file
+1
+32:file:1318.11,15 @21
+
+1
+60:off:1323.1,4 i
+i2639:get_storage_status
+0
+5
+32:off:1351.1,4 i
+36:s:1344.1,2 s
+40:raw:1352.19,22 i
+44:available:8,17 i
+48:taken:1,6 i
+s2703:get_power_mode
+0
+2
+32:off:1374.1,4 i
+36:mode:1367.1,5 i
+s2734:set_clock_data
+1
+32:s:1379.15,16 s
+10
+36:tm:1383.2,4 R@27
+
+40:i:1398.7,8 i
+44:i2:1402.8,10 i
+48:n:1395.3,4 i
+52:datetime:5,13 Ls
+56:n2:1399.4,6 i
+60:data:7,11 Ls
+80:err:1381.1,4 i
+84:off:1384.2,5 i
+84:off:1397.2,5 i
+i2830:set_clock
+1
+32:s:1413.10,11 s
+0
+i2854:addzeros
+1
+32:s:1423.9,10 s
+4
+36:i:1429.6,7 i
+40:rs:1426.1,3 s
+44:isnum:1428.1,6 i
+48:start:1427.1,6 i
+s2893:get_clock
+0
+1
+32:s:1450.1,2 s
+s2932:get_file_list
+0
+0
+i2961:setfiledata
+0
+1
+32:off:1471.1,4 i
+n2995:get_file_size
+1
+32:i:1478.14,15 i
+0
+i3019:setfiledata2
+1
+32:i:1489.13,14 i
+1
+36:off:1491.1,4 i
+n3055:set_interface_timeout
+0
+1
+32:off:1503.1,4 i
+n3089:display_filelist
+0
+3
+32:off:1513.1,4 i
+36:i:6,7 i
+40:s:1517.1,2 s
+s3192:get_camera_capabilities
+0
+0
+s3219:capabilities
+0
+18
+32:off:1581.1,4 i
+36:line:1595.2,6 s
+40:l:1582.1,2 i
+44:s:1584.1,2 Ab
+48:n:1582.7,8 i
+52:pname:1583.1,6 Ab
+56:fact:1601.2,6 s
+60:m:1582.4,5 i
+64:desc:1583.8,12 Ab
+68:firsttime:1591.1,10 i
+72:i:1581.6,7 i
+76:rs:1585.1,3 s
+80:j:1594.6,7 i
+84:k:1610.9,10 i
+88:ncaps:1581.9,14 i
+92:t:16,17 i
+96:t:1604.4,5 Lt8.2
+0:t0:16,22 s
+4:t1:16,22 i
+
+116:cl:1618.4,6 R@28
+
+s3528:isin
+2
+32:los:1665.5,8 Ls
+36:s:26,27 s
+0
+i3538:set_capture_data
+0
+0
+i3548:get_camera_state
+2
+32:pname:1682.17,22 s
+36:offset:31,37 i
+9
+40:off:1687.1,4 i
+44:data:1714.8,12 Ab
+48:s:1704.1,2 s
+52:q:1707.7,8 i
+56:rlen:1702.1,5 i
+60:type1:1715.2,7 i
+64:name:1714.2,6 Ab
+68:tmp:1715.9,12 i
+52:i:1713.6,7 i
+s3747:set_camera_state
+2
+32:pname:1742.17,22 s
+36:val:32,35 i
+3
+40:off:1747.1,4 i
+44:na:1760.2,4 i
+48:e:1759.6,7 i
+s3813:capture
+0
+1
+32:d:1778.1,2 i
+i3844:dump_message
+0
+0
+n3911:build_cdp_header
+2
+32:cdp:1795.17,20 Ab
+36:x:37,38 i
+1
+40:l:1806.1,2 i
+i3948:poll_and_reply
+1
+32:nak:1815.15,18 i
+0
+i3985:receive_packet
+1
+32:buf:1831.15,18 Ab
+2
+36:l:1839.1,2 i
+40:r:1841.1,2 i
+i4031:receive_message
+0
+2
+36:message_len:1867.1,12 i
+40:rc:1860.1,3 i
+i4102:reset
+1
+32:fd:1882.6,8 R@11
+
+0
+n4122:kill
+1
+32:pid:1890.5,8 i
+1
+36:pctl:1892.1,5 R@11
+
+n4138:killg
+1
+32:pid:1897.6,9 i
+1
+36:fd:1899.6,8 R@11
+
+n4155:serialport
+1
+32:port:1910.11,15 i
+7
+36:i:1919.6,7 i
+40:ctlfd:1930.1,6 R@11
+
+44:config:1934.1,7 As
+48:fd:1927.1,3 R@11
+
+52:serport:1916.1,8 s
+56:serctl:1917.1,7 s
+60:statfd:1920.2,8 R@11
+
+t12.3
+0:t0:1910.26,37 R@11
+
+4:t1:26,37 R@11
+
+8:t2:26,37 s
+4276:consume
+1
+32:fd:1957.8,10 R@11
+
+0
+n4289:beacon_intro
+3
+32:data:1965.13,17 CAb
+36:pchan:42,47 Ci
+40:fd:62,64 R@11
+
+7
+48:buf:1967.1,4 Ab
+52:k:1986.6,7 i
+56:cbuf:1968.1,5 Ab
+60:failed:1972.1,7 Ab
+64:n:1976.2,3 i
+68:pid:1969.1,4 i
+64:i:1985.1,2 i
+n4387:beacon_result
+3
+32:data:2000.14,18 CAb
+36:pchan:43,48 Ci
+40:fd:63,65 R@11
+
+7
+48:p:2008.1,2 i
+52:buf:2002.1,4 Ab
+56:intro:2009.1,6 i
+60:cbuf:2003.1,5 Ab
+64:pid:2004.1,4 i
+84:i:2011.2,3 i
+84:k:2027.6,7 i
+n4454:beacon_comp
+2
+32:buf:2039.12,15 Ab
+36:C:32,33 @22
+
+1
+84:speed:2041.1,6 s
+i4577:read_n
+4
+32:fd:2083.7,9 R@11
+
+36:buf:24,27 Ab
+40:n:44,45 i
+44:res:52,55 Ci
+3
+48:nread:2089.1,6 i
+52:i:2091.2,3 i
+56:pid:2085.1,4 i
+n4613:read_n_to
+4
+32:fd:2115.10,12 R@11
+
+36:buf:27,30 Ab
+40:n:47,48 i
+44:t:49,50 i
+6
+48:rc:2118.1,3 Ci
+52:tc:2119.1,3 Ci
+56:v:2117.1,2 i
+60:rpid:2124.1,5 i
+64:tpid:2122.1,5 i
+80:try:2126.1,4 i
+i4658:write_n
+3
+32:fd:2140.8,10 R@11
+
+36:buf:25,28 Ab
+40:n:45,46 i
+2
+44:nwrite:2143.1,7 i
+48:i:2145.2,3 i
+i4710:readstat
+0
+3
+32:buf:2164.1,4 Ab
+36:k:2167.3,4 i
+40:statfd:2163.1,7 R@11
+
+n4753:beacon_ack
+1
+32:C:2176.11,12 @22
+
+1
+80:i:2179.1,2 i
+n4809:timer2
+2
+32:tick:2205.7,11 Ci
+36:delay:26,31 i
+1
+40:pid:2207.1,4 i
+n4821:beacon_ok
+1
+32:buf:2213.10,13 Ab
+1
+40:i:2216.6,7 i
+i4852:check_sum
+2
+32:buf:2226.10,13 Ab
+36:l:30,31 i
+2
+40:i:2229.7,8 i
+44:sum:2228.1,4 i
+b4863:set_int
+3
+32:b:2235.8,9 Ab
+36:i:26,27 i
+40:off:29,32 i
+0
+i4880:set_fstring
+3
+32:b:2245.12,13 Ab
+36:s:30,31 Ab
+40:off:48,51 i
+1
+44:i:2247.6,7 i
+i4896:set_dosname
+3
+32:b:2254.12,13 Ab
+36:s:30,31 Ab
+40:off:48,51 i
+1
+44:i:2256.6,7 i
+i4912:get_int2
+1
+32:b:2277.9,10 Ab
+1
+36:i:2279.1,2 i
+i4928:get_string
+3
+32:b:2294.11,12 Ab
+36:off:29,32 i
+40:l:39,40 i
+1
+44:s:2296.1,2 Ab
+t8.2
+0:t0:2294.49,62 Ab
+4:t1:49,62 i
+4936:sconv
+1
+32:b:2306.6,7 Ab
+2
+36:i:2309.1,2 i
+40:s:2308.1,2 s
+s4948:getqid
+2
+32:i:2320.7,8 i
+36:ftype:10,15 i
+1
+40:qid:2322.1,4 i
+i4952:gettype
+1
+32:qid:2326.8,11 i
+1
+36:ftype:2328.1,6 i
+i4955:convert_thumb
+3
+32:w:2341.14,15 i
+36:h:16,17 i
+40:data:24,28 Ab
+11
+44:bb:2354.2,4 b
+45:gb:2353.2,4 b
+46:rb:2352.2,4 b
+48:index:2344.1,6 i
+52:rgb:2343.1,4 Ab
+56:rgbi:2345.1,5 i
+60:i:2346.6,7 i
+64:loop:2356.7,11 i
+88:y:2349.2,3 f
+96:cb:2348.2,4 f
+104:cr:2350.2,4 f
+Ab5017:conv
+1
+32:a:2366.5,6 f
+1
+40:r:2368.1,2 i
+b5024:thumb2bit
+3
+32:buf:2374.10,13 Ab
+36:w:30,31 i
+40:h:32,33 i
+2
+44:bitarray:2378.1,9 Ab
+48:convbuf:2376.1,8 Ab
+Ab5048:jpg2bit
+1
+32:s:2385.8,9 s
+0
+s5068:getoldfiledata
+0
+1
+32:i:2397.5,6 i
+n5090:updatetree
+1
+32:tree:2403.11,15 R@19
+
+10
+36:i:2405.6,7 i
+40:name:2406.2,6 s
+44:tmp:2408.2,5 Lt12.3
+0:t0:17,23 s
+4:t1:17,23 i
+8:t2:17,23 i
+
+48:found:2407.2,7 i
+52:oldname:2410.4,11 s
+56:oldqid:13,19 i
+60:oldthumbqid:21,32 i
+80:oldname:2429.3,10 s
+84:oldqid:12,18 i
+88:oldthumbqid:20,31 i
+n5157:updateintree
+3
+32:tree:2436.13,17 R@19
+
+36:name:39,43 s
+40:i:53,54 i
+0
+n5204:addtotree
+3
+32:tree:2451.10,14 R@19
+
+36:name:36,40 s
+40:i:50,51 i
+1
+44:parentqid:2456.1,10 i
+n5257:keepalive
+1
+32:alivechan:2472.10,19 Ci
+1
+36:now:2477.2,5 i
+n5286:reconnect
+1
+32:n:2486.10,11 i
+3
+36:delay:2490.1,6 i
+40:attempt:2488.1,8 i
+44:to5:2491.1,4 i
+i5356:print
+2
+32:s:2522.6,7 s
+36:v:17,18 i
+0
+n5378:readinterface
+3
+32:qid:2530.14,17 i
+40:offset:25,31 B
+48:size:38,42 i
+5
+52:fd:2534.1,3 R@11
+
+56:i:2532.1,2 i
+60:buf:2533.1,4 Ab
+80:n:2537.2,3 i
+88:dir:5,8 @0
+
+t8.2
+0:t0:2530.51,63 R@0
+
+4:t1:51,63 Ab
+47
+868:C:174.0,1 @22
+
+1112:Qabl:73.38,42 i
+1116:Qctl:32,36 i
+1120:Qinterface:74.41,51 i
+1124:Qjpgdir:15,22 i
+1128:Qpwr:24,28 i
+1132:Qstate:0,6 i
+1136:Qstore:73.44,50 i
+1140:Qthumbdir:74.30,39 i
+1144:Qtime:8,13 i
+1188:abilitiesfilter:410.0,15 As
+1220:bak:103.0,3 Ab
+1228:bintro:93.0,6 Ab
+1236:cachelist:1042.0,9 Lt12.3
+0:t0:21,27 s
+4:t1:21,27 i
+8:t2:21,27 i
+
+1268:caplist:1561.0,7 LR@28
+
+1276:connected:181.0,9 i
+1288:currentattr:429.13,24 At8.2
+0:t0:36,42 s
+4:t1:36,42 i
+
+1312:daytime:6.1,8 mDaytime
+2:1.0,53.1 0
+
+1316:defattr:0:428.0,7 Lt8.2
+0:t0:19,25 s
+4:t1:19,25 i
+
+1320:defaultattr:429.0,11 At8.2
+0:t0:36,42 s
+4:t1:36,42 i
+
+1324:dirqid:73.24,30 i
+1344:error_table:76.0,11 As
+1348:ex:1214.0,2 @25
+
+1368:exitfid:486.0,7 i
+1388:filelist:176.0,8 A@24
+
+1432:gpid:187.0,4 i
+1444:ignoreabls:426.0,10 Ls
+1452:interfacepaths:185.0,14 As
+1484:nametree:14.1,9 mNametree
+4:110.0,135.1 0
+
+1488:nextjpgqid:0:73.0,10 i
+1492:nexttmbqid:12,22 i
+1504:oldfiles:2392.0,8 Lt12.3
+0:t0:20,26 s
+4:t1:20,26 i
+8:t2:20,26 i
+
+1512:pak:124.0,3 Ab
+1532:pwl:119.0,3 Ab
+1576:recon:182.0,5 i
+1592:reslength:177.0,9 i
+1616:set_camera_props:303.0,16 At8.2
+0:t0:304.2,8 s
+4:t1:10,11 i
+
+1628:statopt:146.0,7 As
+1636:str:17.1,4 mString
+5:1.0,39.1 0
+
+1640:styx:0:8.1,5 mStyx
+3:1.0,182.1 0
+
+1644:styxservers:0:11.1,12 mStyxservers
+4:1.0,108.1 0
+
+1648:sys:0:4.1,4 mSys
+1:0,160.1 0
+
+1656:uid:0:484.0,3 s
+1660:usecache:180.0,8 i
+1664:users:519.0,5 A@26
+
+1668:verbosity:183.0,9 i
+1672:wait:179.0,4 i
diff --git a/appl/demo/camera/camload.bit b/appl/demo/camera/camload.bit
new file mode 100644
index 00000000..fdad09af
--- /dev/null
+++ b/appl/demo/camera/camload.bit
Binary files differ
diff --git a/appl/demo/camera/camproc.bit b/appl/demo/camera/camproc.bit
new file mode 100644
index 00000000..ce078ab7
--- /dev/null
+++ b/appl/demo/camera/camproc.bit
Binary files differ
diff --git a/appl/demo/camera/mkfile b/appl/demo/camera/mkfile
new file mode 100644
index 00000000..9b393708
--- /dev/null
+++ b/appl/demo/camera/mkfile
@@ -0,0 +1,42 @@
+<../../../mkconfig
+
+TARG=\
+ camera.dis\
+ camload.bit\
+ camproc.bit\
+ tkinterface.dis\
+
+SHTARG=\
+ runcam.sh\
+
+MODULES=\
+
+SYSMODULES= \
+ arg.m\
+ bufio.m\
+ daytime.m\
+ draw.m\
+ grid/readjpg.m\
+ readdir.m\
+ selectfile.m\
+ string.m\
+ styx.m\
+ styxservers.m\
+ sys.m\
+ tk.m\
+ tkclient.m\
+
+DISBIN=$ROOT/dis/demo/camera
+
+<$ROOT/mkfiles/mkdis
+
+$DISBIN/%.bit: %.bit
+ rm -f $target && cp $stem.bit $target
+
+SHFILES=${SHTARG:%.sh=$DISBIN/%}
+install:V: $SHFILES
+%.install:V: $DISBIN/%
+%.installall:V: $DISBIN/%
+
+$DISBIN/%: %.sh
+ cp $stem.sh $target && chmod a+rx $target
diff --git a/appl/demo/camera/runcam.sh b/appl/demo/camera/runcam.sh
new file mode 100755
index 00000000..51948067
--- /dev/null
+++ b/appl/demo/camera/runcam.sh
@@ -0,0 +1,3 @@
+#!/dis/sh
+
+grid/register -a resource Camera -a name Y2K -a model 'Kodak DC260' -a 'Image resource' 1 {demo/camera/camera.dis -v 2 -p 0 -n Y2K -f /dis/demo/camera/tkinterface.dis -f /dis/demo/camera/readjpg.dis -f /dis/demo/camera/camload.bit -f /dis/demo/camera/camproc.bit}
diff --git a/appl/demo/camera/runcamlocal.sh b/appl/demo/camera/runcamlocal.sh
new file mode 100755
index 00000000..b31d6501
--- /dev/null
+++ b/appl/demo/camera/runcamlocal.sh
@@ -0,0 +1,3 @@
+#!/dis/sh
+
+mount -A {demo/camera/camera.dis -v 2 -p 0} /n/remote
diff --git a/appl/demo/camera/tkinterface.b b/appl/demo/camera/tkinterface.b
new file mode 100644
index 00000000..69be88e9
--- /dev/null
+++ b/appl/demo/camera/tkinterface.b
@@ -0,0 +1,2508 @@
+# Sort out timing with taking photo & getting jpg/thumbnail - make sure it gets the right one when 2photos have been taken & sort out 'cannot communicate with camera' error
+
+implement tkinterface;
+
+include "tk.m";
+ tk: Tk;
+include "tkclient.m";
+ tkclient: Tkclient;
+include "sys.m";
+ sys : Sys;
+include "daytime.m";
+ daytime: Daytime;
+include "readdir.m";
+ readdir: Readdir;
+include "bufio.m";
+ bufio: Bufio;
+ Iobuf: import bufio;
+include "selectfile.m";
+ selectfile: Selectfile;
+
+include "string.m";
+ str : String;
+include "draw.m";
+ draw: Draw;
+ Context, Display, Point, Rect, Image, Screen, Font: import draw;
+include "grid/readjpg.m";
+ readjpg: Readjpg;
+
+display : ref draw->Display;
+context : ref draw->Context;
+camerapath := "";
+savepath := "";
+tmppath := "/tmp/";
+usecache := 1;
+working := 0;
+processing := 0;
+coords: draw->Rect;
+DONE : con 1;
+KILLED : con 2;
+font: ref Draw->Font;
+tkfont := "";
+tkfontb := "";
+tkfontf := "";
+ssize := 3;
+maxsize : Point;
+nilrect := Draw->Rect((0,0),(0,0));
+runwithoutcam := 0;
+toplevels : list of (ref Tk->Toplevel, string, list of int, int) = nil;
+procimg : ref Draw->Image;
+loadimg: ref Draw->Image;
+
+tkinterface : module {
+ init : fn (ctxt : ref Draw->Context, argv : list of string);
+};
+
+init(ctxt : ref Draw->Context, argv : list of string)
+{
+ display = ctxt.display;
+ context = ctxt;
+
+ sys = load Sys Sys->PATH;
+# sys->pctl(Sys->NEWPGRP, nil);
+# sys->pctl(Sys->FORKNS, nil);
+
+ str = load String String->PATH;
+ readdir = load Readdir Readdir->PATH;
+ daytime = load Daytime Daytime->PATH;
+ bufio = load Bufio Bufio->PATH;
+
+ str = load String String->PATH;
+ draw = load Draw Draw->PATH;
+
+ tk = load Tk Tk->PATH;
+ tkclient = load Tkclient Tkclient->PATH;
+ tkclient->init();
+ selectfile = load Selectfile Selectfile->PATH;
+ selectfile->init();
+ readjpg = load Readjpg Readjpg->PATH;
+ readjpg->init(display);
+ font = draw->Font.open(display, "/fonts/charon/plain.small.font");
+ runfrom := hd argv;
+ p := isat2(runfrom,"/");
+ savepath = runfrom[:p+1];
+ argv = tl argv;
+ while (argv != nil) {
+ if (camerapath == "" && (hd argv)[0] == '/') camerapath = hd argv;
+ if (hd argv == "nocache") usecache = 0;
+ argv = tl argv;
+ }
+ if (camerapath == "")
+ camerapath = "./";
+ if (camerapath != "" && camerapath[len camerapath - 1] != '/')
+ camerapath[len camerapath] = '/';
+
+ r := display.image.r;
+# if (r.dx() < 800 || r.dy() < 600) ssize = 2;
+ if (r.dx() < 400 || r.dy() < 300) ssize = 1;
+ maxsize = (r.dx(), r.dy());
+
+ if (ssize == 1) {
+ tkfont = "/fonts/charon/plain.tiny.font";
+ tkfontb = "/fonts/charon/bold.tiny.font";
+ tkfontf = "/fonts/pelm/unicode.8.font";
+ }
+ else if (ssize == 2) {
+ tkfont = "/fonts/charon/plain.small.font";
+ tkfontb = "/fonts/charon/bold.small.font";
+ tkfontf = "/fonts/pelm/unicode.8.font";
+ }
+ else {
+ tkfont = "/fonts/charon/plain.normal.font";
+ tkfontb = "/fonts/charon/bold.normal.font";
+ tkfontf = "/fonts/pelm/unicode.8.font";
+ }
+ if ((sys->stat(tkfont)).t0 == -1)
+ tkfont = "";
+ else tkfont = " -font " + tkfont;
+ if ((sys->stat(tkfontb)).t0 == -1)
+ tkfontb = "";
+ else tkfontb = " -font " + tkfontb;
+ if ((sys->stat(tkfontf)).t0 == -1)
+ tkfontf = "";
+ else tkfontf = " -font " + tkfontf;
+
+ procimg = display.open("camproc.bit");
+ loadimg = display.open("camload.bit");
+
+ spawn tkstuff();
+}
+
+# Tk stuff
+
+thumbscr := array[] of {
+ "frame .f",
+ "frame .fthumb -bg white",
+ "frame .f.finfo",
+ "frame .f.fsnap",
+ "menubutton .f.fsnap.fsettings.mb2 -text {Selected\n(0 files)} -menu .m2 @",
+ "menu .m2 @",
+ ".m2 add command -text {Select All} -command {send butchan selectall 1}",
+ ".m2 add command -text {Select None} -command {send butchan selectall 0}",
+ ".m2 add command -text {Invert Selection} -command {send butchan invert}",
+ ".m2 add command -text {Refresh Files} -command {send butchan refresh}",
+ "menu .m @",
+
+ "frame .f.fsnap.fsettings -borderwidth 1 -relief raised",
+ "menubutton .f.fsnap.fsettings.mb -text {Settings} -menu .m &",
+ "button .f.fsnap.fsettings.b -text {Information} -command {send butchan info} &",
+ "grid .f.fsnap.fsettings.b -row 0 -column 0 -sticky ew",
+ "grid .f.fsnap.fsettings.mb -row 1 -column 0 -sticky ew",
+ "grid .f.fsnap.fsettings.mb2 -row 2 -column 0 -sticky ew",
+
+ "frame .f.fsnap.fstore -borderwidth 1 -relief raised",
+ "label .f.fsnap.fstore.l1 -text { Photos taken: } @",
+ "label .f.fsnap.fstore.l2 -text { Remaining: } @",
+ "label .f.fsnap.fstore.l3 -text { } @",
+ "label .f.fsnap.fstore.l4 -text { } @",
+ "grid .f.fsnap.fstore.l1 -row 0 -column 0 -sticky w",
+ "grid .f.fsnap.fstore.l2 -row 1 -column 0 -sticky w",
+ "grid .f.fsnap.fstore.l3 -row 0 -column 1 -sticky w",
+ "grid .f.fsnap.fstore.l4 -row 1 -column 1 -sticky w",
+
+ "frame .f.fsnap.ftime -borderwidth 1 -relief raised",
+ "label .f.fsnap.ftime.l1 -text {Local: } @",
+ "label .f.fsnap.ftime.l2 -text {Camera: } @",
+ "label .f.fsnap.ftime.l3",
+ "label .f.fsnap.ftime.l4",
+ "checkbutton .f.fsnap.ftime.cb -text {Set camera to local time} -variable time &",
+ "button .f.fsnap.ftime.b -text {refresh} -command {send butchan gettime} &",
+ "grid .f.fsnap.ftime.l1 -row 0 -column 0 -sticky w",
+ "grid .f.fsnap.ftime.l2 -row 1 -column 0 -sticky w",
+ "grid .f.fsnap.ftime.l3 -row 0 -column 1 -sticky w",
+ "grid .f.fsnap.ftime.l4 -row 1 -column 1 -sticky w",
+ "grid .f.fsnap.ftime.cb -row 2 -column 0 -columnspan 2",
+ "grid .f.fsnap.ftime.b -row 3 -column 0 -columnspan 2",
+
+ "button .f.fsnap.b -text {Take Photo} -command {send butchan snap} &",
+ "grid columnconfigure .f.fsnap 2 -minsize 150",
+ "frame .f.fcom",
+ "frame .f.f1 -background #0d0d0d1a",
+ "canvas .f.f1.c1 -yscrollcommand {.f.f1.sb1 set} -height 255 -width 542 -bg white",
+ ".f.f1.c1 create window 0 0 -window .fthumb -anchor nw",
+ "scrollbar .f.f1.sb1 -command {.f.f1.c1 yview}",
+
+# "frame .f.f2",
+# "canvas .f.f2.c1 -width 556 -height 304",
+# ".f.f2.c1 create window 0 0 -window .f.fsnap -anchor nw",
+
+ "grid .f.fsnap -column 0 -row 0",
+ "grid .f.f1 -column 0 -row 1",
+ "grid .f.f1.c1 -column 0 -row 0",
+ "grid .f.f1.sb1 -column 1 -row 0 -sticky ns",
+# "grid .f.f2 -column 0 -row 0",
+# "grid .f.f2.c1 -column 0 -row 0 -sticky ew",
+ "bind .Wm_t <ButtonPress-1> +{focus .}",
+ "bind .Wm_t.title <ButtonPress-1> +{focus .}",
+};
+
+lastpath := "";
+
+Aitem: adt {
+ pname,desc: string;
+ dtype,factory: int;
+ read, location: string;
+ data: list of (string, int);
+};
+LIST: con 0;
+MINMAX: con 1;
+OTHER: con 2;
+
+noabilities := 0;
+abilities : array of Aitem;
+
+getdesc(l : list of string): list of string
+{
+ s := "";
+ while(hd l != "min" && hd l != "items" && tl l != nil) {
+ s += hd l + " ";
+ l = tl l;
+ }
+ while (s[len s - 1] == ' ' || s[len s - 1] == '\n')
+ s = s[:len s -1];
+ l = s :: l;
+ return l;
+}
+
+inflist : list of (string, string);
+ablmenu : array of string;
+
+getabilities()
+{
+ inflist = nil;
+ abilities = array[200] of Aitem;
+ fd := bufio->open(camerapath+"abilities", bufio->OREAD);
+ if (runwithoutcam)
+ fd = bufio->open("/usr/danny/camera/abls", bufio->OREAD);
+ i := 0;
+ for (;;) {
+ take := 0;
+ s := fd.gets('\n');
+ if (s == "") break;
+ (n, lst) := sys->tokenize(s," ,:\t\n");
+ abilities[i].data = nil;
+ abilities[i].read = "";
+ if (lst != nil && len hd lst == 4) {
+ abilities[i].pname = hd lst;
+ lst = getdesc(tl lst);
+ abilities[i].desc = hd lst;
+ if (hd tl lst == "items") {
+ abilities[i].dtype = LIST;
+ abilities[i].factory = int hd tl tl tl tl lst;
+ noitems := int hd tl tl lst;
+ for (k := 0; k < noitems; k++) {
+ s = fd.gets('\n');
+ (n2, lst2) := sys->tokenize(s,",:\t\n");
+ name := hd lst2;
+ val := int hd tl lst2;
+ if (k == 0) {
+ if (abilities[i].pname == "ssiz")
+ abilities[i].factory = val;
+ else if (abilities[i].pname == "scpn")
+ abilities[i].factory = val;
+ }
+ if (val == abilities[i].factory && noitems > 1) name += " *";
+ abilities[i].data = (name, val) :: abilities[i].data;
+ }
+ if (noitems < 2) {
+ inflist = (abilities[i].desc, (hd abilities[i].data).t0) :: inflist;
+ take = 1;
+ }
+ }
+ else if (hd tl lst == "min") {
+ abilities[i].dtype = MINMAX;
+ abilities[i].factory = int hd tl tl tl tl tl tl lst;
+ min := int hd tl tl lst;
+ max := int hd tl tl tl tl lst;
+ mul := 1;
+ while (max > 200000) {
+ min /= 10;
+ max /= 10;
+ mul *= 10;
+ }
+ abilities[i].data = ("min", min) :: abilities[i].data;
+ abilities[i].data = ("max", max) :: abilities[i].data;
+ abilities[i].data = ("mul", mul) :: abilities[i].data;
+ }
+ else {
+ inflist = (abilities[i].desc,list2string(tl lst)) :: inflist;
+ take = 1;
+ }
+ if (take ||
+ abilities[i].desc == "Time Format" ||
+ abilities[i].desc == "Date Format" ||
+ abilities[i].desc == "File Type" ||
+ contains(abilities[i].desc,"Video") ||
+ contains(abilities[i].desc,"Media") ||
+ contains(abilities[i].desc,"Sound") ||
+ contains(abilities[i].desc,"Volume") ||
+ contains(abilities[i].desc,"Slide") ||
+ contains(abilities[i].desc,"Timelapse") ||
+ contains(abilities[i].desc,"Burst") ||
+ contains(abilities[i].desc,"Power") ||
+ contains(abilities[i].desc,"Sleep"))
+ i--;
+ i++;
+ }
+ }
+ noabilities = i;
+}
+
+isat(s: string, test: string): int
+{
+ num := -1;
+ if (len test > len s) return -1;
+ for (i := 0; i < (1 + (len s) - (len test)); i++) {
+ if (num == -1 && test == s[i:i+len test]) num = i;
+ }
+ return num;
+}
+
+isat2(s: string, test: string): int
+{
+ num := -1;
+ if (len test > len s) return -1;
+ for (i := len s - len test; i >= 0; i--) {
+ if (num == -1 && test == s[i:i+len test]) num = i;
+ }
+ return num;
+}
+
+
+nomatches(s: string): int
+{
+ n := 0;
+ for (i := 0; i < noabilities; i++) {
+ test := abilities[i].desc;
+ if (len s <= len test && test[:len s] == s) n++;
+ }
+ return n;
+}
+
+matches(s1,s2: string): int
+{
+ if (len s1 < len s2) return 0;
+ if (s1[:len s2] == s2) return 1;
+ return 0;
+}
+
+biggestmatch(nm: int, s: string, l: int): string
+{
+ bigmatch := s;
+ match := s[:l];
+ for (;;) {
+ if (bigmatch == match) break;
+ if (nomatches(bigmatch) == nm) return bigmatch;
+ p := isat2(bigmatch," ");
+ if (p < len match) break;
+ bigmatch = bigmatch[:p];
+ }
+ return match;
+}
+
+getabllist(): array of string
+{
+ los : list of string;
+ los = nil;
+ for (i := 0; i < noabilities; i++) {
+ p := 0;
+ p2 := 0;
+ nm : int;
+ for (;;) {
+ nm = -1;
+ tmpl := los;
+ while (tmpl != nil) {
+ if (matches(abilities[i].desc, hd tmpl)) nm = 0;
+ tmpl = tl tmpl;
+ }
+ if (nm == 0) break;
+ p += p2;
+ tmp := abilities[i].desc[p:];
+ p2 = isat(tmp, " ");
+ if (p2 == -1) p2 = len tmp;
+ else p2++;
+ nm = nomatches(abilities[i].desc[:p+p2]);
+ if (nm <= 5) break;
+ }
+ if (nm > 0) {
+ listitem := biggestmatch(nm, abilities[i].desc,p+p2);
+ los = listitem :: los;
+ }
+ }
+ ar := array[len los] of string;
+ for (i = len ar - 1; i >= 0; i--) {
+ ar[i] = hd los;
+ los = tl los;
+ }
+ return ar;
+}
+
+buildabilitiesframes(top: ref Tk->Toplevel)
+{
+ ablmenu = getabllist();
+ tkcmd(top, ".m add command -text {Refresh Main Screen} -command {send butchan refreshstate}");
+ tkcmd(top, ".m add command -text {Reset Camera} -command {send butchan reset}");
+ for (k := 0; k < len ablmenu; k++) {
+ if (len ablmenu[k] > 4 && (ablmenu[k][:4] == "Zoom" || ablmenu[k][:5] == "Still"))
+ buildabilitiesframe(top,k,"butchan");
+ else
+ tkcmd(top, ".m add command -text {"+ablmenu[k]+
+ "} -command {send butchan abls "+string k+"}");
+ }
+ tkcmd(top, "menu .mthumb "+tkfont);
+ tkcmd(top, ".mthumb add command -label {Selection (88 files)}");
+ tkcmd(top, ".mthumb add separator");
+ for (k = nothumbs; k < len menu; k++)
+ tkcmd(top, ".mthumb add command -text {"+menu[k].text+"} " +
+ "-command {send butchan}");
+
+}
+
+buildabilitiesframe(top: ref Tk->Toplevel,k: int, chanout: string)
+{
+ nm := string nomatches(ablmenu[k]);
+ count2 := 0;
+ for (i := 0; i < noabilities; i++) {
+ if (matches(abilities[i].desc,ablmenu[k])) {
+
+ frame : string;
+ case abilities[i].pname {
+ "scpn" or "ssiz" or "zpos" =>
+ frame = ".f.fsnap.f"+abilities[i].pname;
+ tkcmd(top, "frame "+frame+" -borderwidth 1 -relief raised");
+ * =>
+ frame = ".f";
+ if (count2 == 0) {
+ tkcmd(top, "frame "+frame);
+ tkcmd(top, "label "+frame+".l -text {"+ablmenu[k]+"}"+tkfontb);
+ tkcmd(top, "grid "+frame+".l -row 0 -column 0 -columnspan "+nm);
+ }
+ frame = frame + ".f"+string count2;
+ tkcmd(top, "frame "+frame+" -borderwidth 1 -relief raised");
+ tkcmd(top, "grid "+frame+" -row 1 -column "+string count2+ " -sticky nsew");
+ mul := getval(abilities[i].data,"mul");
+ s := abilities[i].desc[len ablmenu[k]:];
+ if (mul != 1 && abilities[i].dtype == MINMAX)
+ s += " (x"+string mul+")";
+ tkcmd(top, "label "+frame+".l -text {"+s+"}"+tkfont);
+ tkcmd(top, "grid "+frame+".l -row 0 -column 0 -sticky nw");
+ }
+
+ if (abilities[i].dtype == MINMAX) {
+ abilities[i].location = frame+".sc";
+ min := getval(abilities[i].data,"min");
+ max := getval(abilities[i].data,"max");
+ tkcmd(top, sys->sprint("scale %s.sc -to %d -from %d %s", frame,min,max,tkfont));
+ tkcmd(top, "bind "+frame+".sc <ButtonPress-3> {send " +
+ chanout + " scaleval " + string i + " %X %Y}");
+ tkcmd(top, "grid "+frame+".sc -row 1 -column 0");
+ }
+ else if (abilities[i].dtype == LIST) {
+ tkcmd(top, "frame "+frame+".frb");
+ tkcmd(top, "grid "+frame+".frb -row 1 -column 0");
+ tmp := abilities[i].data;
+ row := 0;
+ while (tmp != nil) {
+ (name, val) := hd tmp;
+ s := sys->sprint("radiobutton %s.frb.rb%d -text {%s} -value %d -variable %s -height %d %s",frame,row,name,val,abilities[i].pname,24 - (3*(3-ssize)), tkfont);
+ tkcmd(top,s);
+ tkcmd(top, sys->sprint("grid %s.frb.rb%d -row %d -column 0 -sticky w",
+ frame,row,row));
+ tmp = tl tmp;
+ row++;
+ }
+ }
+ tkcmd(top, "button "+frame+".bs -text {Set} -command "+
+ "{send "+chanout+" set "+string i+"}"+butheight+tkfont);
+ tkcmd(top, "grid "+frame+".bs -row 2 -column 0 -sticky ew");
+ if (abilities[i].dtype == MINMAX) {
+ tkcmd(top, "button "+frame+".bf -text {Default} -command "+
+ "{send "+chanout+" setdef "+string i+"}"+butheight+tkfont);
+ tkcmd(top, "grid "+frame+".bf -row 3 -column 0 -sticky ew");
+ }
+ count2++;
+ }
+ }
+}
+
+getvaluescr := array[] of {
+ "frame .f -height 84 -width 114 -borderwidth 2 -relief raised",
+ "label .f.l1 -text {Enter Value:} @",
+ "entry .f.e1 -width 100 -bg white @",
+ "button .f.b1 -text { ok } -command {send chanin ok} &",
+ "button .f.b2 -text cancel -command {send chanin cancel} &",
+ "grid .f.l1 -column 1 -row 0 -columnspan 2 -padx 0 -sticky w",
+ "grid .f.e1 -column 1 -row 1 -columnspan 2 -padx 0 -pady 5",
+ "grid .f.b1 -column 1 -row 2 -padx 0",
+ "grid .f.b2 -column 2 -row 2 -padx 0",
+ "grid columnconfigure .f 1 -minsize 20",
+ "grid columnconfigure .f 2 -minsize 20",
+ "grid columnconfigure .f 3 -minsize 5",
+ "grid rowconfigure .f 0 -minsize 20",
+ "grid rowconfigure .f 1 -minsize 20",
+ "grid rowconfigure .f 2 -minsize 20",
+ "grid columnconfigure .f 0 -minsize 5",
+ "bind .f.e1 <Key> {send chanin key %s}",
+ "focus .f.e1",
+ "pack .f",
+ "update",
+};
+
+getvaluescreen(x,y: string): int
+{
+ x = string ((int x) - 55);
+ y = string ((int y) - 30);
+ (top, nil) := tkclient->toplevel(context, "-x "+x+" -y "+y, nil, tkclient->Plain);
+ chanin := chan of string;
+ tk->namechan(top, chanin, "chanin");
+ for (tk1 := 0; tk1 < len getvaluescr; tk1++)
+ tkcmd(top, getvaluescr[tk1]);
+ tkclient->onscreen(top, "exact");
+ tkclient->startinput(top, "kbd"::"ptr"::nil);
+ for(;;) {
+ alt {
+ s := <-top.ctxt.kbd =>
+ tk->keyboard(top, s);
+ s := <-top.ctxt.ptr =>
+ tk->pointer(top, *s);
+ inp := <- chanin =>
+ if (inp == "ok") return int tkcmd(top, ".f.e1 get");
+ else if (inp == "cancel") return -1;
+ else if (inp[:3] == "key") {
+ s := " ";
+ s[0] = int inp[4:];
+ if (s[0] == '\n') return int tkcmd(top, ".f.e1 get");
+ if (s[0] >= '0' && s[0] <= '9') {
+ tkcmd(top, ".f.e1 delete sel.first sel.last");
+ tkcmd(top, ".f.e1 insert insert {"+s+"}; update");
+ }
+ }
+ }
+ }
+}
+
+infoscreen()
+{
+ (top, titlebar) := tkclient->toplevel(context, "", "Information", Tkclient->Hide);
+ tmp := inflist;
+ tkcmd(top, "frame .f");
+ tkcmd(top, "label .f.l -text {Information}");
+ tkcmd(top, "grid .f.l -row 0 -column 0 -columnspan 2");
+ tkcmd(top, "frame .f.finfo -borderwidth 1 -relief raised");
+ tkcmd(top, "grid .f.finfo");
+ infrow := 0;
+ while (tmp != nil) {
+ infrow++;
+ s := string infrow;
+ (d1,d2) := hd tmp;
+ tkcmd(top, "label .f.finfo.l"+s+"1 -text {"+d1+"}");
+ tkcmd(top, "label .f.finfo.l"+s+"2 -text {"+d2+"}");
+ tkcmd(top, "grid .f.finfo.l"+s+"1 -row "+s+" -column 0 -sticky w");
+ tkcmd(top, "grid .f.finfo.l"+s+"2 -row "+s+" -column 1 -sticky e");
+ tmp = tl tmp;
+ }
+ tkcmd(top, "pack .f; update");
+ tkclient->onscreen(top, nil);
+ tkclient->startinput(top, "kbd"::"ptr"::nil);
+ main: for(;;) {
+ alt {
+ s := <-top.ctxt.kbd =>
+ tk->keyboard(top, s);
+ s := <-top.ctxt.ptr =>
+ tk->pointer(top, *s);
+ title := <-top.ctxt.ctl or
+ title = <-top.wreq or
+ title = <- titlebar =>
+ if (title == "exit") break main;
+ tkclient->wmctl(top, title);
+ }
+ }
+}
+
+settingsscreen(k: int, ctlchan: chan of int)
+{
+ low := toplevels;
+ for (;low != nil; low = tl low) {
+ (tplvl, name, nil,nil) := hd low;
+ if (name == ablmenu[k]) {
+ tkcmd(tplvl, "raise .; focus .; update");
+ ctlchan <-= DONE;
+ return;
+ }
+ }
+ pid := sys->pctl(0, nil);
+ (top, titlebar) := tkclient->toplevel(context, "", "Config", Tkclient->Appl);
+ chanin := chan of string;
+ tk->namechan(top,chanin, "chanin");
+ buildabilitiesframe(top,k, "chanin");
+ tkcmd(top,"bind .Wm_t <ButtonPress-1> +{focus .}");
+ tkcmd(top,"bind .Wm_t.title <ButtonPress-1> +{focus .}");
+ tkcmd(top, "pack .f; update");
+ err := 0;
+ allread := 1;
+ l : list of int = nil;
+ for (i := 0; i < noabilities; i++) {
+ if (matches(abilities[i].desc, ablmenu[k])) {
+ l = i :: l;
+ if (abilities[i].read != "")
+ setmystate(top,i,abilities[i].read);
+ else
+ allread = 0;
+ }
+ }
+ tkclient->onscreen(top, nil);
+ tkclient->startinput(top, "kbd"::"ptr"::nil);
+ if (!allread) {
+ spawn workingscreen2(getcoords(top),pid, ctlchan,0);
+ ltmp := l;
+ for (;ltmp != nil; ltmp = tl ltmp) {
+ if (abilities[hd ltmp].read == "" && getstate(top, hd ltmp) == -1) {
+ err = 1;
+ break;
+ }
+ }
+ }
+ if (!err)
+ spawn settingsloop(top,chanin,titlebar,k,l);
+ ctlchan <-= DONE;
+}
+
+settingsloop(top: ref Tk->Toplevel, chanin,titlebar: chan of string, k: int, abls: list of int)
+{
+ tkcmd(top, "focus .Wm_t");
+ pid := sys->pctl(0,nil);
+ addtoplevel(top,ablmenu[k], abls, pid);
+ ctlchan := chan of int;
+ main: for(;;) {
+ alt {
+ s := <-top.ctxt.kbd =>
+ tk->keyboard(top, s);
+ s := <-top.ctxt.ptr =>
+ tk->pointer(top, *s);
+ inp := <- chanin =>
+ tkcmd(top, "focus .");
+ (n, lst) := sys->tokenize(inp, " \t\n");
+ case hd lst {
+ "scaleval" =>
+ i := int hd tl lst;
+ val := getvaluescreen(hd tl tl lst, hd tl tl tl lst);
+ if (val != -1) tkcmd(top, abilities[i].location+" set "+string val+";update");
+ "set" or "setdef" =>
+ if (working)
+ dialog(" Camera is busy! ", 2,-1,getcoords(top));
+ else {
+ spawn set(top, int hd tl lst, hd lst, ctlchan);
+ <-ctlchan;
+ working = 0;
+ }
+ }
+ clearbuffer(chanin);
+ title := <-top.ctxt.ctl or
+ title = <-top.wreq or
+ title = <- titlebar =>
+ if (title == "exit") break main;
+ tkclient->wmctl(top, title);
+ }
+ }
+ deltoplevel(top);
+}
+
+clearbuffer(c: chan of string)
+{
+ tc := chan of int;
+ spawn timer(tc);
+ main: for (;;) alt {
+ del := <-c => ;
+ tick := <-tc =>
+ break main;
+ }
+}
+
+timer(tick: chan of int)
+{
+ sys->sleep(100);
+ tick <- = 1;
+}
+
+getval(l: list of (string,int), s: string): int
+{
+ while (l != nil) {
+ (name,val) := hd l;
+ if (name == s) return val;
+ l = tl l;
+ }
+ return -2;
+}
+
+list2string(l : list of string): string
+{
+ s := "";
+ while (l != nil) {
+ s += " " + hd l;
+ l = tl l;
+ }
+ if (s != "") return s[1:];
+ return s;
+}
+
+JPG: con 0;
+THUMB: con 1;
+
+Imgloaded: adt {
+ name: string;
+ imgtype: int;
+};
+
+nofiles := 0;
+filelist := array[200] of string;
+thumbimg := array[200] of ref draw->Image;
+selected := array[200] of { * => 0 };
+noselected := 0;
+fnew : list of int;
+imgloaded : list of Imgloaded;
+maxwidth, maxheight: int;
+nothumbs := 0;
+
+nocamera(): int
+{
+ (n,dir) := sys->stat(camerapath+"ctl");
+ if (n != -1) return 0;
+ return 1;
+}
+
+startuptkstuff(top: ref Tk->Toplevel, ctlchan: chan of int)
+{
+ pid := sys->pctl(0, nil);
+ spawn workingscreen2(coords,pid, ctlchan,1);
+ getabilities();
+ (dirs,n) := readdir->init(camerapath+"thumb", readdir->NAME);
+ if (n == -1) nothumbs = 1;
+ buildabilitiesframes(top);
+ refreshfilelist(top,0);
+ ctlchan <-= DONE;
+}
+
+tibuild := 0;
+butheight := "";
+
+tkstuff()
+{
+ if (!runwithoutcam && nocamera()) {
+ dialog("Cannot find camera!",0,-1,nilrect);
+ exit;
+ }
+ (win, titlebar) := tkclient->toplevel(context, "", "Camera", Tkclient->Appl);
+ tkcmd(win, "frame .test");
+ if (tkcmd(win, ".test cget -bg") == "#ffffffff")
+ tibuild = 1;
+ tkcmd(win, "destroy .test");
+ butheight = " -height "+string (16 + (5*tibuild) - (3*(3-ssize)));
+ butchan := chan of string;
+ tk->namechan(win, butchan, "butchan");
+ for (tk1 := 0; tk1 < len thumbscr; tk1++)
+ tkcmd(win, thumbscr[tk1]);
+ coords = display.image.r;
+ ctlchan := chan of int;
+ imgloaded = nil;
+
+ spawn startuptkstuff(win, ctlchan);
+ e := <- ctlchan;
+ if (e == KILLED) {
+ dialog("Cancel during load!",0,-1,coords);
+ exit;
+ }
+ working = 0;
+ spawn mainscreen(win, 1, ctlchan);
+ <- ctlchan;
+ working = 0;
+
+ processing = 0;
+ tkcmd(win, "pack propagate . 0");
+ resizemain(win,1);
+ tkcmd(win, "pack .f; update; focus .");
+ coords = getcoords(win);
+ loadimg = nil;
+ tkclient->onscreen(win, nil);
+ tkclient->startinput(win, "kbd"::"ptr"::nil);
+ main: for (;;) {
+ alt {
+ s := <-win.ctxt.kbd =>
+ tk->keyboard(win, s);
+ s := <-win.ctxt.ptr =>
+ tk->pointer(win, *s);
+ inp := <-butchan =>
+ tkcmd(win, "focus .");
+ (n, lst) := sys->tokenize(inp, "\t\n ");
+ case hd lst {
+
+ # Communicates internally
+
+ "scaleval" =>
+ i := int hd tl lst;
+ val := getvaluescreen(hd tl tl lst, hd tl tl tl lst);
+ if (val != -1) tkcmd(win, abilities[i].location+" set "+string val);
+ "info" =>
+ spawn infoscreen();
+ "unload" =>
+ i := int hd tl lst;
+ for (k := 0; k < nofiles; k++) {
+ if (i == k || (i == -1 && selected[k])) {
+ delloaded(filelist[k],JPG);
+ delloaded(filelist[k],THUMB);
+ }
+ }
+ "invert" =>
+ nf := 0;
+ for (i := 0; i < nofiles; i++)
+ selected[i] = 1 - selected[i];
+ doselect(win);
+ "selectall" =>
+ val := int hd tl lst;
+ for (i := 0; i < nofiles; i++)
+ selected[i] = val;
+ doselect(win);
+ "select" =>
+ i := int hd tl lst;
+ selected[i] = 1 - selected[i];
+ doselect(win);
+ "selectonly" =>
+ i := int hd tl lst;
+ val := selected[i];
+ for (k := 0; k < nofiles; k++)
+ selected[k] = 0;
+ if (noselected - val == 0) selected[i] = 1 - val;
+ else selected[i] = 1;
+ doselect(win);
+ "menu" =>
+ i := int hd tl lst;
+ if (selected[i] && noselected > 1) i = -1;
+ title := "Selection ("+string noselected+" files)";
+ if (i != -1) title = filelist[i]+".jpg";
+ si := string i;
+ tkcmd(win, ".mthumb entryconfigure 0 -text {"+title+"}");
+ for (k := nothumbs; k < len menu; k++)
+ tkcmd(win, ".mthumb entryconfigure "+string (2+k-nothumbs)+
+ " -command {send butchan "+ menu[k].com+" "+si+"}");
+ tkcmd(win, ".mthumb post "+hd tl tl lst+" "+hd tl tl tl lst);
+ * =>
+ if (!processing)
+ spawn dealwithcamera(win, lst);
+ }
+ tkcmd(win, "update");
+ clearbuffer(butchan);
+ title := <-win.ctxt.ctl or
+ title = <-win.wreq or
+ title = <-titlebar =>
+ if (title == "exit")
+ break main;
+ err := tkclient->wmctl(win, title);
+ if (err == nil && title == "!size") {
+ (n, lst) := sys->tokenize(title, " ");
+ if (hd tl lst == ".")
+ resizemain(win,0);
+ }
+ coords = getcoords(win);
+ }
+ }
+ for (; toplevels != nil; toplevels = tl toplevels) {
+ (nil, nil, nil, pid) := hd toplevels;
+ if (pid != -1)
+ kill(pid);
+ }
+ while (imgloaded != nil) {
+ (fname, ftype) := hd imgloaded;
+ sys->remove(tmppath+fname+"."+string ftype+"~");
+ imgloaded = tl imgloaded;
+ }
+ tkcmd(win, "destroy .");
+ exit;
+}
+
+dealwithcamera(win: ref Tk->Toplevel, lst: list of string)
+{
+ ctlchan := chan of int;
+ processing = 1;
+ case hd lst {
+ "gettime" =>
+ spawn refreshtime(win, ctlchan);
+ <- ctlchan;
+ "show" =>
+ spawn loadthumb(win,int hd tl lst,ctlchan);
+ <- ctlchan;
+ "snap" =>
+ selected[nofiles+1] = 0;
+ spawn takephoto(win, ctlchan);
+ <- ctlchan;
+ working = 0;
+ if (fnew == nil)
+ break;
+ spawn waittilready(camerapath+"jpg/"+filelist[hd fnew]+".jpg", ctlchan);
+ e := <- ctlchan;
+ working = 0;
+ if (e == DONE) {
+ spawn loadnewthumb(win, ctlchan);
+ <- ctlchan;
+ working = 0;
+ }
+ "abls" =>
+ spawn settingsscreen(int hd tl lst, ctlchan);
+ <- ctlchan;
+ "set" or "setdef" =>
+ spawn set(win, int hd tl lst, hd lst, ctlchan);
+ <- ctlchan;
+ "del" =>
+ spawn delete(win, int hd tl lst, ctlchan);
+ <- ctlchan;
+ "view" =>
+ i := int hd tl lst;
+ unnew(win, i);
+ if (i == -1) multiview();
+ else vw(i);
+ "refresh" =>
+ spawn refresh(win, ctlchan);
+ <- ctlchan;
+ "refreshstate" =>
+ spawn mainscreen(win, 0, ctlchan);
+ <- ctlchan;
+ "dnld" =>
+ i := int hd tl lst;
+ unnew(win, i);
+ if (i == -1) multidownload();
+ else dnld(i, "");
+ "reset" =>
+ if (dialog("reset camera to default settings?",1,-1,coords)) {
+ spawn resetcam(win,1, ctlchan);
+ <- ctlchan;
+ }
+ }
+ processing = 0;
+ working = 0;
+}
+
+refresh(top: ref Tk->Toplevel, ctlchan: chan of int)
+{
+ pid := sys->pctl(0, nil);
+ spawn workingscreen2(coords,pid, ctlchan,0);
+ refreshfilelist(top,1);
+ ctlchan <-= DONE;
+}
+
+delete(top: ref Tk->Toplevel, i: int, ctlchan: chan of int)
+{
+ pid := sys->pctl(0, nil);
+ ok : int;
+ s := "";
+ loi : list of int;
+ loi = nil;
+ if (i == -1) {
+ for (k := 0; k < nofiles; k++)
+ if (selected[k]) s+= filelist[k]+".jpg\n";
+ if (!dialog("Delete Selected files?\n\n"+s,1,-1,coords)) {
+ ctlchan <-= DONE;
+ return;
+ }
+ }
+ else if (!dialog("Delete "+filelist[i]+".jpg?",1,i,coords)) {
+ ctlchan <-= DONE;
+ return;
+ }
+ spawn workingscreen2(coords,pid, ctlchan,0);
+ s = "";
+ for (k := 0; k < nofiles; k++) {
+ if ((i == -1 && selected[k]) || k == i) {
+ s += filelist[k]+".jpg ";
+ ok = sys->remove(camerapath+
+ "jpg/"+filelist[k]+".jpg");
+ if (ok == -1) s+="failed\n";
+ else {
+ s+="ok\n";
+ loi = k :: loi;
+ }
+ }
+ }
+ if (loi == nil && i != -1) {
+ dialog("cannot remove "+filelist[i]+".jpg?",0,i,coords);
+ ctlchan <-= DONE;
+ return;
+ }
+ while (loi != nil) {
+ delloaded(filelist[hd loi],JPG);
+ delloaded(filelist[hd loi],THUMB);
+ delselect(hd loi);
+ loi = tl loi;
+ }
+ refreshfilelist(top,0);
+ getstore(top);
+ if (i == -1) dialog("Files deleted:\n\n"+s,0,-1,coords);
+ ctlchan <-= DONE;
+}
+
+delselect(n: int)
+{
+ for (i := n; i < nofiles - 1; i++)
+ selected[i] = selected[i+1];
+ selected[nofiles - 1] = 0;
+}
+
+doselect(top: ref Tk->Toplevel)
+{
+ n := 0;
+ for (i := 0; i < nofiles; i++) {
+ col := "white";
+ if (selected[i]) {
+ col = "blue";
+ n++;
+ }
+ tkcmd(top,".fthumb.p"+string i+" configure -bg "+col);
+ }
+ noselected = n;
+ s := " files";
+ if (n == 1) s = " file";
+ tkcmd(top, ".f.fsnap.fsettings.mb2 configure -text {Selected\n("+string n+s+")}");
+}
+
+takephoto(top: ref Tk->Toplevel, ctlchan: chan of int)
+{
+ pid := sys->pctl(0, nil);
+ spawn workingscreen2(coords,pid, ctlchan,0);
+ fd := sys->open(camerapath+"ctl",sys->OWRITE);
+ if (fd != nil) {
+ e := sys->fprint(fd, "snap");
+ if (e < 0) {
+ dialog("Could not take photo",0,-1,coords);
+ getstore(top);
+ }
+ else {
+ getstore(top);
+ n := nofiles;
+ for (i := 0; i < 5; i++) {
+ refreshfilelist(top,1);
+ sys->sleep(1000);
+ if (nofiles > n)
+ break;
+ }
+ }
+ }
+ ctlchan <-= DONE;
+}
+
+unnew(top: ref Tk->Toplevel, i: int)
+{
+ if (fnew == nil)
+ return;
+ tmp : list of int = nil;
+ for (;fnew != nil; fnew = tl fnew) {
+ if (i == -1 && selected[hd fnew])
+ i = hd fnew;
+ if (hd fnew == i)
+ tkcmd(top, ".fthumb.mb"+string hd fnew+" configure -fg black; update");
+ else
+ tmp = hd fnew :: tmp;
+ }
+ fnew = tmp;
+}
+
+refreshtime(top: ref Tk->Toplevel, ctlchan: chan of int)
+{
+ pid := sys->pctl(0, nil);
+ spawn workingscreen2(coords,pid, ctlchan,0);
+ if (!samedate(top) && tkcmd(top, "variable time") == "1") settime();
+ gettime(top);
+ ctlchan <-= DONE;
+}
+
+addtoplevel(top: ref Tk->Toplevel, name: string, abls: list of int, pid: int)
+{
+ ltmp := toplevels;
+ isin := 0;
+ for (;ltmp != nil; ltmp = tl ltmp) {
+ (tplvl, nil, nil, nil) := hd ltmp;
+ if (tplvl == top) isin = 1;
+ }
+ if (!isin)
+ toplevels = (top, name, abls, pid) :: toplevels;
+}
+
+deltoplevel(top: ref Tk->Toplevel)
+{
+ ltmp : list of (ref Tk->Toplevel, string, list of int, int) = nil;;
+ for (;toplevels != nil; toplevels = tl toplevels) {
+ (tplvl, nm, loi, p) := hd toplevels;
+ if (tplvl != top)
+ ltmp = (tplvl, nm, loi, p) :: ltmp;
+ }
+ toplevels = ltmp;
+}
+
+resetcam(top: ref Tk->Toplevel, show: int, ctlchan: chan of int)
+{
+ pid := sys->pctl(0, nil);
+ spawn workingscreen2(coords,pid, ctlchan,0);
+ for (i := 0; i < noabilities; i++)
+ setstate(i, string abilities[i].factory);
+ if (show) {
+ ltmp := toplevels;
+ for (;ltmp != nil; ltmp = tl ltmp) {
+ (tplvl, nm, loi, p) := hd ltmp;
+ for (; loi != nil; loi = tl loi)
+ setmystate(tplvl, hd loi, string abilities[hd loi].factory);
+ }
+ if (top != nil)
+ getstore(top);
+ }
+ ctlchan <-= DONE;
+}
+
+set(top: ref Tk->Toplevel, i: int, s: string, ctlchan: chan of int)
+{
+ pid := sys->pctl(0, nil);
+ spawn workingscreen2(getcoords(top),pid, ctlchan,0);
+
+ val : string;
+ if (s == "setdef") {
+ val = string abilities[i].factory;
+ setmystate(top,i,val);
+ }
+ else {
+ if (abilities[i].dtype == MINMAX) {
+ val = tkcmd(top, abilities[i].location+" get");
+ mul := getval(abilities[i].data, "mul");
+ val = string (int val * mul);
+ }
+ else {
+ val = tkcmd(top, "variable "+abilities[i].pname);
+ }
+ }
+
+ e := setstate(i,val);
+ if (e == 2) getstore(top);
+ else if (e == 0)
+ dialog("cannot communicate with camera",0,-1,coords);
+ ctlchan <-= DONE;
+}
+
+setstate(i: int, val: string): int
+{
+ fd := sys->open(camerapath+"ctl",sys->OWRITE);
+ if (fd != nil) {
+ sys->fprint(fd, "%s %s",abilities[i].pname,val);
+ abilities[i].read = val;
+ if (abilities[i].pname == "ssiz" || abilities[i].pname == "scpn") return 2;
+ return 1;
+ }
+ else return 0;
+}
+
+getfirst(s: string): string
+{
+ (n, lst) := sys->tokenize(s," \n\t");
+ if (lst == nil) return "";
+ return hd lst;
+}
+
+getabl(pname: string): int
+{
+ for (i := 0; i < noabilities; i++)
+ if (abilities[i].pname == pname) return i;
+ return -1;
+}
+
+getstate(top: ref Tk->Toplevel, i: int): int
+{
+ fd := sys->open(camerapath+"state", sys->OWRITE);
+ if (fd != nil) {
+ sys->fprint(fd ,"%s", abilities[i].pname);
+ sys->sleep(500);
+ fdi := bufio->open(camerapath+"state",sys->OREAD);
+ if (fdi != nil) {
+ s := fdi.gets('\n');
+ if (s != nil) {
+ (n,lst) := sys->tokenize(s,":\n");
+ val := hd tl lst;
+ setmystate(top,i,val);
+ }
+ return 0;
+ }
+ }
+ dialog("cannot communicate with camera",0,-1,coords);
+ return -1;
+}
+
+setmystate(top: ref Tk->Toplevel, i: int, val: string)
+{
+ abilities[i].read = val;
+ if (abilities[i].dtype == LIST)
+ tkcmd(top, "variable "+abilities[i].pname+" "+val);
+ else if (abilities[i].dtype == MINMAX) {
+ mul := getval(abilities[i].data, "mul");
+ tkcmd(top, abilities[i].location+" set "+string((int val)/mul));
+ }
+ tkcmd(top, "update");
+}
+
+max(a,b: int): int
+{
+ if (a > b) return a;
+ return b;
+}
+
+refreshfilelist(win: ref Tk->Toplevel, refresh: int): int
+{
+ if (refresh) {
+ fd := sys->open(camerapath+"ctl",sys->OWRITE);
+ if (fd == nil) {
+ dialog("cannot communicate with camera",0,-1,coords);
+ return -1;
+ }
+ else
+ sys->fprint(fd, "refresh");
+ }
+ oldlist := filelist[:nofiles];
+ for (i := 0; i < nofiles; i++) {
+ si := string i;
+ tk->cmd(win, "grid forget .fthumb.mb"+si+" .fthumb.p"+si);
+ tk->cmd(win, "destroy .fthumb.mb"+si+" .fthumb.p"+si+" .mthumb"+si);
+ }
+ (dirs,n) := readdir->init(camerapath+"jpg", readdir->NAME);
+ if (n == -1)
+ return -1;
+ nofiles = n;
+ row := 0;
+ col := 0;
+ nocols := -1;
+ w1 := int tkcmd(win, ".f.f1.c1 cget -width");
+ w := 0;
+ fnew = nil;
+ for (i = 0; i < nofiles; i++) {
+ filelist[i] = dirs[i].name;
+ if (len filelist[i] > 3 && filelist[i][len filelist[i] - 4] == '.')
+ filelist[i] = filelist[i][:len filelist[i]-4];
+
+ isnew := 1;
+ for (k := 0; k < len oldlist; k++) {
+ if (filelist[i] == oldlist[k]) {
+ isnew = 0;
+ break;
+ }
+ }
+ si := string i;
+ tkcmd(win, "menubutton .fthumb.mb"+si+" -bg white " +
+ "-text {"+filelist[i]+".jpg} -menu .mthumb"+si+tkfontf);
+ if (isnew && refresh) {
+ fnew = i :: fnew;
+ tkcmd(win, ".fthumb.mb"+si+" configure -fg red");
+ }
+ thumbimg[i] = display.newimage(Rect((0,0),(90,90)),draw->RGB24,0,int 16rffcc00ff);
+ e := tkcmd(win,"panel .fthumb.p"+si+" -borderwidth 2 -bg white"+
+ " -height 90 -width 90 -relief raised");
+ tk->putimage(win,".fthumb.p"+si, thumbimg[i],nil);
+ tkcmd(win, "bind .fthumb.p"+si+" <Double-Button-1> {send butchan view "+si+"}");
+ tkcmd(win, "bind .fthumb.p"+si+" <ButtonPress-1> {send butchan selectonly "+si+"}");
+ tkcmd(win, "bind .fthumb.p"+si+" <ButtonPress-2> {send butchan select "+si+"}");
+ tkcmd(win, "bind .fthumb.p"+si+" <ButtonPress-3> {send butchan menu "+si+" %X %Y}");
+ thisw := int tkcmd(win, ".fthumb.mb"+si+" cget -width");
+ w += max(94, thisw);
+ if ((nocols == -1 && w >= w1-(col*2)) || col == nocols) {
+ nocols = col;
+ col = 0;
+ row+=2;
+ w = thisw;
+ }
+ if (col == 0)
+ tkcmd(win, "grid rowconfigure .fthumb "+string (row+1)+
+ " -minsize "+string (105 - 2*(3-ssize)));
+
+ tkcmd(win, "grid .fthumb.mb"+si+" -row "+string row+" -column "+string col);
+ tkcmd(win, "grid .fthumb.p"+si+" -row "+string (row+1)+" -column "+string col+" -sticky n");
+
+ tkcmd(win, "menu .mthumb"+si+tkfont);
+ for (k = nothumbs; k < len menu; k++)
+ tkcmd(win, ".mthumb"+si+" add command -text {"+menu[k].text+"} " +
+ "-command {send butchan "+menu[k].com+" "+si+"}");
+
+ if (isloaded(filelist[i],THUMB) && usecache)
+ loadthumbnail(win,i);
+ col++;
+ }
+ if (row == 0)
+ nocols = col;
+ doselect(win);
+ size := tkcmd(win, "grid size .fthumb");
+ csize := int size[:isat(size, " ")];
+ rsize := int size[isat(size, " ")+1:];
+ if (csize > nocols)
+ tkcmd(win, "grid columndelete .fthumb "+string nocols+" "+string csize);
+ if (rsize > row+1)
+ tkcmd(win, "grid rowdelete .fthumb "+string (row+2)+" "+string rsize);
+ height := string (2 + int tkcmd(win, ".fthumb cget -height"));
+ width := tkcmd(win, ".f.f1.c1 cget -width");
+ colsize : int;
+ if (nocols > 0) colsize = int width / nocols;
+ else colsize = int width;
+ for (i = 0; i < nocols; i++)
+ tkcmd(win, "grid columnconfigure .fthumb "+string i+" -minsize "+string colsize);
+
+ tkcmd(win, ".f.f1.c1 configure -scrollregion { 0 0 "+width+" "+height+"}");
+ tkcmd(win, "update");
+ return 0;
+}
+
+Mtype: adt {
+ text, com: string;
+};
+
+menu := array[] of {
+ Mtype ("Show Thumbnail", "show"),
+ Mtype ("Download", "dnld"),
+ Mtype ("View", "view"),
+ Mtype ("Delete", "del"),
+ Mtype ("Clear Cache", "unload"),
+ Mtype ("Refresh Files", "refresh"),
+};
+
+tkcmd(top: ref Tk->Toplevel, cmd: string): string
+{
+ if (cmd[len cmd - 1] == '$')
+ cmd = cmd[:len cmd - 1] + tkfontb;
+ else if (cmd[len cmd - 1] == '@')
+ cmd = cmd[:len cmd - 1] + tkfont;
+ if (cmd[len cmd - 1] == '&')
+ cmd = cmd[:len cmd - 1] + butheight+tkfont;
+
+ e := tk->cmd(top, cmd);
+ if (e != "" && e[0] == '!') sys->print("tk error: '%s': %s\n",cmd,e);
+ return e;
+}
+
+loadnewthumb(top: ref Tk->Toplevel, ctlchan: chan of int)
+{
+ pid := sys->pctl(0,nil);
+ spawn workingscreen2(coords,pid, ctlchan,0);
+ getstore(top);
+ for (tmp := fnew; tmp != nil; tmp = tl tmp)
+ loadthumbnail(top,hd tmp);
+ ctlchan <-= DONE;
+}
+
+loadthumb(top: ref Tk->Toplevel, i: int, ctlchan: chan of int)
+{
+ pid := sys->pctl(0, nil);
+ spawn workingscreen2(coords,pid, ctlchan,0);
+ if (i == -1) {
+ for (k := 0; k < nofiles; k++)
+ if (selected[k])
+ if (loadthumbnail(top, k) != 0) break;
+ }
+ else loadthumbnail(top, i);
+ ctlchan <-= DONE;
+}
+
+loadthumbnail(top: ref Tk->Toplevel, i: int): int
+{
+ fd : ref sys->FD;
+ if (usecache && isloaded(filelist[i],THUMB))
+ fd = sys->open(tmppath+filelist[i]+"."+string THUMB+"~",sys->OREAD);
+ else fd = sys->open(camerapath+"thumb/"+filelist[i]+".bit",sys->OREAD);
+ if (fd == nil) {
+ if (usecache && isloaded(filelist[i],THUMB)) {
+ delloaded(filelist[i],THUMB);
+ return loadthumbnail(top,i);
+ }
+ else dialog("cannot open "+filelist[i]+".bit",0,-1,coords);
+ return -2;
+ }
+ image := display.readimage(fd);
+ if (image == nil) {
+ if (usecache && isloaded(filelist[i],THUMB)) {
+ delloaded(filelist[i],THUMB);
+ return loadthumbnail(top,i);
+ }
+ else dialog("Could not load thumbnail: "+filelist[i]+".jpg",0,-1,coords);
+ return -1;
+ }
+ else {
+ p := Point((90-image.r.max.x)/2,(90-image.r.max.y)/2);
+ thumbimg[i].draw(image.r.addpt(p), image,nil,(0,0));
+ si := string i;
+ tkcmd(top,".fthumb.p"+si+" dirty");
+ fd = nil;
+ n := -1;
+ if (usecache) {
+ fd = sys->create(tmppath+filelist[i]+"."+string THUMB+"~",sys->OWRITE,8r666);
+ n = display.writeimage(fd, image);
+ }
+ x := int tkcmd(top, ".fthumb.mb"+string i+" cget -actx");
+ y := int tkcmd(top, ".fthumb.mb"+string i+" cget -acty");
+ h := int tkcmd(top, ".fthumb.mb"+string i+" cget -height");
+ x1 := int tkcmd(top, ".fthumb cget -actx");
+ y1 := int tkcmd(top, ".fthumb cget -acty");
+ tkcmd(top, ".f.f1.c1 see "+string (x-x1)+" " +string (y-y1)+
+ " "+string (x-x1+90)+" " +string (y-y1+h+102)+"; update");
+ if (!usecache || n == 0) imgloaded = (filelist[i],THUMB) :: imgloaded;
+ }
+ return 0;
+}
+
+isloaded(name: string, ftype: int): int
+{
+ tmp := imgloaded;
+ while (tmp != nil) {
+ ic := hd tmp;
+ if (ic.name == name && ic.imgtype == ftype) return 1;
+ tmp = tl tmp;
+ }
+ return 0;
+}
+
+delloaded(name: string, ftype: int)
+{
+ tmp : list of Imgloaded;
+ tmp = nil;
+ while (imgloaded != nil) {
+ ic := hd imgloaded;
+ if (ic.name != name || ic.imgtype != ftype)
+ tmp = ic :: tmp;
+ else sys->remove(tmppath+ic.name+"."+string ic.imgtype+"~");
+ imgloaded = tl imgloaded;
+ }
+ imgloaded = tmp;
+}
+
+dialog(msg: string, diagtype, img: int, r: Rect): int
+{
+ if (diagtype == 2)
+ diagtype = 0;
+ else
+ working = 0;
+ tmpimg : ref draw->Image;
+ out := 0;
+ title := "Dialog";
+ if (diagtype == 0) title = "Alert!";
+ (win, titlebar) := tkclient->toplevel(context, "" , title, Tkclient->Appl);
+ diagchan := chan of string;
+ tk->namechan(win, diagchan, "diagchan");
+ tkcmd(win, "frame .f");
+ tkcmd(win, "label .f.l -text {"+msg+"}"+tkfont);
+ tkcmd(win, "button .f.bo -text { ok } -command {send diagchan ok} "+butheight+tkfont);
+ tkcmd(win, "button .f.bc -text {cancel} -command {send diagchan cancel}"+butheight+tkfont);
+ if (img >= 0 && isloaded(filelist[img], THUMB) && usecache) {
+ fd := sys->open(tmppath+filelist[img]+"."+string THUMB+"~", sys->OREAD);
+ if (fd != nil) {
+ tmpimg = display.readimage(fd);
+ tkcmd(win,"panel .f.p -height "+string tmpimg.r.max.y+
+ " -width "+string tmpimg.r.max.x+" -borderwidth 2 -relief raised");
+ tk->putimage(win,".f.p", tmpimg, nil);
+ tkcmd(win, "grid .f.p -row 1 -column 0 -columnspan 2 -padx 5 -pady 5");
+ }
+ }
+ tkcmd(win, "grid .f.l -row 0 -column 0 -columnspan 2 -padx 10 -pady 5");
+ if (diagtype == 1) {
+ tkcmd(win, "grid .f.bo -row 2 -column 0 -padx 5 -pady 5");
+ tkcmd(win, "grid .f.bc -row 2 -column 1 -padx 5 -pady 5");
+ }
+ else tkcmd(win, "grid .f.bo -row 2 -column 0 -columnspan 2 -padx 5 -pady 5");
+ if (!r.eq(nilrect))
+ centrewin(win, r, 1);
+ else
+ tkcmd(win, "pack .f; focus .; update");
+ tkclient->onscreen(win, "exact");
+ tkclient->startinput(win, "kbd"::"ptr"::nil);
+ main: for (;;) {
+ alt {
+ s := <-win.ctxt.kbd =>
+ tk->keyboard(win, s);
+ s := <-win.ctxt.ptr =>
+ tk->pointer(win, *s);
+ inp := <-diagchan =>
+ if (inp == "ok") {
+ out = 1;
+ break main;
+ }
+ if (inp == "cancel")
+ break main;
+
+ title = <-win.ctxt.ctl or
+ title = <-win.wreq or
+ title = <-titlebar =>
+ if (title == "exit")
+ break main;
+ else
+ tkclient->wmctl(win, title);
+ }
+ }
+ return out;
+}
+
+snapscr := array[] of {
+ "label .f.fsnap.ltime -text {Date and Time} $",
+ "label .f.fsnap.lstore -text {Memory Status} $",
+ "label .f.fsnap.lzpos -text {Zoom} $",
+ "label .f.fsnap.lssiz -text {Resolution} $",
+ "label .f.fsnap.lscpn -text {Compression} $",
+ "grid .f.fsnap.ltime -row 0 -column 0 -sticky sw",
+ "grid .f.fsnap.lstore -row 0 -column 1 -sticky sw",
+ "grid .f.fsnap.lscpn -row 2 -column 0 -sticky sw",
+ "grid .f.fsnap.lssiz -row 2 -column 1 -sticky sw",
+ "grid .f.fsnap.lzpos -row 2 -column 2 -sticky sw",
+
+ "grid .f.fsnap.ftime -row 1 -column 0 -sticky nsew",
+ "grid .f.fsnap.fstore -row 1 -column 1 -sticky nsew",
+ "grid .f.fsnap.fsettings -row 1 -column 2 -sticky nsew",
+ "grid .f.fsnap.fscpn -row 3 -column 0 -sticky nsew",
+ "grid .f.fsnap.fssiz -row 3 -column 1 -sticky nsew",
+ "grid .f.fsnap.fzpos -row 3 -column 2 -sticky nsew",
+ "grid .f.fsnap.b -row 4 -column 0 -columnspan 3",
+ "grid rowconfigure .f.fsnap 0 -minsize 30",
+ "grid rowconfigure .f.fsnap 2 -minsize 30",
+ "grid rowconfigure .f.fsnap 4 -minsize 30",
+
+ "update",
+};
+
+mainscreen(win: ref Tk->Toplevel, opt: int, ctlchan: chan of int)
+{
+ pid := sys->pctl(0, nil);
+ spawn workingscreen2(coords, pid, ctlchan, opt);
+ if (opt == 1) {
+ for (tk1 := 0; tk1 < len snapscr; tk1++)
+ tkcmd(win, snapscr[tk1]);
+
+ gettime(win);
+ if (samedate(win)) tkcmd(win, "variable time 1; update");
+ }
+ getstore(win);
+ lst := getabl("scpn") :: getabl("ssiz") :: getabl("zpos") :: nil;
+ if (getstate(win, hd tl tl lst) == 0);
+ if (getstate(win, hd tl lst) == 0);
+ getstate(win, hd lst);
+ if (opt == 1) {
+ addtoplevel(win, "", lst, -1);
+ height := tkcmd(win, ".f.fsnap cget -height");
+ width := tkcmd(win, ".f.fsnap cget -width");
+# tkcmd(win, ".f.f2.c1 configure -scrollregion { 0 0 "+width+" "+height+"}");
+# tkcmd(win, ".f.f2.c1 configure -height "+height+"}");
+ }
+ ctlchan <-= DONE;
+}
+
+kill(pid: int)
+{
+ pctl := sys->open("/prog/" + string pid + "/ctl", Sys->OWRITE);
+ if (pctl != nil)
+ sys->write(pctl, array of byte "kill", len "kill");
+}
+
+gettime(win: ref Tk->Toplevel)
+{
+ tkcmd(win,".f.fsnap.ftime.l3 configure -text {}"+tkfont);
+ tkcmd(win,".f.fsnap.ftime.l4 configure -text {}"+tkfont);
+ fdi := bufio->open(camerapath+"date",sys->OREAD);
+ if (fdi != nil) {
+ s := fdi.gets('\n');
+ if (s != nil) {
+ if (s[len s - 1] == '\n') s = s[:len s - 1];
+ tm := daytime->local(daytime->now());
+ time := sys->sprint("%d/%d/%d %d:%d:%d", tm.mon+1, tm.mday, tm.year-100,
+ tm.hour,tm.min,tm.sec);
+ ltime = addzeros(time);
+ ctime = addzeros(s[len "date is ":]);
+ tk->cmd(win,".f.fsnap.ftime.l3 configure -text {"+ltime+"}");
+ tk->cmd(win,".f.fsnap.ftime.l4 configure -text {"+ctime+"}");
+ }
+ }
+ if (len ltime < 16)
+ ltime = "??/??/?? ??:??:??";
+ if (len ctime < 16)
+ ctime = "??/??/?? ??:??:??";
+ tkcmd(win, "update");
+}
+
+addzeros(s: string): string
+{
+ s[len s] = ' ';
+ rs := "";
+ start := 0;
+ isnum := 0;
+ for (i := 0; i < len s; i++) {
+ if (s[i] < '0' || s[i] > '9') {
+ if (isnum && i - start < 2) rs[len rs] = '0';
+ rs += s[start:i+1];
+ start = i+1;
+ isnum = 0;
+ }
+ else isnum = 1;
+ }
+ i = len rs - 1;
+ while (i >= 0 && rs[i] == ' ') i--;
+ return rs[:i+1];
+}
+
+samedate(win: ref Tk->Toplevel): int
+{
+ s1 := tkcmd(win, ".f.fsnap.ftime.l3 cget -text");
+ s2 := tkcmd(win, ".f.fsnap.ftime.l4 cget -text");
+ if (s1 == "" || s1 == "") return 0;
+ if (s1[:len s1 - 3] == s2[:len s2 - 3]) return 1;
+ return 0;
+}
+
+settime()
+{
+ tm := daytime->local(daytime->now());
+ fd := sys->open(camerapath+"date", sys->OWRITE);
+ if (fd != nil) {
+ sys->fprint(fd, "%s", addzeros(sys->sprint("%d/%d/%d %d:%d:%d"
+ ,tm.mon+1, tm.mday, tm.year-100, tm.hour,tm.min,tm.sec)));
+ }
+}
+
+getstore(win: ref Tk->Toplevel)
+{
+ fdi := bufio->open(camerapath+"storage",sys->OREAD);
+ if (fdi != nil) {
+ for(i := 0; i < 3; i++) {
+ s := fdi.gets('\n');
+ if (s == nil) break;
+ if (i > 0) {
+ (n,lst) := sys->tokenize(s,"\t\n:");
+ val := string int hd tl lst;
+ if (i == 2 && val == "0")
+ tkcmd(win, ".f.fsnap.b configure -state disabled");
+ else tkcmd(win, ".f.fsnap.b configure -state normal");
+ tkcmd(win,".f.fsnap.fstore.l"+string (2+i)+" configure -text {"+val+" }");
+ }
+ }
+ tkcmd(win, "update");
+ }
+}
+
+contains(s: string, test: string): int
+{
+ num :=0;
+ if (len test > len s) return 0;
+ for (i := 0; i < (1 + (len s) - (len test)); i++) {
+ if (test == s[i:i+len test]) num++;
+ }
+ return num;
+}
+
+multidownload()
+{
+ getpath := selectfile->filename(context,
+ display.image,
+ "Multiple download to directory...",
+ nil,
+ lastpath);
+ if (getpath == "" || getpath[0] != '/' || getpath[len getpath - 1] != '/')
+ return;
+ s := "";
+ for (k := 0; k < nofiles; k++) {
+ if (selected[k]) {
+ e := dnld(k,getpath);
+ if (e != 1)
+ s += filelist[k]+".jpg ";
+ if (e == 3) {
+ s += "cancelled\n";
+ break;
+ }
+ else if (e == 0)
+ s += "failed\n";
+ working = 0;
+ }
+ }
+ if (s != "") s = ":\n\n"+s;
+ dialog("Multiple download complete"+s,0,-1,coords);
+}
+
+downloading := "";
+
+dnld(i: int, path: string): int
+{
+ ctlchan := chan of int;
+ ctlchans := chan of string;
+ chanout := chan of string;
+ spawn downloadscreen(coords, i, ctlchans, chanout);
+ spawn download(i,path,ctlchan, ctlchans, chanout);
+ pid := <-ctlchan;
+ alt {
+ s := <-ctlchans =>
+ chanout <-= "!done!";
+ if (s == "kill") {
+ if (downloading != "") {
+ (n,lst) := sys->tokenize(downloading, " \t\n");
+ for(;lst != nil; lst = tl lst)
+ sys->remove(hd lst);
+ }
+ kill(pid);
+ return 3;
+ }
+ else return dnld(i, "!"+s);
+ e := <-ctlchan =>
+ chanout <-= "!show!";
+ chanout <-= "!done!";
+ return e;
+ }
+ return 0;
+}
+
+filelenrefresh(filename: string): int
+{
+ fd := sys->open(camerapath+"ctl",sys->OWRITE);
+ if (fd != nil) {
+ sys->fprint(fd, "refresh");
+ (n, dir) := sys->stat(filename);
+ if (n == -1)
+ return -1;
+ return int dir.length;
+ }
+ return -1;
+}
+
+testfilesize(filename: string): int
+{
+ e := filelenrefresh(filename);
+ if (e == 0) {
+ e2 := dialog("Camera is still processing image\nwait until ready?",1,-1,coords);
+ if (e2 == 0)
+ return 0;
+ ctlchan := chan of int;
+ spawn waittilready(filename, ctlchan);
+ e3 := <- ctlchan;
+ working = 0;
+ if (e3 == KILLED)
+ return 0;
+ return testfilesize(filename);
+ }
+ else return e;
+}
+
+waittilready(filename: string, ctlchan: chan of int)
+{
+ pid := sys->pctl(0, nil);
+ spawn workingscreen2(coords,pid,ctlchan,0);
+ for (;;) {
+ if (filelenrefresh(filename) != 0)
+ break;
+ sys->sleep(2000);
+ }
+ ctlchan <-= DONE;
+}
+
+download(i: int, path: string, ctlchan: chan of int, ctlchans, chanout: chan of string)
+{
+ ctlchan <-= sys->pctl(0, nil);
+ downloading = "";
+ savename : string;
+ if (path == "") {
+ savename = selectfile->filename(context,
+ display.image,
+ "Save "+filelist[i]+".jpg to directory...",
+ "*.jpg" :: "*.jpeg" :: nil,
+ lastpath);
+ if (savename == "" || savename[0] != '/') {
+ ctlchan <-= 0;
+ return;
+ }
+ }
+ else savename = path;
+
+ # Used when retrying due to cache copy failing
+ if (savename[0] == '!') {
+ delloaded(filelist[i],JPG);
+ savename = savename[1:];
+ path = "";
+ }
+ confirm := 1;
+ # Don't confirm overwrite
+ if (savename[0] == '$') {
+ confirm = 0;
+ savename = savename[1:];
+ }
+
+ if (savename[len savename - 1] == '/')
+ savename += filelist[i]+".jpg";
+
+ if (!hasext(savename, ".jpg"))
+ savename += ".jpg";
+
+ p := isat2(savename,"/");
+ lastpath = savename[:p+1];
+
+ filename := camerapath+"jpg/"+filelist[i]+".jpg";
+ filesize := testfilesize(filename);
+ cached := 0;
+ if (filesize > 0 && isloaded(filelist[i],JPG) && usecache) {
+ cachefilename := tmppath+filelist[i]+"."+string JPG+"~";
+ if (testfilesize(cachefilename) == filesize) {
+ cached = 1;
+ filename = cachefilename;
+ }
+ else delloaded(filelist[i],JPG);
+ }
+ fd := sys->open(filename, sys->OREAD);
+ if (filesize < 1 || fd == nil) {
+ ctlchan <-= -1;
+ return;
+ }
+
+ read := 0;
+ cancel : int;
+ buf : array of byte;
+ fd2, fd3 : ref sys->FD = nil;
+ cachename := tmppath+filelist[i]+"."+string JPG+"~";
+ if (confirm) (fd2, cancel) = create(savename, coords);
+ else fd2 = sys->create(savename,sys->OWRITE, 8r666);
+ if (fd2 == nil) {
+ ctlchan <-= cancel;
+ return;
+ }
+ if (usecache && !cached)
+ fd3 = sys->create(cachename,sys->OWRITE,8r666);
+ chanout <-= "!show!";
+ chanout <-= "l2 Downloading...";
+ chanout <-= "pc 0";
+ n : int;
+ downloading = savename;
+ if (fd3 != nil)
+ downloading += " "+cachename;
+ loop: for(;;) {
+ rlen := 8192;
+ if (read + rlen >= filesize) rlen = filesize - read;
+ buf = array[rlen] of byte;
+ n = sys->read(fd,buf,len buf);
+ read += n;
+ sout := "pc "+string ( (100*read)/filesize);
+ chanout <-= sout;
+ if (n < 1) break loop;
+ written := 0;
+ while (written < n) {
+ n2 := sys->write(fd2,buf,n);
+ if (n2 < 1) break loop;
+ if (fd3 != nil) sys->write(fd3,buf,n);
+ written += n2;
+ }
+ }
+ chanout <-= "pc 100";
+ downloading = "";
+ fd = nil;
+ fd2 = nil;
+ if (read < filesize || n == -1) {
+ if (cached) {
+ ctlchans <-= savename;
+ return;
+ }
+ sys->remove(savename);
+ sys->remove(cachename);
+ if (path == "")
+ dialog(sys->sprint("Download Failed: %s.jpg\nread %d of %d bytes\n",
+ filelist[i],read,filesize), 0, i,coords);
+ ctlchan <-= 0;
+ return;
+ }
+
+ # save it in cache
+ if (usecache)
+ imgloaded = (filelist[i],JPG) :: imgloaded;
+ if (path == "") dialog(filelist[i]+".jpg downloaded",0,i,coords);
+ ctlchan <-= 1;
+}
+
+downloadscr := array[] of {
+ "frame .f -borderwidth 2 -relief raised",
+ "label .f.l1 -text { } @",
+ "label .f.l2 -text {Waiting...} @",
+ "button .f.b -text {Cancel} -command {send ctlchans kill} &",
+ "grid .f.l1 -row 0 -column 0 -columnspan 2 -pady 5",
+ "grid .f.l2 -row 2 -column 1 -sticky w -padx 10",
+ "grid .f.p -row 3 -column 1 -columnspan 1 -padx 10",
+ "grid .f.b -row 4 -column 0 -pady 5 -columnspan 2",
+};
+
+downloadscreen(r: Rect, i: int, ctlchans, chanin: chan of string)
+{
+ working = 1;
+ <- chanin;
+ (top, nil) := tkclient->toplevel(context,"", nil, tkclient->Plain);
+ progr := Rect((0,0),(100,15));
+ imgbg := display.newimage(progr,draw->CMAP8,1,draw->Black);
+ black := display.newimage(progr,draw->CMAP8,1,draw->Black);
+ white := display.newimage(progr,draw->CMAP8,1,draw->White);
+ imgfg := display.newimage(progr,draw->CMAP8,1,draw->Blue);
+ tkcmd(top, "panel .f.p -width 100 -height 15 -bg white -borderwidth 2 - relief raised");
+ tk->putimage(top, ".f.p",imgbg,nil);
+ tk->namechan(top, ctlchans, "ctlchans");
+ for (tk1 := 0; tk1 < len downloadscr; tk1++)
+ tkcmd(top, downloadscr[tk1]);
+ tmpimg : ref Image = nil;
+ if (i >= 0 && isloaded(filelist[i], THUMB) && usecache)
+ tmpimg = display.open(tmppath+filelist[i]+"."+string THUMB+"~");
+ if (tmpimg == nil)
+ tmpimg = procimg;
+ if (tmpimg != nil) {
+ w := tmpimg.r.dx();
+ h := tmpimg.r.dy();
+ tkcmd(top, "panel .f.p2 -width "+string w+" -height "+string h+
+ " -borderwidth 2 -relief raised");
+ tk->putimage(top, ".f.p2", tmpimg, nil);
+ tkcmd(top, "grid .f.p2 -row 2 -column 0 -rowspan 2 -sticky e");
+ tkcmd(top, "grid columnconfigure .f 0 -minsize "+string (w + 14));
+ }
+
+ tkcmd(top, ".f.l1 configure -text {"+filelist[i]+".jpg}");
+ centrewin(top,r,1);
+ oldcoords := coords;
+ tkclient->onscreen(top, "exact");
+ tkclient->startinput(top, "kbd"::"ptr"::nil);
+
+ main: for (;;) {
+ alt {
+ s := <-top.ctxt.kbd =>
+ tk->keyboard(top, s);
+ s := <-top.ctxt.ptr =>
+ tk->pointer(top, *s);
+ text := <-chanin =>
+ if (!oldcoords.eq(coords)) {
+ centrewin(top,coords,0);
+ oldcoords = coords;
+ }
+ if (text == "!done!") break main;
+ if (text[:2] == "pc") {
+ val := int text[3:];
+ imgbg.draw(((0,0),(val,15)), imgfg,nil,(0,0));
+ if (val != 100)
+ imgbg.draw(((val+1,0),(100,15)), black,nil,(0,0));
+ imgbg.text((42,1),white,(0,0),font, text[3:]+"%");
+ tkcmd(top,".f.p dirty; update");
+ }
+ else if (text[:2] == "l2")
+ tkcmd(top, ".f.l2 configure -text {"+text[3:]+"}; update");
+ }
+ }
+ working = 0;
+}
+
+centrewin(top: ref Tk->Toplevel, r: Rect, first: int)
+{
+ s := "";
+ if (first)
+ s = "pack .f;";
+ w := int tkcmd(top, ".f cget -width");
+ h := int tkcmd(top, ".f cget -height");
+ tmp := tk->cmd(top, ".Wm_t cget -height");
+ if (tmp != "" && tmp[0] != '!') {
+ h += int tmp;
+ s += "focus .;";
+ }
+ px := r.min.x + ((r.max.x - r.min.x - w) / 2);
+ py := r.min.y + ((r.max.y - r.min.y - h) / 2);
+ tkcmd(top, ". configure -x "+string px+" -y "+string py);
+ tkcmd(top, s+"raise .; update");
+}
+
+workingscr2 := array[] of {
+ "frame .f -borderwidth 2 -relief raised",
+ "label .f.l3 -text { } -width 220 -height 2",
+ "label .f.l -text {Please Wait} @",
+ "label .f.l2 -text {|} -width 20 @",
+ "button .f.b -text {Cancel} -command {send chanin kill} &",
+ "grid .f.l -row 1 -column 0 -sticky e",
+ "grid .f.l2 -row 1 -column 1 -sticky w",
+ "grid .f.b -pady 5 -row 3 -column 0 -columnspan 2",
+ "grid .f.l3 -row 4 -column 0 -columnspan 2",
+ "grid rowconfigure .f 1 -minsize 80",
+};
+
+workingscreen2(r : Rect, pid: int, ctlchan: chan of int, loading: int)
+{
+ (top, nil) := tkclient->toplevel(context,"",nil, tkclient->Plain);
+ chanin := chan of string;
+ tk->namechan(top, chanin, "chanin");
+ for (tk1 := 0; tk1 < len workingscr2; tk1++)
+ tkcmd(top, workingscr2[tk1]);
+
+ if (loading) {
+# loadimg := display.open("camload.bit");
+ if (loadimg != nil) {
+ w := loadimg.r.dx();
+ h := loadimg.r.dy();
+ tkcmd(top, "panel .f.p -width "+string w+" -height "+string h+
+ " -borderwidth 2 -relief raised");
+ tk->putimage(top, ".f.p", loadimg, nil);
+ tkcmd(top, "grid .f.p -row 2 -column 0 -columnspan 2 -pady 5 -padx 20");
+ tkcmd(top, "grid forget .f.l .f.l2; grid rowconfigure .f 1 -minsize 20");
+ }
+ }
+ else {
+ if (procimg != nil) {
+ w := procimg.r.dx();
+ h := procimg.r.dy();
+ tkcmd(top, "panel .f.p -width "+string w+" -height "+string h+
+ " -borderwidth 2 -relief raised");
+ tk->putimage(top, ".f.p", procimg, nil);
+ tkcmd(top, "grid .f.p -row 2 -column 0 -columnspan 2");
+ tkcmd(top, "grid rowconfigure .f 1 -minsize 30");
+ tkcmd(top, "grid rowconfigure .f 2 -minsize 50");
+ }
+ }
+
+ centrewin(top,r,1);
+ spawn workingupdate(top,chanin);
+ tkclient->onscreen(top, "exact");
+ tkclient->startinput(top, "kbd"::"ptr"::nil);
+
+ main: for (;;) {
+ alt {
+ s := <-top.ctxt.kbd =>
+ tk->keyboard(top, s);
+ s := <-top.ctxt.ptr =>
+ tk->pointer(top, *s);
+ inp := <-chanin =>
+ if (inp == "done") break main;
+ if (inp == "kill") {
+ working = 0;
+ if (pid != -1) kill(pid);
+ ctlchan <-= KILLED;
+ <-chanin;
+ break main;
+ }
+ }
+ }
+}
+
+workingupdate(top: ref Tk->Toplevel, chanout: chan of string)
+{
+ show := array[] of { "/", "-", "\\\\", "|", };
+ if (working) {
+ chanout <-= "done";
+ return;
+ }
+ working = 1;
+ oldcoords := coords;
+ hidden := 0;
+ loop: for(;;) {
+ for (i := 0; i < 4; i++) {
+ sys->sleep(100);
+ tkcmd(top, ".f.l2 configure -text {"+show[i]+"}; update");
+ if (!working) break loop;
+ if (!oldcoords.eq(coords)) {
+ centrewin(top, coords,0);
+ oldcoords = coords;
+ }
+ }
+ }
+ chanout <-= "done";
+}
+
+scrollx := 0;
+scrolly := 0;
+
+resizemain(top: ref Tk->Toplevel, init: int)
+{
+ h, w: int;
+ if (init) {
+ growheight(top, 4000);
+ h = int tkcmd(top, ".f.fsnap cget -height") +
+ int tkcmd(top, ".Wm_t cget -height") +
+ 2 * (124 - (5*(3-ssize)));
+ if (h > display.image.r.dy())
+ h = display.image.r.dy();
+ w = display.image.r.dx();
+ }
+ else {
+ r := tk->rect(top, ".", 0);
+ h = r.dy();
+ w = r.dx();
+ }
+
+ ht := int tkcmd(top, ".Wm_t cget -height");
+
+ hf := int tkcmd(top, ".f cget -height");
+ wf := int tkcmd(top, ".f cget -width");
+ wsb := int tkcmd(top, ".f.f1.sb1 cget -width");
+
+ growwidth(top, w - 4);
+ ws := int tkcmd(top, ".f.fsnap cget -width");
+ if (w > ws + 4)
+ w = ws + 4;
+ shrinkwidth(top,w - 4);
+ ws = int tkcmd(top, ".f.fsnap cget -width");
+ if (w < ws || init)
+ w = ws + 4;
+
+ hmax := ((3*(h - ht))/5) - 4;
+ growheight(top, hmax);
+ shrinkheight(top, hmax);
+ hs := int tkcmd(top, ".f.fsnap cget -height");
+
+ hmb := int tkcmd(top, ".f.fsnap.fsettings.mb cget -height");
+ if (h < ht+hs + 107 + hmb) h = ht+hs+107 + hmb;
+
+# hc2 = int tkcmd(top, ".f.fsnap cget -height");
+ wc2 := int tkcmd(top, ".f.fsnap cget -width");
+
+ hc1 := h - ht - hs - 4;
+ wc1 := w-wsb-4;
+# wc1 = wc2 - wsb;
+ tkcmd(top, ".f.f1.c1 configure -height "+string hc1+" -width "+string wc1);
+# tkcmd(top, ".f.f2.c1 configure -height "+string hc2+" -width "+string wc2);
+ if (w < wc2 + 4)
+ w = wc2 + 4;
+ ws = int tkcmd(top, ".f.fsnap cget -width");
+ hs = int tkcmd(top, ".f.fsnap cget -height");
+
+ tkcmd(top, ". configure -height "+string h+" -width "+string w+"; update");
+ refreshfilelist(top, 0);
+}
+
+growwidth(top: ref Tk->Toplevel, wc2: int)
+{
+ ws := int tkcmd(top, ".f.fsnap cget -width");
+ if (wc2 > ws && reducew[2]) {
+ tkcmd(top, ".f.fsnap.ftime.l1 configure -text {Local:}");
+ tkcmd(top, ".f.fsnap.ftime.l2 configure -text {Camera:}");
+ tkcmd(top, ".f.fsnap.ftime.cb configure -text {Set to local time}");
+ reducew[2] = 0;
+ }
+ ws = int tkcmd(top, ".f.fsnap cget -width");
+ if (wc2 > ws && reducew[1]) {
+ tkcmd(top, ".f.fsnap.ftime.l3 configure -text {"+ltime+"}");
+ tkcmd(top, ".f.fsnap.ftime.l4 configure -text {"+ctime+"}");
+ tkcmd(top, ".f.fsnap.ftime.cb configure -text {Set camera to local time}");
+ reducew[1] = 0;
+ }
+ ws = int tkcmd(top, ".f.fsnap cget -width");
+ if (wc2 > ws && reducew[0]) {
+ tkcmd(top, ".f.fsnap.fstore.l1 configure -text { Photos taken:}");
+ reducew[0] = 0;
+ }
+ ws = int tkcmd(top, ".f.fsnap cget -width");
+ if (wc2 > ws) {
+ wfs += wc2 - ws;
+ if (wfs > 125-(20*(3-ssize))) wfs = 125-(20*(3-ssize));
+ tkcmd(top, "grid columnconfigure .f.fsnap 2 -minsize "+string wfs);
+ }
+}
+
+growheight(top: ref Tk->Toplevel, hc2: int)
+{
+ hs := int tkcmd(top, ".f.fsnap cget -height");
+ if (hc2 > hs) {
+ tk->cmd(top, "grid .f.fsnap.fsettings.mb2 -row 2 -column 0 -sticky ew");
+ tk->cmd(top, "grid .f.fsnap.ftime.cb -row 2 -column 0 -columnspan 2");
+ tk->cmd(top, "grid .f.fsnap.ftime.b -row 3 -column 0 -columnspan 2");
+ }
+ hs = int tkcmd(top, ".f.fsnap cget -height");
+ if (hc2 > hs) {
+ hsc := int tkcmd(top, ".f.fsnap.fzpos.sc cget -height");
+ hsc += hc2 - hs;
+ if (hsc > 88-(10*(3-ssize))) hsc = 88-(10*(3-ssize));
+ tkcmd(top, ".f.fsnap.fzpos.sc configure -height "+string hsc);
+ }
+ hs = int tkcmd(top, ".f.fsnap cget -height");
+ if (hc2 > hs) {
+ hfs += hc2 - hs;
+ if (hfs > 30 - (5*(3-ssize))) hfs = 30- (5*(3-ssize));
+ tkcmd(top, "grid rowconfigure .f.fsnap 0 -minsize "+string hfs);
+ tkcmd(top, "grid rowconfigure .f.fsnap 2 -minsize "+string hfs);
+ tkcmd(top, "grid rowconfigure .f.fsnap 4 -minsize "+string hfs);
+ }
+}
+
+shrinkheight(top: ref Tk->Toplevel, hc2: int)
+{
+ hs := int tkcmd(top, ".f.fsnap cget -height");
+ if (hc2 < hs) {
+ hfs -= hs - hc2;
+ if (hfs < 15) hfs = 15;
+ tkcmd(top, "grid rowconfigure .f.fsnap 0 -minsize "+string hfs);
+ tkcmd(top, "grid rowconfigure .f.fsnap 2 -minsize "+string hfs);
+ tkcmd(top, "grid rowconfigure .f.fsnap 4 -minsize "+string hfs);
+ }
+ hs = int tkcmd(top, ".f.fsnap cget -height");
+ if (hc2 < hs) {
+ hsc := int tkcmd(top, ".f.fsnap.fzpos.sc cget -height");
+ hsc -= hs - hc2;
+ if (hsc < 55-(5*(3-ssize))) hsc = 55-(5*(3-ssize));
+ tkcmd(top, ".f.fsnap.fzpos.sc configure -height "+string hsc);
+ }
+ hs = int tkcmd(top, ".f.fsnap cget -height");
+ if (hc2 < hs) {
+ tk->cmd(top, "grid forget .f.fsnap.fsettings.mb2");
+ tk->cmd(top, "grid forget .f.fsnap.ftime.cb");
+ tk->cmd(top, "grid forget .f.fsnap.ftime.b");
+ }
+}
+
+shrinkwidth(top: ref Tk->Toplevel, wc2: int)
+{
+ ws := int tkcmd(top, ".f.fsnap cget -width");
+ wib := int tkcmd(top, ".f.fsnap.fsettings.b cget -width");
+ if (wc2 < ws) {
+ diff := ws - wc2;
+ wfs -= diff;
+ if (wfs < wib) wfs = wib;
+ tkcmd(top, "grid columnconfigure .f.fsnap 2 -minsize "+string wfs);
+ }
+ ws = int tkcmd(top, ".f.fsnap cget -width");
+ if (wc2 < ws) {
+ tkcmd(top, ".f.fsnap.fstore.l1 configure -text { Taken:}");
+ reducew[0] = 1;
+ }
+ ws = int tkcmd(top, ".f.fsnap cget -width");
+ if (wc2 < ws) {
+ tkcmd(top, ".f.fsnap.ftime.l3 configure -text {"+ltime[len ltime - 8:]+"}");
+ tkcmd(top, ".f.fsnap.ftime.l4 configure -text {"+ctime[len ctime - 8:]+"}");
+ tkcmd(top, ".f.fsnap.ftime.cb configure -text {Set to local time}");
+ reducew[1] = 1;
+ }
+ ws = int tkcmd(top, ".f.fsnap cget -width");
+ if (wc2 < ws) {
+ tkcmd(top, ".f.fsnap.ftime.l1 configure -text {C:}");
+ tkcmd(top, ".f.fsnap.ftime.l2 configure -text {}");
+ tkcmd(top, ".f.fsnap.ftime.l3 configure -text {"+ctime[len ctime - 17:len ctime - 8]+"}");
+ tkcmd(top, ".f.fsnap.ftime.cb configure -text {Set local}");
+ reducew[2] = 1;
+ }
+ ws = int tkcmd(top, ".f.fsnap cget -width");
+ if (wc2 > ws) {
+ wfs = 125-(20*(3-ssize));
+ tkcmd(top, "grid columnconfigure .f.fsnap 2 -minsize "+string wfs);
+ }
+}
+
+ltime, ctime: string;
+wfs := 150;
+hfs := 30;
+reducew := array[10] of { * => 0 };
+
+getcoords(top: ref Tk->Toplevel): Rect
+{
+ h := int tkcmd(top, ". cget -height");
+ w := int tkcmd(top, ". cget -width");
+ x := int tkcmd(top, ". cget -actx");
+ y := int tkcmd(top, ". cget -acty");
+ r := Rect((x,y),(x+w,y+h));
+ return r;
+}
+
+viewscr := array[] of {
+ "frame .f -bg",
+ "canvas .f.c -yscrollcommand {.f.sy set} -xscrollcommand {.f.sx set} -height 300 -width 500",
+ "scrollbar .f.sx -command {.f.c xview} -orient horizontal",
+ "scrollbar .f.sy -command {.f.c yview}",
+ "grid .f.c -row 0 -column 0",
+ "grid .f.sy -row 0 -column 1 -sticky ns",
+ "grid .f.sx -row 1 -column 0 -sticky ew",
+ "bind .Wm_t <ButtonPress-1> +{focus .}",
+ "bind .Wm_t.title <ButtonPress-1> +{focus .}",
+ "pack propagate . 0",
+ "menu .m @",
+ ".m add command -text {Save As...}",
+ ".m add separator",
+ ".m add command -text {bit} -command {send butchan save bit}",
+ ".m add command -text {jpeg} -command {send butchan save jpg}",
+
+};
+
+resizeview(top: ref Tk->Toplevel, wp,hp: int)
+{
+ w := int tkcmd(top, ". cget -width");
+ h := int tkcmd(top, ". cget -height");
+ hs := int tkcmd(top, ".f.sx cget -height");
+ ws := int tkcmd(top, ".f.sy cget -width");
+ ht := int tkcmd(top, ".Wm_t cget -height");
+ wc := w - ws - 4;
+ hc := h - hs - ht - 6;
+ wpc := wc - wp;
+ hpc := hc - hp;
+ if (wpc > 0) {
+ wc -= wpc;
+ w -= wpc;
+ }
+ if (hpc > 0) {
+ hc -= hpc;
+ h -= hpc;
+ }
+ tkcmd(top, ". configure -height "+string h+" -width "+string w);
+ tkcmd(top, ".f.c configure -height "+string hc+" -width "+string wc);
+ tkcmd(top, "update");
+}
+
+multiview()
+{
+ s := "";
+ for (k := 0; k < nofiles; k++) {
+ if (selected[k]) {
+ e := vw(k);
+ if (e != 0)
+ s += filelist[k]+".jpg ";
+ if (e == 3) {
+ s += "cancelled\n";
+ break;
+ }
+ else if (e == -1)
+ s += "failed\n";
+ }
+ }
+ if (s != "")
+ dialog("Multiple view complete:\n\n"+s,0,-1,coords);
+}
+
+vw(i: int): int
+{
+ # raise window if it is already open
+ low := toplevels;
+ for(; low != nil; low = tl low) {
+ (tplvl, name, nil, nil) := hd low;
+ if (filelist[i]+".jpg" == name) {
+ tkcmd(tplvl, "raise .; focus .; update");
+ return 0;
+ }
+ }
+
+ ctlchan := chan of int;
+ ctlchans := chan of string;
+ chanout := chan of string;
+ chanin := chan of string;
+ spawn downloadscreen(coords, i, ctlchans, chanout);
+ chanout <-= "!show!";
+ spawn view(i,ctlchan, chanin, chanout);
+ pid := <-ctlchan;
+ killed := 0;
+ for (;;) alt {
+ s := <-ctlchans =>
+ if (s == "kill") {
+ chanin <-= "kill";
+ killed = 1;
+ }
+ e := <-ctlchan =>
+ chanout <-= "!done!";
+ if (killed)
+ return 3;
+ if (e == -1)
+ dialog(sys->sprint("Cannot read file: %s.jpg\n%r",filelist[i]),0,i,coords);
+ if (e == -2) return vw(i);
+ else return e;
+ }
+ return 0;
+}
+
+view(i: int, ctlchan: chan of int, chanin, chanout: chan of string)
+{
+ ctlchan <-= sys->pctl(0, nil);
+ titlename := filelist[i]+".jpg";
+
+ filename := camerapath+"jpg/"+filelist[i]+".jpg";
+ filesize := testfilesize(filename);
+ cached := 0;
+ if (filesize > 0 && isloaded(filelist[i],JPG) && usecache) {
+ cachefilename := tmppath+filelist[i]+"."+string JPG+"~";
+ if (testfilesize(cachefilename) == filesize) {
+ cached = 1;
+ filename = cachefilename;
+ }
+ else delloaded(filelist[i],JPG);
+ }
+ if (filesize < 1) {
+ ctlchan <-= -1;
+ return;
+ }
+
+ img: ref Image;
+ cachepath := "";
+ if (!cached && usecache)
+ cachepath = tmppath+filelist[i]+"."+string JPG+"~";
+ img = readjpg->jpg2img(filename, cachepath, chanin, chanout);
+ if(img == nil) {
+ if (cachepath != nil)
+ sys->remove(cachepath);
+ if (!cached)
+ ctlchan <-= -1;
+ else {
+ delloaded(filelist[i], JPG);
+ ctlchan <-= -2;
+ }
+ return;
+ }
+ else {
+ chanout <-= "l2 Displaying";
+ if (cachepath != "")
+ imgloaded = (filelist[i], JPG) :: imgloaded;
+ (t, titlechan) := tkclient->toplevel(context, "", titlename, Tkclient->Appl);
+ butchan := chan of string;
+ tk->namechan(t, butchan, "butchan");
+ tkcmd(t, "focus .Wm_t; update");
+ for (tk1 := 0; tk1 < len viewscr; tk1++)
+ tkcmd(t, viewscr[tk1]);
+ w := img.r.dx();
+ h := img.r.dy();
+ tkcmd(t, "panel .p -width "+string w+" -height "+string h);
+ tk->putimage(t, ".p",img,nil);
+ tkcmd(t, "bind .p <ButtonPress-2> {send butchan move %X %Y}");
+ tkcmd(t, "bind .p <ButtonRelease-2> {send butchan release}");
+ tkcmd(t, "bind .p <ButtonPress-3> {send butchan menu %X %Y}");
+ tkcmd(t, ".f.c create window 0 0 -window .p -anchor nw");
+ tkcmd(t, ".f.c configure -scrollregion {0 0 "+string w+" "+string h+"}");
+ ctlchan <-= 0;
+ addtoplevel(t,titlename,nil, sys->pctl(0,nil));
+
+ h1 := 300;
+ w1 := 500;
+ ht := int tkcmd(t, ".Wm_t cget -height");
+ if (h1 > display.image.r.dy() - ht) h1 = display.image.r.dy() - ht;
+ if (w1 > display.image.r.dx()) w1 = display.image.r.dx();
+ tkcmd(t, ". configure -width "+string w1+" -height "+string h1);
+ resizeview(t,w,h);
+ tkcmd(t, "pack .f; update");
+ scrolling := 0;
+ origin := Point (0,0);
+ tkclient->onscreen(t, nil);
+ tkclient->startinput(t, "kbd"::"ptr"::nil);
+
+ loop: for(;;) alt{
+ s := <-t.ctxt.kbd =>
+ tk->keyboard(t, s);
+ s := <-t.ctxt.ptr =>
+ tk->pointer(t, *s);
+ inp := <- butchan =>
+ (n, lst) := sys->tokenize(inp, " \t\n");
+ case hd lst {
+ "save" =>
+ ftype := "."+hd tl lst;
+ savename := selectfile->filename(context,
+ display.image,
+ "Save "+filelist[i]+ftype+" to directory...",
+ "*"+ftype :: nil,
+ lastpath);
+ if (savename != "" && savename[0] == '/') {
+ lastpath = savename[:isat2(savename,"/")+1];
+ if (savename[len savename - 1] == '/')
+ savename += filelist[i]+ftype;
+
+ if (!hasext(savename, ftype))
+ savename += ftype;
+ (fd, cancel) := create(savename, getcoords(t));
+ if (fd != nil) {
+ n2 := -1;
+ if (ftype == ".bit")
+ n2 = display.writeimage(fd,img);
+ if (ftype == ".jpg")
+ n2 = 1 - dnld(i, "$"+savename);
+ if (n2 == 0) {
+ dialog(filelist[i]+ftype+" saved",0,i,getcoords(t));
+ break;
+ }
+ dialog("Could not save: "+filelist[i]+ftype,0,i,getcoords(t));
+ }
+ if (!cancel)
+ dialog("Could not save: "+filelist[i]+ftype,0,i,getcoords(t));
+ break;
+ }
+
+ "menu" =>
+ tkcmd(t, ".m post "+hd tl lst+" "+hd tl tl lst);
+ "release" =>
+ scrolling = 0;
+ "move" =>
+ newpoint := Point (int hd tl lst, int hd tl tl lst);
+
+ if (scrolling) {
+ diff := (origin.sub(newpoint)).mul(2);
+ tkcmd(t, ".f.c xview scroll "+string diff.x+" units");
+ tkcmd(t, ".f.c yview scroll "+string diff.y+" units");
+ origin = newpoint;
+ # clearbuffer(butchan);
+ }
+ else {
+ origin = newpoint;
+ scrolling = 1;
+ }
+ }
+
+ s := <-t.ctxt.ctl or
+ s = <-t.wreq or
+ s = <-titlechan =>
+ if (s == "exit")
+ break loop;
+ e := tkclient->wmctl(t, s);
+ if (e == nil && s[0] == '!')
+ resizeview(t,w,h);
+ }
+ deltoplevel(t);
+ }
+}
+
+create(filename: string, co: Rect): (ref sys->FD, int)
+{
+ (n,dir) := sys->stat(filename);
+ if (n != -1 && !dialog("overwrite "+filename+"?",1,-1,co))
+ return (nil,1);
+ return (sys->create(filename,sys->OWRITE,8r666), 0);
+}
+
+hasext(name,ext: string): int
+{
+ if (len name >= len ext && name[len name - len ext:] == ext)
+ return 1;
+ return 0;
+}
diff --git a/appl/demo/camera/tkinterface.dis b/appl/demo/camera/tkinterface.dis
new file mode 100644
index 00000000..6306a8c1
--- /dev/null
+++ b/appl/demo/camera/tkinterface.dis
Binary files differ
diff --git a/appl/demo/camera/tkinterface.sbl b/appl/demo/camera/tkinterface.sbl
new file mode 100644
index 00000000..cc150fdc
--- /dev/null
+++ b/appl/demo/camera/tkinterface.sbl
@@ -0,0 +1,7950 @@
+limbo .sbl 2.1
+tkinterface
+11
+tkinterface.b
+tk.m
+tkclient.m
+sys.m
+daytime.m
+readdir.m
+bufio.m
+selectfile.m
+string.m
+draw.m
+readjpg.m
+6733
+58.1,23 0
+59.1,15 1
+61.1,25 2
+65.1,31 3
+66.1,37 4
+67.1,37 5
+68.1,31 6
+70.1,31 7
+71.1,28 8
+73.1,22 9
+74.1,40 10
+75.1,17 11
+1,17 11
+76.1,46 12
+77.1,19 13
+1,19 13
+1,19 13
+1,19 14
+78.1,37 15
+79.1,23 16
+15,22 16
+1,23 16
+80.1,66 17
+24,31 17
+33,65 17
+1,66 17
+1,66 17
+81.1,19 18
+82.1,24 19
+12,19 19
+20,23 19
+1,24 19
+1,24 19
+83.21,24 20
+12,19 20
+1,25 20
+84.1,15 21
+85.8,19 22
+86.6,22 23
+26,35 23
+26,38 23
+26,38 24
+26,45 23
+47,67 25
+87.6,13 26
+6,26 26
+6,26 27
+28,40 28
+88.2,16 29
+2,16 29
+90.5,21 30
+91.2,19 31
+92.5,21 32
+36,50 32
+36,54 32
+25,55 32
+25,62 32
+93.13,27 33
+2,34 33
+95.6,19 34
+1,21 34
+1,21 35
+97.5,11 36
+5,6 36
+5,11 36
+5,11 36
+5,17 36
+21,27 36
+21,22 36
+21,27 36
+21,27 36
+21,33 36
+35,44 37
+98.12,18 38
+12,13 38
+12,18 38
+12,18 38
+20,26 38
+20,21 38
+20,26 38
+20,26 38
+100.5,15 39
+101.2,42 40
+102.2,42 41
+103.2,40 42
+2,40 43
+105.10,20 44
+106.2,43 45
+107.2,43 46
+108.2,40 47
+2,40 48
+111.2,44 49
+112.2,44 50
+113.2,40 51
+115.5,24 52
+16,22 52
+5,24 52
+5,24 52
+5,33 52
+116.2,13 53
+2,13 54
+117.6,33 55
+118.5,25 56
+16,23 56
+5,25 56
+5,25 56
+5,34 56
+119.2,14 57
+2,14 58
+120.6,35 59
+121.5,25 60
+16,23 60
+5,25 60
+5,25 60
+5,34 60
+122.2,14 61
+2,14 62
+123.6,35 63
+125.1,38 64
+11,18 64
+24,37 64
+1,38 64
+1,38 64
+126.1,38 65
+11,18 65
+24,37 65
+1,38 65
+1,38 65
+128.1,16 66
+1,16 66
+129.0,1 67
+216.1,8 68
+217.7,11 69
+7,20 69
+7,20 70
+24,28 69
+24,39 69
+24,39 71
+43,47 69
+43,54 69
+43,54 72
+218.7,11 73
+7,17 73
+2,17 73
+2,17 74
+219.2,10 75
+2,10 75
+221.10,15 76
+10,19 76
+8,20 76
+8,27 76
+33,38 76
+33,42 76
+31,43 76
+31,51 76
+222.9,14 77
+9,17 77
+2,18 77
+2,18 77
+223.1,11 78
+224.8,9 79
+1,9 79
+232.1,14 80
+233.1,32 81
+234.1,56 82
+19,41 82
+43,55 82
+1,56 82
+1,56 82
+235.5,18 83
+236.2,58 84
+19,43 84
+45,57 84
+2,58 84
+2,58 84
+237.1,7 85
+239.2,11 86
+240.2,20 87
+7,9 87
+15,19 87
+2,20 87
+2,20 87
+241.6,13 88
+6,13 89
+6,13 90
+15,20 91
+242.14,40 92
+28,29 92
+30,39 92
+14,40 92
+14,40 92
+3,4 92
+6,9 92
+6,9 93
+243.2,14 94
+2,25 94
+244.2,14 95
+2,24 95
+245.6,16 96
+24,30 96
+20,30 96
+20,30 97
+20,35 96
+246.3,15 98
+3,30 98
+247.3,24 99
+17,23 99
+3,24 99
+3,24 99
+248.3,15 100
+3,29 100
+249.10,16 101
+7,16 101
+7,27 101
+7,27 102
+250.4,16 103
+4,29 103
+251.4,16 104
+43,49 104
+40,49 104
+37,49 104
+34,49 104
+31,49 104
+4,49 104
+4,49 105
+252.25,31 106
+22,31 106
+19,31 106
+4,31 106
+4,31 107
+253.9,15 108
+17,28 109
+254.5,22 110
+9,11 110
+17,21 110
+5,22 110
+5,22 110
+255.19,44 111
+33,34 111
+35,43 111
+19,44 111
+19,44 111
+256.5,20 112
+257.19,26 113
+16,26 113
+5,26 113
+5,26 114
+258.9,15 115
+259.10,22 116
+10,38 116
+260.7,19 117
+7,33 117
+7,33 118
+261.15,27 119
+15,43 119
+262.7,19 120
+7,33 120
+264.16,28 121
+9,36 121
+40,51 121
+53,65 122
+265.5,17 123
+26,30 123
+32,35 123
+40,52 123
+40,57 123
+5,57 123
+5,57 123
+5,57 124
+5,57 125
+5,57 126
+5,57 127
+5,57 128
+253.30,33 129
+30,33 129
+267.8,19 130
+268.16,28 131
+16,33 131
+39,51 131
+35,57 131
+35,60 131
+35,60 132
+5,72 131
+5,72 133
+5,72 134
+269.5,13 135
+5,13 136
+272.15,21 137
+12,21 137
+12,30 137
+12,30 138
+273.4,16 139
+4,31 139
+274.4,16 140
+49,55 140
+46,55 140
+43,55 140
+40,55 140
+37,55 140
+34,55 140
+31,55 140
+4,55 140
+4,55 141
+275.21,27 142
+18,27 142
+15,27 142
+4,27 142
+4,27 143
+276.27,33 144
+24,33 144
+21,33 144
+18,33 144
+15,33 144
+4,33 144
+4,33 145
+277.4,12 146
+278.11,23 147
+279.5,14 148
+280.5,14 149
+281.5,14 150
+5,14 150
+283.4,16 151
+25,30 151
+32,35 151
+40,52 151
+40,57 151
+4,57 151
+4,57 151
+4,57 152
+4,57 153
+284.4,16 154
+25,30 154
+32,35 154
+40,52 154
+40,57 154
+4,57 154
+4,57 154
+4,57 155
+4,57 156
+285.4,16 157
+25,30 157
+32,35 157
+40,52 157
+40,57 157
+4,57 157
+4,57 157
+4,57 158
+4,57 159
+4,57 160
+288.15,27 161
+15,32 161
+33,52 161
+45,51 161
+33,52 161
+33,52 161
+4,64 161
+4,64 162
+4,64 163
+289.4,12 164
+291.7,11 165
+292.4,16 165
+4,38 165
+293.4,16 165
+4,38 165
+294.4,16 165
+4,36 165
+295.4,39 165
+13,25 165
+13,30 165
+31,38 165
+4,39 165
+4,39 165
+4,39 165
+296.4,39 165
+13,25 165
+13,30 165
+31,38 165
+4,39 165
+4,39 165
+4,39 165
+297.4,39 165
+13,25 165
+13,30 165
+31,38 165
+4,39 165
+4,39 165
+4,39 165
+298.4,40 165
+13,25 165
+13,30 165
+31,39 165
+4,40 165
+4,40 165
+4,40 165
+299.4,39 165
+13,25 165
+13,30 165
+31,38 165
+4,39 165
+4,39 165
+4,39 165
+300.4,43 165
+13,25 165
+13,30 165
+31,42 165
+4,43 165
+4,43 165
+4,43 165
+301.4,39 165
+13,25 165
+13,30 165
+31,38 165
+4,39 165
+4,39 165
+4,39 165
+302.4,39 165
+13,25 165
+13,30 165
+31,38 165
+4,39 165
+4,39 165
+4,39 165
+303.4,39 165
+13,25 165
+13,30 165
+31,38 165
+4,39 165
+4,39 165
+4,39 165
+304.5,8 166
+305.3,6 167
+3,6 168
+3,6 169
+3,6 169
+308.1,16 170
+309.0,1 171
+313.1,10 172
+314.16,21 173
+5,13 173
+5,21 173
+30,32 174
+23,32 174
+315.6,12 175
+23,30 176
+19,30 176
+33,43 176
+18,44 176
+14,44 176
+316.6,15 177
+33,41 177
+31,41 177
+27,28 177
+27,42 177
+19,42 177
+19,42 178
+44,51 179
+315.46,49 180
+46,49 180
+318.8,11 181
+1,11 181
+323.1,10 182
+324.16,21 183
+5,13 183
+5,21 183
+30,32 184
+23,32 184
+325.11,16 185
+19,27 185
+6,27 185
+29,35 186
+326.6,15 187
+33,41 187
+31,41 187
+27,28 187
+27,42 187
+19,42 187
+19,42 188
+44,51 189
+325.37,40 190
+37,40 190
+328.8,11 191
+1,11 191
+334.1,7 192
+335.6,12 193
+14,29 194
+336.10,22 195
+2,27 195
+337.15,23 196
+6,11 196
+6,23 196
+33,38 196
+27,31 196
+27,39 196
+27,44 196
+27,44 197
+46,49 198
+46,49 199
+335.31,34 200
+31,34 200
+339.8,9 201
+1,9 201
+344.14,20 202
+5,11 202
+5,20 202
+29,30 203
+22,30 203
+345.9,15 204
+5,7 204
+5,16 204
+5,22 204
+5,22 205
+31,32 206
+24,32 206
+346.8,9 207
+1,9 207
+351.1,14 208
+352.10,11 209
+1,15 209
+354.6,23 210
+25,30 211
+355.6,25 212
+16,24 212
+6,25 212
+6,25 212
+6,31 212
+40,48 213
+33,48 213
+356.2,26 214
+13,21 214
+22,25 214
+2,26 214
+2,26 214
+357.10,19 215
+6,19 215
+21,26 216
+358.2,25 217
+2,25 217
+360.8,13 218
+1,13 218
+366.1,10 219
+367.6,12 220
+14,29 221
+368.2,8 222
+369.2,9 223
+372.3,10 224
+373.3,14 225
+374.10,21 226
+375.8,43 227
+16,28 227
+16,33 227
+35,42 227
+8,43 227
+8,43 227
+8,43 227
+45,51 228
+376.4,18 229
+4,18 229
+378.7,14 230
+7,14 231
+7,14 232
+16,21 233
+379.3,10 234
+380.10,22 235
+3,31 235
+10,27 235
+3,31 235
+381.3,22 236
+13,16 236
+18,21 236
+3,22 236
+3,22 236
+382.7,15 237
+17,29 238
+17,29 239
+383.8,12 240
+384.3,43 241
+18,30 241
+37,41 241
+18,35 241
+18,42 241
+3,43 241
+3,43 241
+385.7,14 242
+7,14 243
+7,14 244
+16,21 245
+16,21 246
+16,21 247
+16,21 247
+387.6,12 248
+388.3,55 249
+28,30 249
+32,44 249
+32,49 249
+50,54 249
+3,55 249
+3,55 249
+389.3,24 250
+3,24 251
+367.31,34 252
+31,34 252
+392.13,20 253
+1,31 253
+393.10,16 254
+6,20 254
+22,28 255
+394.2,7 256
+2,16 256
+395.2,14 257
+393.30,33 258
+30,33 258
+397.8,10 259
+1,10 259
+402.1,23 260
+1,23 260
+1,23 260
+403.1,94 261
+7,10 261
+12,93 261
+1,94 261
+1,94 261
+1,94 262
+404.1,80 263
+7,10 263
+12,79 263
+1,80 263
+1,80 263
+1,80 264
+405.6,12 265
+18,29 266
+14,29 266
+406.10,20 267
+6,20 267
+6,24 267
+29,39 267
+29,39 267
+29,43 267
+29,53 267
+29,53 268
+57,67 267
+57,67 267
+57,71 267
+57,82 267
+57,82 269
+407.4,40 270
+24,27 270
+28,29 270
+30,39 270
+4,40 270
+4,40 271
+409.3,410.50 272
+409.9,12 272
+39,49 272
+14,49 272
+14,410.36 272
+37,45 272
+409.14,410.45 272
+409.14,410.45 273
+409.14,410.49 272
+409.14,410.49 274
+409.3,410.50 272
+409.3,410.50 272
+409.3,410.50 275
+405.31,34 276
+31,34 276
+412.1,35 277
+7,10 277
+12,34 277
+1,35 277
+1,35 277
+1,35 278
+413.1,64 279
+7,10 279
+12,63 279
+1,64 279
+1,64 279
+1,64 280
+414.1,36 281
+7,10 281
+12,35 281
+1,36 281
+1,36 281
+1,36 282
+415.6,18 283
+24,32 284
+20,32 284
+416.3,417.30 285
+416.9,12 285
+44,51 285
+14,56 285
+14,61 285
+14,61 286
+3,417.30 285
+416.3,417.30 285
+416.3,417.30 287
+415.34,37 288
+34,37 288
+419.0,1 289
+423.14,35 290
+24,34 290
+24,34 290
+14,35 290
+14,35 290
+1,35 290
+424.1,12 291
+425.6,12 292
+14,29 293
+426.6,43 294
+14,26 294
+14,31 294
+32,42 294
+32,42 294
+6,43 294
+6,43 294
+6,43 294
+429.8,20 295
+8,26 295
+431.26,38 296
+5,44 296
+432.5,64 297
+11,14 297
+16,30 297
+16,63 297
+16,63 298
+5,64 297
+5,64 297
+5,64 299
+5,64 295
+434.5,17 300
+435.9,20 301
+436.6,32 302
+12,15 302
+17,31 302
+6,32 302
+6,32 302
+6,32 303
+437.6,68 304
+12,15 304
+17,31 304
+17,44 304
+45,55 304
+17,55 304
+17,59 304
+17,67 304
+17,67 305
+6,68 304
+6,68 304
+6,68 306
+438.6,69 307
+12,15 307
+17,30 307
+17,65 307
+17,68 307
+17,68 308
+6,69 307
+6,69 307
+6,69 309
+440.13,25 310
+26,39 310
+5,39 310
+5,39 311
+5,39 312
+441.5,64 313
+11,14 313
+16,30 313
+16,63 313
+16,63 314
+5,64 313
+5,64 313
+5,64 315
+442.5,80 316
+11,14 316
+16,29 316
+16,48 316
+49,62 316
+16,62 316
+16,62 317
+16,79 316
+16,79 318
+5,80 316
+5,80 316
+5,80 319
+443.5,43 320
+19,31 320
+19,36 320
+37,42 320
+5,43 320
+5,43 320
+444.10,22 321
+5,44 321
+32,42 321
+28,42 321
+10,27 321
+5,44 321
+445.9,17 322
+21,33 322
+21,49 322
+446.17,27 323
+11,27 323
+11,31 323
+6,31 323
+6,31 324
+447.5,57 325
+11,14 325
+16,30 325
+16,43 325
+16,45 325
+16,49 325
+16,56 325
+16,56 326
+5,57 325
+5,57 325
+5,57 327
+448.5,63 328
+11,14 328
+16,29 328
+16,62 328
+16,62 329
+5,63 328
+5,63 328
+5,63 330
+5,63 331
+5,63 295
+451.7,19 332
+7,35 332
+452.4,16 333
+4,39 333
+453.4,42 334
+18,30 334
+18,35 334
+36,41 334
+4,42 334
+4,42 334
+454.4,42 335
+18,30 335
+18,35 335
+36,41 335
+4,42 335
+4,42 335
+455.15,82 336
+27,59 336
+61,66 336
+67,70 336
+71,74 336
+75,81 336
+15,82 336
+15,82 336
+4,83 336
+10,13 336
+10,13 336
+10,13 337
+4,83 336
+4,83 336
+4,83 338
+456.4,457.51 339
+456.10,13 339
+15,28 339
+15,57 339
+15,457.12 339
+456.15,457.27 339
+30,38 339
+456.15,457.38 339
+456.15,457.38 340
+456.15,457.50 339
+456.15,457.50 341
+456.4,457.51 339
+456.4,457.51 339
+456.4,457.51 342
+458.4,52 343
+10,13 343
+15,28 343
+15,51 343
+15,51 344
+4,52 343
+4,52 343
+4,52 345
+4,52 346
+460.12,24 347
+12,38 347
+461.4,37 348
+10,13 348
+15,29 348
+15,36 348
+15,36 349
+4,37 348
+4,37 348
+4,37 350
+462.4,53 351
+10,13 351
+15,28 351
+15,52 351
+15,52 352
+4,53 351
+4,53 351
+4,53 353
+463.11,23 354
+4,28 354
+464.4,12 355
+465.11,21 356
+466.20,26 357
+467.5,162 358
+22,96 358
+97,102 358
+103,106 358
+107,111 358
+112,115 358
+116,128 358
+116,134 358
+143,152 358
+140,153 358
+135,153 358
+155,161 358
+5,162 358
+5,162 358
+468.5,17 359
+11,14 359
+15,16 359
+5,17 359
+5,17 359
+5,17 360
+469.16,470.20 361
+469.28,74 361
+470.6,11 361
+12,15 361
+16,19 361
+469.16,470.20 361
+469.16,470.20 361
+469.5,470.21 361
+469.11,14 361
+11,14 361
+11,14 362
+5,470.21 361
+469.5,470.21 361
+469.5,470.21 363
+471.5,17 364
+472.5,10 365
+5,10 366
+5,10 367
+5,10 367
+5,10 368
+475.3,476.59 369
+475.9,12 369
+14,29 369
+14,57 369
+14,476.20 369
+475.14,476.28 369
+29,37 369
+475.14,476.37 369
+475.14,476.37 370
+475.14,476.41 369
+475.14,476.51 369
+475.14,476.58 369
+475.14,476.58 371
+475.3,476.59 369
+475.3,476.59 369
+475.3,476.59 372
+477.3,62 373
+9,12 373
+14,27 373
+14,61 373
+14,61 374
+3,62 373
+3,62 373
+3,62 375
+478.7,19 376
+7,35 376
+479.4,480.63 377
+479.10,13 377
+15,30 377
+15,62 377
+15,480.21 377
+479.15,480.32 377
+33,41 377
+479.15,480.41 377
+479.15,480.41 378
+479.15,480.45 377
+479.15,480.55 377
+479.15,480.62 377
+479.15,480.62 379
+479.4,480.63 377
+479.4,480.63 377
+479.4,480.63 380
+481.4,63 381
+10,13 381
+15,28 381
+15,62 381
+15,62 382
+4,63 381
+4,63 381
+4,63 383
+483.3,11 384
+3,11 385
+425.31,34 386
+31,34 386
+486.0,1 387
+513.13,20 388
+12,26 388
+1,26 388
+514.13,20 389
+12,26 389
+1,26 389
+515.15,82 390
+34,41 390
+43,50 390
+43,57 390
+43,59 390
+43,59 391
+61,64 390
+66,81 390
+15,82 390
+15,82 390
+2,5 390
+2,5 392
+2,5 393
+516.1,25 394
+517.1,36 395
+14,17 395
+19,25 395
+27,35 395
+1,36 395
+1,36 395
+1,36 396
+518.6,14 397
+22,37 398
+16,37 398
+519.2,30 399
+8,11 399
+13,29 399
+13,29 399
+2,30 399
+2,30 399
+2,30 400
+518.39,44 401
+39,44 401
+520.1,33 402
+20,23 402
+25,32 402
+1,33 402
+521.1,45 403
+22,25 403
+41,44 403
+34,44 403
+27,44 403
+27,44 403
+27,44 404
+1,45 403
+524.9,17 405
+9,21 405
+9,21 406
+9,21 405
+526.9,17 405
+9,21 405
+9,21 407
+9,21 405
+528.12,18 405
+12,18 405
+523.2,8 405
+2,8 405
+2,8 405
+2,8 405
+525.3,23 408
+16,19 408
+21,22 408
+3,23 408
+3,23 405
+527.3,23 409
+15,18 409
+20,22 409
+3,23 409
+3,23 410
+3,23 405
+529.7,18 411
+31,54 412
+37,40 412
+42,53 412
+31,54 412
+31,54 412
+27,54 412
+27,54 413
+20,54 412
+530.12,27 414
+36,38 415
+29,38 415
+531.12,15 416
+12,19 416
+12,28 416
+12,28 417
+532.4,12 418
+533.15,22 419
+15,18 419
+15,22 419
+11,22 419
+11,22 420
+4,22 419
+534.8,12 421
+8,20 421
+33,56 422
+39,42 422
+44,55 422
+33,56 422
+33,56 422
+29,56 422
+29,56 423
+22,56 422
+535.8,12 424
+8,19 424
+23,27 424
+23,34 424
+536.5,50 425
+11,14 425
+16,49 425
+5,50 425
+5,50 425
+5,50 426
+537.5,54 427
+11,14 427
+16,41 427
+16,53 427
+16,53 428
+5,54 427
+5,54 427
+5,54 429
+5,54 430
+5,54 431
+5,54 405
+546.20,82 432
+39,46 432
+48,50 432
+52,65 432
+67,81 432
+20,82 432
+20,82 432
+547.1,15 433
+548.1,23 434
+7,10 434
+12,22 434
+1,23 434
+1,23 434
+1,23 435
+549.1,45 436
+7,10 436
+12,44 436
+1,45 436
+1,45 436
+1,45 437
+550.1,55 438
+7,10 438
+12,54 438
+1,55 438
+1,55 438
+1,55 439
+551.1,59 440
+7,10 440
+12,58 440
+1,59 440
+1,59 440
+1,59 441
+552.1,28 442
+7,10 442
+12,27 442
+1,28 442
+1,28 442
+1,28 443
+553.1,12 444
+554.8,18 445
+555.2,10 446
+556.2,20 447
+557.13,19 448
+558.2,53 449
+8,11 449
+13,33 449
+13,45 449
+13,48 449
+13,52 449
+13,52 450
+2,53 449
+2,53 449
+2,53 451
+559.2,53 452
+8,11 452
+13,33 452
+13,45 452
+13,48 452
+13,52 452
+13,52 453
+2,53 452
+2,53 452
+2,53 454
+560.2,68 455
+8,11 455
+13,32 455
+13,42 455
+13,44 455
+13,67 455
+13,67 456
+2,68 455
+2,68 455
+2,68 457
+561.2,68 458
+8,11 458
+13,32 458
+13,42 458
+13,44 458
+13,67 458
+13,67 459
+2,68 458
+2,68 458
+2,68 460
+562.2,14 461
+2,14 462
+2,14 463
+2,14 464
+2,14 465
+2,14 465
+564.1,30 466
+7,10 466
+12,29 466
+1,30 466
+1,30 466
+1,30 467
+565.1,29 468
+20,23 468
+25,28 468
+1,29 468
+566.1,45 469
+22,25 469
+41,44 469
+34,44 469
+27,44 469
+27,44 469
+27,44 470
+1,45 469
+569.9,17 471
+9,21 471
+9,21 472
+9,21 471
+571.9,17 471
+9,21 471
+9,21 473
+9,21 471
+573.13,21 471
+13,25 471
+13,25 474
+13,25 471
+574.12,20 471
+12,20 471
+575.13,21 471
+13,21 471
+568.2,8 471
+2,8 471
+2,8 471
+2,8 471
+570.3,23 475
+16,19 475
+21,22 475
+3,23 475
+3,23 471
+572.3,23 476
+15,18 476
+20,22 476
+3,23 476
+3,23 477
+3,23 471
+3,23 471
+3,23 471
+576.7,22 478
+7,22 479
+580.0,1 480
+577.3,30 481
+19,22 481
+24,29 481
+3,30 481
+3,30 481
+3,30 482
+3,30 483
+3,30 471
+584.1,17 484
+585.7,17 485
+586.28,34 486
+3,8 486
+10,14 486
+10,14 487
+10,14 488
+10,14 489
+587.14,24 490
+6,24 490
+588.3,43 491
+9,14 491
+16,42 491
+3,43 491
+3,43 491
+3,43 492
+589.3,19 493
+590.3,9 494
+3,9 495
+3,9 496
+585.19,31 497
+19,31 497
+593.1,25 498
+18,19 498
+21,24 498
+1,25 498
+1,25 498
+594.20,77 499
+39,46 499
+48,50 499
+52,60 499
+62,76 499
+20,77 499
+20,77 499
+595.1,25 500
+596.1,35 501
+14,17 501
+18,24 501
+26,34 501
+1,35 501
+1,35 501
+1,35 502
+597.1,37 503
+21,24 503
+25,26 503
+28,36 503
+1,37 503
+598.1,51 504
+7,10 504
+11,50 504
+1,51 504
+1,51 504
+1,51 505
+599.1,57 506
+7,10 506
+11,56 506
+1,57 506
+1,57 506
+1,57 507
+600.1,30 508
+7,10 508
+12,29 508
+1,30 508
+1,30 508
+1,30 509
+601.1,9 510
+602.1,13 511
+603.19,22 512
+604.6,12 513
+14,29 514
+605.6,44 515
+14,26 515
+14,31 515
+33,43 515
+33,43 515
+6,44 515
+6,44 515
+6,44 515
+606.3,13 516
+607.7,19 517
+7,30 517
+608.4,39 518
+15,18 518
+19,20 518
+21,33 518
+21,38 518
+4,39 518
+4,39 519
+610.4,15 520
+604.31,34 521
+31,34 521
+613.1,29 522
+20,23 522
+25,28 522
+1,29 522
+614.1,45 523
+22,25 523
+41,44 523
+34,44 523
+27,44 523
+27,44 523
+27,44 524
+1,45 523
+615.6,13 525
+616.23,37 526
+33,36 526
+23,37 526
+23,37 526
+2,53 526
+2,53 526
+38,41 526
+43,50 526
+51,52 526
+2,53 526
+617.2,11 527
+618.8,19 528
+619.17,24 529
+7,25 529
+7,36 529
+40,62 529
+49,52 529
+54,61 529
+40,62 529
+40,62 529
+40,68 529
+620.4,11 530
+621.4,9 531
+618.21,35 532
+21,35 532
+21,35 533
+625.6,9 534
+626.2,45 535
+21,24 535
+25,31 535
+32,40 535
+41,42 535
+43,44 535
+2,45 535
+627.1,17 536
+628.0,1 537
+632.1,26 538
+7,10 538
+12,25 538
+1,26 538
+1,26 538
+1,26 539
+633.1,24 540
+18,19 540
+20,23 540
+1,24 540
+1,24 540
+634.1,39 541
+13,16 541
+17,27 541
+17,27 541
+29,33 541
+35,38 541
+1,39 541
+635.1,23 542
+638.9,17 543
+9,21 543
+9,21 544
+9,21 543
+640.9,17 543
+9,21 543
+9,21 545
+9,21 543
+642.12,18 543
+12,18 543
+660.13,21 543
+13,25 543
+13,25 546
+13,25 543
+661.12,20 543
+12,20 543
+662.13,21 543
+13,21 543
+637.2,8 543
+2,8 543
+2,8 543
+2,8 543
+639.3,23 547
+16,19 547
+21,22 547
+3,23 547
+3,23 543
+641.3,23 548
+15,18 548
+20,22 548
+3,23 548
+3,23 549
+3,23 543
+643.3,24 550
+9,12 550
+14,23 550
+3,24 550
+3,24 550
+3,24 551
+644.15,42 552
+29,32 552
+34,41 552
+15,42 552
+15,42 552
+4,5 552
+7,10 552
+7,10 553
+645.8,14 554
+8,14 554
+647.17,23 555
+14,23 555
+5,23 555
+5,23 556
+648.5,57 557
+33,39 557
+30,39 557
+27,39 557
+27,39 558
+50,56 557
+47,56 557
+44,56 557
+41,56 557
+41,56 559
+5,57 557
+5,57 557
+649.9,18 560
+20,82 561
+26,29 561
+31,43 561
+31,52 561
+31,60 561
+61,71 561
+31,71 561
+31,71 562
+31,81 561
+31,81 563
+20,82 561
+20,82 561
+20,82 564
+20,82 554
+651.9,16 565
+652.39,53 566
+49,52 566
+39,53 566
+39,53 566
+6,54 566
+13,32 566
+34,35 566
+36,38 566
+36,38 566
+6,54 566
+6,54 566
+6,54 567
+654.6,52 568
+16,19 568
+28,34 568
+25,34 568
+21,34 568
+21,34 569
+36,42 568
+44,51 568
+6,52 568
+655.6,15 570
+656.6,17 571
+6,17 554
+659.3,22 572
+15,21 572
+3,22 572
+3,22 573
+3,22 574
+3,22 543
+3,22 543
+3,22 543
+663.7,22 575
+7,22 576
+24,29 577
+664.3,30 578
+19,22 578
+24,29 578
+3,30 578
+3,30 578
+3,30 579
+3,30 580
+3,30 543
+667.1,17 581
+13,16 581
+1,17 581
+668.0,1 582
+672.1,18 583
+673.1,16 584
+13,15 584
+1,16 584
+675.11,12 585
+11,12 585
+676.12,14 585
+12,14 585
+674.16,22 585
+16,22 585
+16,22 585
+16,22 585
+16,22 586
+16,22 585
+679.0,1 587
+683.1,16 588
+12,15 588
+1,16 588
+1,16 588
+684.1,12 589
+685.0,1 590
+689.8,16 591
+690.16,20 592
+691.6,15 593
+24,27 594
+17,27 594
+692.2,10 595
+2,10 596
+2,10 596
+694.8,10 597
+1,10 597
+699.1,8 598
+700.8,16 599
+701.13,17 600
+7,17 600
+2,17 600
+2,17 601
+702.2,10 602
+2,10 602
+704.5,12 603
+21,26 604
+21,22 604
+21,26 604
+14,26 604
+705.8,9 605
+1,9 605
+728.12,39 606
+22,38 606
+12,39 606
+12,39 606
+729.5,12 607
+21,22 608
+14,22 608
+730.8,9 609
+1,9 609
+735.1,25 610
+18,19 610
+21,24 610
+1,25 610
+1,25 610
+736.1,44 611
+22,28 611
+29,32 611
+34,41 611
+42,43 611
+1,44 611
+737.1,15 612
+1,15 612
+738.13,61 613
+27,45 613
+47,60 613
+13,61 613
+13,61 613
+739.5,12 614
+14,26 615
+740.1,26 616
+22,25 616
+1,26 616
+741.1,23 617
+17,20 617
+21,22 617
+1,23 617
+1,23 617
+742.1,17 618
+743.0,1 619
+750.6,19 620
+23,33 620
+23,33 620
+23,33 620
+23,33 620
+751.2,44 621
+9,30 621
+31,32 621
+33,35 621
+36,43 621
+2,44 621
+2,44 621
+752.2,6 622
+754.20,77 623
+39,46 623
+48,50 623
+52,60 623
+62,76 623
+20,77 623
+20,77 623
+755.1,26 624
+7,10 624
+12,25 624
+1,26 624
+1,26 624
+1,26 625
+756.5,33 626
+11,14 626
+16,32 626
+5,33 626
+5,33 626
+5,48 626
+5,48 627
+757.2,13 628
+758.1,28 629
+7,10 629
+12,27 629
+1,28 629
+1,28 629
+1,28 630
+759.38,49 631
+33,49 631
+55,64 631
+52,65 631
+32,66 631
+25,66 631
+1,66 631
+1,66 632
+760.1,26 633
+761.1,38 634
+14,17 634
+19,26 634
+28,37 634
+1,38 634
+1,38 634
+1,38 635
+762.6,14 636
+22,34 637
+16,34 637
+763.2,27 638
+8,11 638
+13,26 638
+13,26 638
+2,27 638
+2,27 638
+2,27 639
+762.36,41 640
+36,41 640
+764.10,23 641
+1,25 641
+1,25 642
+765.1,23 643
+766.1,16 644
+768.1,35 645
+22,25 645
+27,34 645
+1,35 645
+769.1,16 646
+770.5,16 647
+771.2,43 648
+9,30 648
+31,32 648
+33,35 648
+36,42 648
+2,43 648
+2,43 648
+772.2,6 649
+774.1,12 650
+775.1,34 651
+18,21 651
+23,24 651
+26,33 651
+1,34 651
+776.1,11 652
+777.1,12 653
+779.1,15 654
+780.1,33 655
+7,10 655
+12,32 655
+1,33 655
+1,33 655
+1,33 656
+781.1,18 657
+12,15 657
+16,17 657
+1,18 657
+782.1,39 658
+7,10 658
+12,38 658
+1,39 658
+1,39 658
+1,39 659
+783.1,24 660
+20,23 660
+1,24 660
+1,24 660
+784.1,14 661
+785.1,29 662
+20,23 662
+25,28 662
+1,29 662
+786.1,45 663
+22,25 663
+41,44 663
+34,44 663
+27,44 663
+27,44 663
+27,44 664
+1,45 663
+789.9,17 665
+9,21 665
+9,21 666
+9,21 665
+791.9,17 665
+9,21 665
+9,21 667
+9,21 665
+793.11,18 665
+11,18 665
+853.13,21 665
+13,25 665
+13,25 668
+13,25 665
+854.12,20 665
+12,20 665
+855.12,20 665
+12,20 665
+788.2,8 665
+2,8 665
+2,8 665
+2,8 665
+790.3,23 669
+16,19 669
+21,22 669
+3,23 669
+3,23 665
+792.3,23 670
+15,18 670
+20,22 670
+3,23 670
+3,23 671
+3,23 665
+794.3,24 672
+9,12 672
+14,23 672
+3,24 672
+3,24 672
+3,24 673
+795.15,42 674
+29,32 674
+34,41 674
+15,42 674
+15,42 674
+4,5 674
+7,10 674
+7,10 675
+796.8,14 676
+8,14 676
+801.17,23 677
+14,23 677
+5,23 677
+5,23 678
+802.5,57 679
+33,39 679
+30,39 679
+27,39 679
+27,39 680
+50,56 679
+47,56 679
+44,56 679
+41,56 679
+41,56 681
+5,57 679
+5,57 679
+803.9,18 682
+20,72 683
+26,29 683
+31,43 683
+31,52 683
+31,60 683
+61,71 683
+31,71 683
+31,71 684
+31,71 685
+20,72 683
+20,72 683
+20,72 686
+20,72 676
+805.5,23 687
+5,23 687
+5,23 676
+807.17,23 688
+14,23 688
+5,23 688
+5,23 689
+808.10,16 690
+18,29 691
+809.10,16 692
+21,28 692
+32,43 692
+32,43 692
+810.7,33 693
+17,28 693
+17,28 693
+29,32 693
+7,33 693
+811.7,35 694
+17,28 694
+17,28 694
+29,34 694
+7,35 694
+808.31,34 695
+31,34 695
+815.5,12 696
+816.10,16 697
+18,29 698
+817.6,17 699
+24,35 699
+6,35 699
+816.31,34 700
+31,34 700
+818.5,18 701
+14,17 701
+5,18 701
+5,18 676
+820.19,25 702
+16,25 702
+5,25 702
+5,25 703
+821.10,16 704
+18,29 705
+822.6,17 706
+6,23 706
+821.31,34 707
+31,34 707
+823.5,18 708
+14,17 708
+5,18 708
+5,18 676
+825.17,23 709
+14,23 709
+5,23 709
+5,23 710
+826.5,16 711
+23,34 711
+5,34 711
+827.5,18 712
+14,17 712
+5,18 712
+5,18 676
+829.17,23 713
+14,23 713
+5,23 713
+5,23 714
+830.12,23 715
+5,23 715
+831.10,16 716
+18,29 717
+832.6,17 718
+6,21 718
+831.31,34 719
+31,34 719
+833.9,25 720
+9,30 720
+32,43 721
+32,53 721
+32,53 722
+834.10,21 723
+10,25 723
+835.5,18 724
+14,17 724
+5,18 724
+5,18 676
+837.17,23 725
+14,23 725
+5,23 725
+5,23 726
+838.9,20 727
+9,20 727
+24,38 727
+40,46 728
+839.28,45 729
+14,45 729
+5,55 729
+5,55 730
+840.9,16 731
+26,37 732
+26,37 732
+18,44 732
+18,44 733
+841.5,19 734
+842.6,62 735
+12,15 735
+17,57 735
+17,61 735
+17,61 736
+6,62 735
+6,62 735
+6,62 737
+843.10,23 738
+29,37 739
+25,37 739
+844.6,845.58 740
+844.12,15 740
+51,54 740
+50,64 740
+43,64 740
+17,64 740
+17,845.33 740
+35,42 740
+844.17,845.46 740
+844.17,845.50 740
+844.17,845.53 740
+844.17,845.57 740
+844.17,845.57 741
+844.6,845.58 740
+844.6,845.58 740
+844.6,845.58 742
+843.39,42 743
+39,42 743
+846.5,65 744
+11,14 744
+38,44 744
+35,44 744
+32,44 744
+16,44 744
+16,48 744
+58,64 744
+55,64 744
+52,64 744
+49,64 744
+16,64 744
+16,64 745
+16,64 746
+5,65 744
+5,65 744
+5,65 747
+5,65 748
+5,65 749
+5,65 676
+848.10,20 750
+849.6,36 751
+27,30 751
+32,35 751
+6,36 751
+6,36 676
+851.3,23 752
+9,12 752
+14,22 752
+3,23 752
+3,23 752
+3,23 753
+852.3,23 754
+15,22 754
+3,23 754
+3,23 755
+3,23 756
+3,23 665
+3,23 665
+3,23 665
+856.7,22 757
+7,22 758
+7,22 759
+857.4,9 760
+858.3,37 761
+26,29 761
+31,36 761
+3,37 761
+3,37 761
+859.7,17 762
+21,37 762
+860.16,41 763
+30,35 763
+37,40 763
+16,41 763
+16,41 763
+861.11,17 764
+8,17 764
+8,24 764
+8,24 765
+862.5,22 766
+16,19 766
+20,21 766
+5,22 766
+5,22 767
+5,22 768
+864.3,26 769
+22,25 769
+3,26 769
+3,26 769
+3,26 770
+3,26 771
+3,26 665
+867.8,24 772
+868.26,38 773
+18,21 773
+18,21 774
+18,21 775
+18,21 776
+869.6,15 777
+870.3,12 778
+8,11 778
+3,12 778
+867.26,50 779
+26,50 779
+872.8,24 780
+873.20,32 781
+874.2,49 782
+14,27 782
+14,31 782
+32,44 782
+14,44 782
+14,44 783
+14,48 782
+14,48 784
+2,49 782
+2,49 782
+875.2,26 785
+2,26 786
+2,26 786
+877.1,24 787
+7,10 787
+12,23 787
+1,24 787
+1,24 787
+1,24 788
+878.1,5 789
+883.1,23 790
+884.1,15 791
+885.6,12 792
+6,12 792
+887.3,34 793
+21,24 793
+26,33 793
+3,34 793
+888.3,13 794
+3,13 792
+890.3,45 795
+19,22 795
+30,36 795
+27,36 795
+23,36 795
+23,36 796
+37,44 795
+3,45 795
+891.3,13 797
+3,13 792
+893.12,21 798
+3,22 798
+3,26 798
+894.3,32 799
+19,22 799
+24,31 799
+3,32 799
+895.3,13 800
+896.3,14 801
+897.7,18 802
+898.4,9 803
+899.3,74 804
+22,39 804
+49,56 804
+40,57 804
+22,57 804
+22,64 804
+22,64 805
+66,73 804
+3,74 804
+900.3,18 806
+901.3,14 807
+902.7,16 808
+903.4,36 809
+23,26 809
+28,35 809
+4,36 809
+904.5,15 810
+905.5,16 811
+5,16 792
+908.3,47 812
+31,37 812
+28,37 812
+24,37 812
+24,37 813
+39,46 812
+3,47 812
+909.3,13 814
+3,13 792
+911.3,49 815
+13,16 815
+25,31 815
+22,31 815
+18,31 815
+18,31 816
+33,39 815
+41,48 815
+3,49 815
+912.3,13 817
+3,13 792
+914.3,44 818
+16,19 818
+28,34 818
+25,34 818
+21,34 818
+21,34 819
+36,43 818
+3,44 818
+915.3,13 820
+3,13 792
+917.15,21 821
+12,21 821
+3,21 821
+3,21 822
+918.3,16 823
+9,12 823
+14,15 823
+3,16 823
+919.7,14 824
+16,27 825
+16,27 825
+16,27 826
+920.8,13 827
+11,12 827
+8,13 827
+8,13 827
+8,13 792
+922.3,30 828
+17,20 828
+22,29 828
+3,30 828
+923.3,13 829
+3,13 792
+925.3,36 830
+20,23 830
+25,26 830
+28,35 830
+3,36 830
+926.3,13 831
+3,13 792
+928.15,21 832
+12,21 832
+3,21 832
+3,21 833
+929.3,16 834
+9,12 834
+14,15 834
+3,16 834
+930.7,14 835
+16,31 836
+16,31 836
+16,31 837
+931.8,19 838
+13,14 838
+16,18 838
+8,19 838
+8,19 838
+8,19 792
+933.7,62 839
+14,49 839
+50,51 839
+52,54 839
+55,61 839
+7,62 839
+7,62 839
+7,62 839
+934.4,34 840
+19,22 840
+23,24 840
+26,33 840
+4,34 840
+935.4,14 841
+4,14 792
+938.1,15 842
+939.1,12 843
+940.0,1 844
+944.1,25 845
+18,19 845
+21,24 845
+1,25 845
+1,25 845
+945.1,44 846
+22,28 846
+29,32 846
+34,41 846
+42,43 846
+1,44 846
+946.1,23 847
+17,20 847
+21,22 847
+1,23 847
+1,23 847
+947.1,17 848
+948.0,1 849
+952.1,25 850
+18,19 850
+21,24 850
+1,25 850
+1,25 850
+954.1,8 851
+956.1,10 852
+957.5,12 853
+958.7,13 854
+15,26 855
+959.7,18 856
+7,18 856
+24,35 857
+24,35 857
+24,44 857
+20,44 857
+20,44 858
+958.28,31 859
+28,31 859
+960.7,57 860
+14,44 860
+45,46 860
+47,49 860
+50,56 860
+7,57 860
+7,57 860
+7,57 860
+961.3,19 861
+962.3,9 862
+965.11,59 863
+28,39 863
+18,39 863
+18,47 863
+18,47 864
+48,49 863
+50,51 863
+52,58 863
+11,59 863
+11,59 863
+11,59 863
+966.2,18 865
+967.2,8 866
+969.1,44 867
+22,28 867
+29,32 867
+34,41 867
+42,43 867
+1,44 867
+970.1,7 868
+971.6,12 869
+14,25 870
+972.7,14 871
+18,29 871
+18,29 871
+34,40 871
+973.8,19 872
+8,19 872
+8,27 872
+3,27 872
+3,27 873
+974.3,975.31 874
+974.20,975.11 874
+12,23 874
+974.20,975.23 874
+974.20,975.30 874
+974.20,975.30 875
+974.3,975.31 874
+974.3,975.31 874
+976.7,15 876
+17,30 877
+17,30 878
+978.4,13 879
+979.4,18 880
+971.27,30 881
+27,30 881
+983.5,15 882
+19,26 882
+984.2,57 883
+26,37 883
+9,37 883
+9,45 883
+9,45 884
+46,47 883
+48,49 883
+50,56 883
+2,57 883
+2,57 883
+985.2,18 885
+986.2,8 886
+988.8,18 887
+989.2,33 888
+21,27 888
+12,28 888
+12,28 888
+29,32 888
+2,33 888
+990.2,35 889
+21,27 889
+12,28 889
+12,28 889
+29,34 889
+2,35 889
+991.2,19 890
+12,18 890
+2,19 890
+992.2,14 891
+2,14 891
+994.1,23 892
+17,20 892
+21,22 892
+1,23 892
+1,23 892
+995.1,14 893
+10,13 893
+1,14 893
+996.5,12 894
+14,56 895
+21,43 895
+44,45 895
+46,48 895
+49,55 895
+14,56 895
+14,56 895
+997.1,17 896
+998.0,1 897
+1002.6,12 898
+18,29 899
+14,29 899
+1003.2,13 900
+25,28 900
+16,29 900
+2,29 900
+1002.31,34 901
+31,34 901
+1004.10,21 902
+1,22 902
+1,26 902
+1005.0,1 903
+1009.1,7 904
+1010.6,12 905
+14,25 906
+1011.2,16 907
+1012.6,17 908
+6,17 908
+1013.3,15 909
+1014.3,6 910
+1016.2,55 911
+8,11 911
+24,32 911
+12,32 911
+12,50 911
+12,54 911
+12,54 912
+2,55 911
+2,55 911
+2,55 913
+2,55 914
+1010.27,30 915
+27,30 915
+1018.1,15 916
+1019.1,14 917
+1020.5,11 918
+13,24 919
+1021.1,82 920
+7,10 920
+66,74 920
+12,74 920
+12,76 920
+12,81 920
+12,81 921
+1,82 920
+1,82 920
+1,82 922
+1022.0,1 923
+1026.1,25 924
+18,19 924
+21,24 924
+1,25 924
+1,25 924
+1027.1,44 925
+22,28 925
+29,32 925
+34,41 925
+42,43 925
+1,44 925
+1028.1,46 926
+17,33 926
+34,45 926
+1,46 926
+1,46 926
+1029.5,14 927
+1030.2,30 928
+19,21 928
+23,29 928
+2,30 928
+2,30 928
+1031.6,11 929
+1032.3,45 930
+10,32 930
+33,34 930
+35,37 930
+38,44 930
+3,45 930
+3,45 930
+1033.3,16 931
+12,15 931
+3,16 931
+3,16 932
+1036.3,16 933
+12,15 933
+3,16 933
+1037.3,15 934
+1038.8,14 935
+16,21 936
+1039.4,26 937
+20,23 937
+24,25 937
+4,26 937
+4,26 937
+1040.4,20 938
+15,19 938
+4,20 938
+4,20 938
+1041.8,19 939
+1042.5,10 940
+1038.23,26 941
+23,26 941
+1046.1,17 942
+1047.0,1 943
+1051.5,16 944
+1052.2,8 945
+1053.21,24 946
+1054.7,18 947
+1055.6,13 948
+26,33 948
+17,34 948
+17,34 948
+1056.3,14 949
+1057.6,13 950
+6,18 950
+1058.3,73 951
+9,12 951
+34,41 951
+27,41 951
+14,41 951
+14,72 951
+14,72 952
+3,73 951
+3,73 951
+3,73 953
+3,73 954
+1060.9,16 955
+3,23 955
+1054.20,34 956
+20,34 956
+1062.1,11 957
+1063.0,1 958
+1067.1,25 959
+18,19 959
+21,24 959
+1,25 959
+1,25 959
+1068.1,44 960
+22,28 960
+29,32 960
+34,41 960
+42,43 960
+1,44 960
+1069.6,19 961
+15,18 961
+6,19 961
+6,19 961
+6,19 961
+23,50 961
+29,32 961
+34,49 961
+23,50 961
+23,50 961
+23,57 961
+23,57 962
+59,68 963
+59,68 963
+1070.1,13 964
+9,12 964
+1,13 964
+1071.1,17 965
+1072.0,1 966
+1076.1,18 967
+1077.1,10 968
+1078.7,18 969
+1079.28,35 970
+3,8 970
+3,8 971
+3,8 972
+3,8 973
+1080.6,18 974
+20,28 975
+20,28 976
+1078.20,34 977
+20,34 977
+1082.6,10 978
+1083.15,18 979
+20,24 979
+26,30 979
+32,35 979
+2,49 979
+2,49 980
+2,49 981
+2,49 982
+1084.0,1 983
+1088.63,66 984
+1089.7,23 985
+1090.25,37 986
+1091.6,18 987
+1092.10,29 988
+3,37 988
+3,37 989
+3,37 990
+3,37 991
+3,37 992
+3,37 993
+3,37 994
+3,37 995
+3,37 996
+1089.25,49 997
+25,49 997
+1094.1,17 998
+1095.0,1 999
+1099.1,25 1000
+18,19 1000
+21,24 1000
+1,25 1000
+1,25 1000
+1100.1,44 1001
+22,28 1001
+29,32 1001
+34,41 1001
+42,43 1001
+1,44 1001
+1101.6,12 1002
+14,29 1003
+1102.2,42 1004
+11,12 1004
+21,33 1004
+14,41 1004
+2,42 1004
+2,42 1004
+1101.31,34 1005
+31,34 1005
+1103.5,9 1006
+1104.2,19 1007
+1105.8,19 1008
+1106.26,33 1009
+1107.10,20 1010
+1108.4,63 1011
+15,20 1011
+22,28 1011
+47,53 1011
+37,54 1011
+30,62 1011
+4,63 1011
+1107.22,34 1012
+22,34 1012
+22,34 1013
+22,34 1014
+22,34 1015
+22,34 1016
+22,34 1017
+1105.21,35 1018
+21,35 1018
+1110.6,16 1019
+1111.3,16 1020
+12,15 1020
+3,16 1020
+3,16 1021
+1113.1,17 1022
+1114.0,1 1023
+1118.1,25 1024
+18,19 1024
+21,24 1024
+1,25 1024
+1,25 1024
+1119.22,36 1025
+32,35 1025
+22,36 1025
+22,36 1025
+1,52 1025
+1,52 1025
+37,40 1025
+42,49 1025
+50,51 1025
+1,52 1025
+1122.5,18 1026
+1123.15,27 1027
+2,35 1027
+1124.2,23 1028
+13,16 1028
+17,18 1028
+19,22 1028
+2,23 1028
+2,23 1029
+1127.6,18 1030
+6,34 1030
+1128.3,49 1031
+15,18 1031
+20,32 1031
+20,41 1031
+20,48 1031
+20,48 1032
+3,49 1031
+3,49 1031
+1129.3,42 1033
+17,29 1033
+17,34 1033
+36,41 1033
+3,42 1033
+3,42 1033
+1130.17,24 1034
+16,31 1034
+3,31 1034
+3,31 1035
+1133.3,51 1036
+15,18 1036
+32,44 1036
+20,50 1036
+3,51 1036
+3,51 1036
+1137.1,21 1037
+15,16 1037
+17,20 1037
+1,21 1037
+1,21 1037
+1138.5,11 1038
+13,26 1039
+22,25 1039
+13,26 1039
+13,26 1040
+1139.10,16 1041
+1140.2,54 1042
+9,41 1042
+42,43 1042
+44,46 1042
+47,53 1042
+2,54 1042
+2,54 1042
+1141.1,17 1043
+1142.0,1 1044
+1146.1,46 1045
+17,33 1045
+34,45 1045
+1,46 1045
+1,46 1045
+1147.5,14 1046
+1148.2,49 1047
+14,16 1047
+18,25 1047
+26,38 1047
+26,44 1047
+45,48 1047
+2,49 1047
+2,49 1047
+1149.2,14 1048
+2,25 1048
+1150.6,18 1049
+6,34 1049
+38,50 1049
+38,66 1049
+75,76 1050
+68,76 1050
+1151.9,10 1051
+2,10 1051
+1153.13,14 1052
+6,14 1052
+1165.6,12 1053
+14,29 1054
+1166.6,18 1055
+6,33 1055
+42,43 1056
+35,43 1056
+1165.31,34 1057
+31,34 1057
+1167.8,10 1058
+1,10 1058
+1172.1,49 1059
+17,35 1059
+37,48 1059
+1,49 1059
+1,49 1059
+1173.5,14 1060
+1174.2,43 1061
+14,16 1061
+18,22 1061
+24,36 1061
+24,42 1061
+2,43 1061
+2,43 1061
+1175.2,17 1062
+13,16 1062
+2,17 1062
+2,17 1062
+1176.2,51 1063
+21,39 1063
+40,50 1063
+2,51 1063
+2,51 1063
+1177.6,16 1064
+1178.3,22 1065
+8,11 1065
+17,21 1065
+3,22 1065
+3,22 1065
+1179.7,15 1066
+1180.15,37 1067
+29,30 1067
+31,36 1067
+15,37 1067
+15,37 1067
+1181.14,20 1068
+4,20 1068
+4,20 1069
+1182.4,25 1070
+15,18 1070
+19,20 1070
+21,24 1070
+4,25 1070
+4,25 1071
+4,25 1072
+4,25 1073
+1184.10,11 1074
+3,11 1074
+3,11 1075
+1187.1,53 1076
+8,40 1076
+41,42 1076
+43,45 1076
+46,52 1076
+1,53 1076
+1,53 1076
+1188.8,10 1077
+1,10 1077
+1193.1,13 1078
+1,24 1078
+1194.5,17 1079
+5,31 1079
+1195.2,52 1080
+8,11 1080
+25,37 1080
+13,43 1080
+13,47 1080
+13,51 1080
+13,51 1081
+2,52 1080
+2,52 1080
+2,52 1082
+2,52 1083
+1196.10,22 1084
+10,38 1084
+1197.2,41 1085
+16,28 1085
+16,33 1085
+35,40 1085
+2,41 1085
+2,41 1085
+1198.2,65 1086
+8,11 1086
+13,25 1086
+13,34 1086
+13,42 1086
+50,59 1086
+49,64 1086
+43,64 1086
+13,64 1086
+13,64 1087
+13,64 1088
+2,65 1086
+2,65 1086
+2,65 1089
+1200.1,21 1090
+7,10 1090
+12,20 1090
+1,21 1090
+1,21 1090
+1,21 1091
+1201.0,1 1092
+1211.5,12 1093
+1212.2,47 1094
+18,34 1094
+35,46 1094
+2,47 1094
+2,47 1094
+1213.6,15 1095
+1214.3,55 1096
+10,42 1096
+43,44 1096
+45,47 1096
+48,54 1096
+3,55 1096
+3,55 1096
+1215.10,12 1097
+3,12 1097
+1218.3,29 1098
+15,17 1098
+19,28 1098
+3,29 1098
+3,29 1098
+3,29 1099
+1220.12,20 1100
+1,30 1100
+1221.6,12 1101
+14,25 1102
+1222.2,16 1103
+1223.2,59 1104
+10,13 1104
+15,42 1104
+15,55 1104
+15,58 1104
+15,58 1105
+2,59 1104
+2,59 1104
+2,59 1106
+1224.2,69 1107
+10,13 1107
+15,38 1107
+15,51 1107
+15,54 1107
+15,65 1107
+15,68 1107
+15,68 1108
+2,69 1107
+2,69 1107
+2,69 1109
+2,69 1110
+1221.27,30 1111
+27,30 1111
+1226.13,59 1112
+27,43 1112
+45,58 1112
+13,59 1112
+13,59 1112
+1227.5,12 1113
+1228.9,11 1114
+2,11 1114
+1229.1,12 1115
+1230.1,9 1116
+1231.1,9 1117
+1232.1,13 1118
+1233.11,45 1119
+17,20 1119
+22,44 1119
+11,45 1119
+11,45 1119
+1,45 1119
+1,45 1120
+1234.1,7 1121
+1235.1,11 1122
+1236.6,11 1123
+13,24 1124
+1237.2,13 1125
+16,23 1125
+16,23 1125
+2,28 1125
+2,28 1126
+1238.10,21 1127
+6,21 1127
+6,25 1127
+45,56 1127
+41,56 1127
+41,60 1127
+29,40 1127
+29,61 1127
+29,68 1127
+1239.3,14 1128
+17,28 1128
+34,45 1128
+30,45 1128
+30,47 1128
+17,28 1128
+3,48 1128
+1241.2,12 1129
+1242.7,13 1130
+19,30 1131
+15,30 1131
+1243.22,32 1132
+22,32 1132
+7,18 1132
+7,32 1132
+7,32 1133
+1244.4,13 1134
+1245.4,9 1135
+1242.32,35 1136
+32,35 1136
+1248.2,16 1137
+1249.2,1250.58 1138
+1249.8,11 1138
+13,39 1138
+13,53 1138
+1250.13,24 1138
+1249.13,1250.24 1138
+1249.13,1250.46 1138
+1249.13,1250.49 1138
+1249.13,1250.57 1138
+1249.13,1250.57 1139
+1249.2,1250.58 1138
+1249.2,1250.58 1138
+1249.2,1250.58 1140
+1251.6,11 1141
+15,22 1141
+1252.3,19 1142
+1253.3,51 1143
+9,12 1143
+14,29 1143
+14,50 1143
+14,50 1144
+3,51 1143
+3,51 1143
+3,51 1145
+1255.2,13 1146
+2,83 1146
+16,23 1146
+39,40 1146
+41,42 1146
+45,47 1146
+48,50 1146
+9:93.18,73 1146
+0:1255.65,66 1146
+67,82 1146
+2,83 1146
+2,83 1146
+1256.2,1257.44 1147
+1256.13,16 1147
+17,37 1147
+17,65 1147
+17,65 1148
+2,1257.44 1147
+1256.2,1257.44 1147
+1258.2,51 1149
+15,18 1149
+19,33 1149
+35,46 1149
+35,46 1149
+47,50 1149
+2,51 1149
+2,51 1149
+2,51 1150
+1259.2,81 1151
+8,11 1151
+13,32 1151
+13,73 1151
+13,76 1151
+13,80 1151
+13,80 1152
+2,81 1151
+2,81 1151
+2,81 1153
+1260.2,85 1154
+8,11 1154
+13,32 1154
+13,77 1154
+13,80 1154
+13,84 1154
+13,84 1155
+2,85 1154
+2,85 1154
+2,85 1156
+1261.2,81 1157
+8,11 1157
+13,32 1157
+13,73 1157
+13,76 1157
+13,80 1157
+13,80 1158
+2,81 1157
+2,81 1157
+2,81 1159
+1262.2,85 1160
+8,11 1160
+13,32 1160
+13,71 1160
+13,74 1160
+13,84 1160
+13,84 1161
+2,85 1160
+2,85 1160
+2,85 1162
+1263.15,57 1163
+21,24 1163
+26,41 1163
+26,56 1163
+26,56 1164
+15,57 1163
+15,57 1163
+2,57 1163
+2,57 1165
+1264.7,21 1166
+11,13 1166
+11,13 1166
+15,20 1166
+2,21 1166
+1265.7,19 1167
+31,38 1167
+28,38 1167
+23,38 1167
+43,56 1167
+1266.3,15 1168
+1267.3,10 1169
+1268.3,9 1170
+1269.3,12 1171
+1271.6,14 1172
+1272.3,1273.46 1173
+1272.9,12 1173
+50,57 1173
+43,57 1173
+14,57 1173
+14,1273.18 1173
+35,44 1173
+33,44 1173
+26,45 1173
+19,45 1173
+1272.14,1273.45 1173
+1272.14,1273.45 1174
+1272.14,1273.45 1175
+1272.3,1273.46 1173
+1272.3,1273.46 1173
+1272.3,1273.46 1176
+1275.2,77 1177
+8,11 1177
+13,33 1177
+13,42 1177
+43,53 1177
+13,53 1177
+13,53 1178
+13,65 1177
+66,76 1177
+13,76 1177
+13,76 1179
+13,76 1180
+2,77 1177
+2,77 1177
+2,77 1181
+1276.2,93 1182
+8,11 1182
+13,32 1182
+13,41 1182
+49,56 1182
+42,56 1182
+13,56 1182
+13,56 1183
+13,68 1182
+69,79 1182
+13,79 1182
+13,79 1184
+13,92 1182
+13,92 1185
+2,93 1182
+2,93 1182
+2,93 1186
+1278.2,38 1187
+8,11 1187
+13,30 1187
+13,37 1187
+13,37 1188
+2,38 1187
+2,38 1187
+2,38 1189
+1279.7,19 1190
+25,33 1191
+21,33 1191
+1280.3,1281.53 1192
+1280.9,12 1192
+14,26 1192
+14,49 1192
+50,57 1192
+14,62 1192
+14,67 1192
+1281.30,37 1192
+1280.14,1281.41 1192
+1280.14,1281.45 1192
+1280.14,1281.48 1192
+1280.14,1281.52 1192
+1280.14,1281.52 1193
+1280.3,1281.53 1192
+1280.3,1281.53 1192
+1280.3,1281.53 1194
+1279.35,38 1195
+35,38 1195
+1283.6,33 1196
+15,26 1196
+15,26 1196
+27,32 1196
+6,33 1196
+6,33 1196
+6,33 1196
+37,45 1196
+1284.3,23 1197
+17,20 1197
+21,22 1197
+3,23 1197
+3,23 1197
+1285.2,7 1198
+2,7 1199
+2,7 1200
+1236.26,29 1201
+26,29 1201
+1287.5,13 1202
+1288.2,14 1203
+1289.1,14 1204
+10,13 1204
+1,14 1204
+1290.1,40 1205
+15,18 1205
+20,39 1205
+1,40 1205
+1,40 1205
+1291.20,35 1206
+25,29 1206
+31,34 1206
+20,35 1206
+20,35 1206
+14,18 1206
+14,36 1206
+1,36 1206
+1,36 1207
+1292.19,34 1208
+24,28 1208
+30,33 1208
+19,34 1208
+19,34 1208
+19,36 1208
+14,38 1208
+14,18 1208
+14,38 1208
+1,38 1208
+1,38 1209
+1293.5,19 1210
+1294.2,73 1211
+8,11 1211
+42,55 1211
+13,55 1211
+13,59 1211
+60,72 1211
+13,72 1211
+13,72 1212
+13,72 1213
+2,73 1211
+2,73 1211
+2,73 1214
+1295.13,18 1215
+5,18 1215
+1296.2,71 1216
+8,11 1216
+46,53 1216
+39,53 1216
+13,53 1216
+13,57 1216
+58,70 1216
+13,70 1216
+13,70 1217
+13,70 1218
+2,71 1216
+2,71 1216
+2,71 1219
+1297.27,61 1220
+33,36 1220
+38,60 1220
+27,61 1220
+27,61 1220
+23,61 1220
+23,61 1221
+18,62 1220
+1,62 1220
+1298.1,44 1222
+16,19 1222
+21,43 1222
+1,44 1222
+1,44 1222
+1300.5,15 1223
+27,36 1224
+17,45 1224
+17,45 1225
+1301.6,25 1226
+1302.6,11 1227
+13,23 1228
+1303.3,83 1229
+9,12 1229
+46,54 1229
+14,54 1229
+14,67 1229
+68,82 1229
+14,82 1229
+14,82 1230
+14,82 1231
+3,83 1229
+3,83 1229
+3,83 1232
+1302.25,28 1233
+25,28 1233
+1305.1,75 1234
+7,10 1234
+12,59 1234
+12,63 1234
+12,70 1234
+12,74 1234
+12,74 1235
+1,75 1234
+1,75 1234
+1,75 1236
+1306.1,21 1237
+7,10 1237
+12,20 1237
+1,21 1237
+1,21 1237
+1,21 1238
+1307.8,9 1239
+1,9 1239
+1325.9,16 1240
+9,20 1240
+5,21 1240
+5,28 1240
+1326.13,20 1241
+13,24 1241
+8,11 1241
+8,25 1241
+2,35 1241
+2,35 1242
+2,35 1243
+1327.14,21 1244
+14,25 1244
+10,26 1244
+10,33 1244
+1328.13,20 1245
+13,24 1245
+8,11 1245
+8,25 1245
+2,34 1245
+2,34 1246
+1329.9,16 1247
+9,20 1247
+5,21 1247
+5,28 1247
+1330.13,20 1248
+13,24 1248
+8,11 1248
+8,25 1248
+8,37 1248
+2,44 1248
+2,44 1249
+1332.1,23 1250
+14,17 1250
+19,22 1250
+1,23 1250
+1,23 1250
+1333.5,12 1251
+16,20 1251
+16,27 1251
+29,69 1252
+40,62 1252
+63,66 1252
+67,68 1252
+29,69 1252
+29,69 1252
+1334.8,9 1253
+1,9 1253
+1339.1,24 1254
+18,19 1254
+20,23 1254
+1,24 1254
+1,24 1254
+1340.1,44 1255
+22,28 1255
+29,32 1255
+34,41 1255
+42,43 1255
+1,44 1255
+1341.1,14 1256
+10,13 1256
+1,14 1256
+1342.6,17 1257
+19,29 1258
+1343.2,27 1259
+16,19 1259
+20,26 1259
+2,27 1259
+2,27 1259
+1342.31,43 1260
+31,43 1260
+1344.1,17 1261
+1345.0,1 1262
+1349.1,25 1263
+18,19 1263
+21,24 1263
+1,25 1263
+1,25 1263
+1350.1,44 1264
+22,28 1264
+29,32 1264
+34,41 1264
+42,43 1264
+1,44 1264
+1351.5,12 1265
+1352.7,13 1266
+15,26 1267
+1353.7,18 1268
+7,18 1268
+1354.8,29 1269
+22,25 1269
+27,28 1269
+8,29 1269
+8,29 1269
+8,34 1269
+36,41 1270
+1352.28,31 1271
+28,31 1271
+1356.6,27 1272
+20,23 1272
+25,26 1272
+6,27 1272
+6,27 1272
+1357.1,17 1273
+1358.0,1 1274
+1363.5,13 1275
+17,44 1275
+26,37 1275
+26,37 1275
+38,43 1275
+17,44 1275
+17,44 1275
+17,44 1275
+1364.2,70 1276
+26,37 1276
+18,37 1276
+18,41 1276
+18,41 1277
+59,69 1276
+2,70 1276
+2,70 1276
+2,70 1278
+1365.6,71 1279
+21,40 1279
+41,52 1279
+21,52 1279
+21,59 1279
+21,59 1280
+60,70 1279
+6,71 1279
+6,71 1279
+1366.5,14 1281
+1367.6,14 1282
+18,45 1282
+27,38 1282
+27,38 1282
+39,44 1282
+18,45 1282
+18,45 1282
+18,45 1282
+1368.3,31 1283
+13,24 1283
+13,24 1283
+25,30 1283
+3,31 1283
+1369.10,30 1284
+24,27 1284
+28,29 1284
+10,30 1284
+10,30 1284
+3,30 1284
+1371.7,60 1285
+29,40 1285
+14,40 1285
+14,47 1285
+14,47 1286
+48,49 1285
+50,52 1285
+53,59 1285
+7,60 1285
+7,60 1285
+1372.9,11 1287
+2,11 1287
+1374.1,31 1288
+10,17 1288
+28,30 1288
+1,31 1288
+1,31 1288
+1375.5,17 1289
+1376.6,14 1290
+18,45 1290
+27,38 1290
+27,38 1290
+39,44 1290
+18,45 1290
+18,45 1290
+18,45 1290
+1377.3,31 1291
+13,24 1291
+13,24 1291
+25,30 1291
+3,31 1291
+1378.10,30 1292
+24,27 1292
+28,29 1292
+10,30 1292
+10,30 1292
+3,30 1292
+1380.7,74 1293
+43,54 1293
+14,54 1293
+14,61 1293
+14,61 1294
+62,63 1293
+64,66 1293
+67,73 1293
+7,74 1293
+7,74 1293
+1381.9,11 1295
+2,11 1295
+1384.13,31 1296
+13,33 1296
+34,52 1296
+34,54 1296
+1385.19,35 1297
+19,26 1297
+33,34 1297
+19,35 1297
+19,35 1297
+2,53 1297
+2,13 1297
+2,13 1297
+2,13 1297
+37,42 1297
+43,46 1297
+48,49 1297
+50,51 1297
+2,53 1297
+1386.2,16 1298
+1387.2,36 1299
+8,11 1299
+12,26 1299
+12,35 1299
+12,35 1300
+2,36 1299
+2,36 1299
+2,36 1301
+1388.2,10 1302
+1389.2,9 1303
+1390.6,14 1304
+1391.3,80 1305
+29,40 1305
+21,40 1305
+21,44 1305
+21,44 1306
+62,73 1305
+74,79 1305
+3,80 1305
+3,80 1305
+1392.3,36 1307
+7,14 1307
+26,28 1307
+30,35 1307
+3,36 1307
+3,36 1307
+1394.11,58 1308
+17,20 1308
+35,43 1308
+22,43 1308
+22,57 1308
+22,57 1309
+11,58 1308
+11,58 1308
+2,58 1308
+2,58 1310
+1395.11,58 1311
+17,20 1311
+35,43 1311
+22,43 1311
+22,57 1311
+22,57 1312
+11,58 1311
+11,58 1311
+2,58 1311
+2,58 1313
+1396.11,60 1314
+17,20 1314
+35,43 1314
+22,43 1314
+22,59 1314
+22,59 1315
+11,60 1314
+11,60 1314
+2,60 1314
+2,60 1316
+1397.12,44 1317
+18,21 1317
+23,43 1317
+12,44 1317
+12,44 1317
+2,44 1317
+2,44 1318
+1398.12,44 1319
+18,21 1319
+23,43 1319
+12,44 1319
+12,44 1319
+2,44 1319
+2,44 1320
+1399.2,1400.60 1321
+1399.8,11 1321
+36,42 1321
+29,42 1321
+13,42 1321
+13,46 1321
+55,61 1321
+48,61 1321
+13,61 1321
+13,61 1322
+13,1400.6 1321
+15,19 1321
+14,23 1321
+7,23 1321
+1399.13,1400.23 1321
+1399.13,1400.23 1323
+1399.13,1400.27 1321
+37,41 1321
+37,43 1321
+36,48 1321
+29,48 1321
+1399.13,1400.48 1321
+1399.13,1400.48 1324
+1399.13,1400.59 1321
+1399.13,1400.59 1325
+1399.2,1400.60 1321
+1399.2,1400.60 1321
+1399.2,1400.60 1326
+1401.7,15 1327
+19,25 1327
+40,51 1328
+40,51 1328
+52,57 1328
+27,71 1328
+27,71 1329
+27,71 1330
+1403.8,9 1331
+1,9 1331
+1408.1,17 1332
+1409.8,18 1333
+1410.2,14 1334
+1411.6,21 1335
+25,44 1335
+53,54 1336
+46,54 1336
+1412.2,14 1337
+2,14 1338
+2,14 1338
+1414.8,9 1339
+1,9 1339
+1420.1,10 1340
+1421.8,24 1341
+1422.2,20 1342
+1423.6,21 1343
+25,44 1343
+1424.3,18 1344
+3,18 1345
+1425.7,61 1346
+19,34 1346
+19,38 1346
+39,56 1346
+19,56 1346
+19,56 1347
+19,60 1346
+19,60 1348
+7,61 1346
+7,61 1346
+1426.2,26 1349
+2,26 1350
+2,26 1350
+1428.1,16 1351
+1429.0,1 1352
+1433.5,18 1353
+1434.2,14 1354
+2,14 1355
+1436.2,13 1356
+1438.1,9 1357
+1439.1,18 1358
+1440.5,18 1359
+20,36 1360
+1441.20,75 1361
+39,46 1361
+48,50 1361
+53,58 1361
+60,74 1361
+20,75 1361
+20,75 1361
+1442.1,27 1362
+1443.1,40 1363
+14,17 1363
+19,27 1363
+29,39 1363
+1,40 1363
+1,40 1363
+1,40 1364
+1444.1,23 1365
+7,10 1365
+12,22 1365
+1,23 1365
+1,23 1365
+1,23 1366
+1445.1,48 1367
+7,10 1367
+12,36 1367
+12,40 1367
+12,47 1367
+12,47 1368
+1,48 1367
+1,48 1367
+1,48 1369
+1446.1,86 1370
+7,10 1370
+12,78 1370
+12,85 1370
+12,85 1371
+1,86 1370
+1,86 1370
+1,86 1372
+1447.1,91 1373
+7,10 1373
+12,83 1373
+12,90 1373
+12,90 1374
+1,91 1373
+1,91 1373
+1,91 1375
+1448.5,13 1376
+17,47 1376
+26,39 1376
+26,39 1376
+41,46 1376
+17,47 1376
+17,47 1376
+17,47 1376
+51,59 1376
+1449.2,73 1377
+26,39 1377
+18,39 1377
+18,43 1377
+18,43 1378
+62,72 1377
+2,73 1377
+2,73 1377
+1450.6,15 1379
+1451.3,33 1380
+12,19 1380
+30,32 1380
+3,33 1380
+3,33 1380
+1452.3,1453.70 1381
+1452.9,12 1381
+35,56 1381
+13,56 1381
+13,1453.14 1381
+15,36 1381
+1452.13,1453.36 1381
+1452.13,1453.36 1382
+1452.13,1453.69 1381
+1452.13,1453.69 1383
+1452.3,1453.70 1381
+1452.3,1453.70 1381
+1452.3,1453.70 1384
+1454.3,40 1385
+16,19 1385
+20,26 1385
+28,34 1385
+36,39 1385
+3,40 1385
+3,40 1385
+3,40 1386
+1455.3,73 1387
+9,12 1387
+14,72 1387
+3,73 1387
+3,73 1387
+3,73 1388
+3,73 1389
+1458.1,72 1390
+7,10 1390
+12,71 1390
+1,72 1390
+1,72 1390
+1,72 1391
+1459.5,18 1392
+1460.2,59 1393
+8,11 1393
+13,58 1393
+2,59 1393
+2,59 1393
+2,59 1394
+1461.2,59 1395
+8,11 1395
+13,58 1395
+2,59 1395
+2,59 1395
+2,59 1396
+2,59 1397
+1463.7,78 1398
+13,16 1398
+18,77 1398
+7,78 1398
+7,78 1398
+7,78 1399
+1464.6,19 1400
+6,7 1400
+11,18 1400
+6,19 1400
+6,19 1400
+6,19 1400
+1465.2,22 1401
+12,15 1401
+17,18 1401
+20,21 1401
+2,22 1401
+2,22 1402
+1467.2,40 1403
+8,11 1403
+13,39 1403
+2,40 1403
+2,40 1403
+2,40 1404
+1468.1,33 1405
+20,23 1405
+25,32 1405
+1,33 1405
+1469.1,45 1406
+22,25 1406
+41,44 1406
+34,44 1406
+27,44 1406
+27,44 1406
+27,44 1407
+1,45 1406
+1472.9,17 1408
+9,21 1408
+9,21 1409
+9,21 1408
+1474.9,17 1408
+9,21 1408
+9,21 1410
+9,21 1408
+1476.11,19 1408
+11,19 1408
+1484.12,20 1408
+12,24 1408
+12,24 1411
+12,24 1408
+1485.12,20 1408
+12,20 1408
+1486.12,20 1408
+12,20 1408
+1471.2,8 1408
+2,8 1408
+2,8 1408
+2,8 1408
+1473.3,23 1412
+16,19 1412
+21,22 1412
+3,23 1412
+3,23 1408
+1475.3,23 1413
+15,18 1413
+20,22 1413
+3,23 1413
+3,23 1414
+3,23 1408
+1477.7,18 1415
+1478.4,11 1416
+4,11 1417
+1479.4,9 1418
+1481.7,22 1419
+7,22 1420
+1482.4,9 1421
+4,9 1422
+4,9 1408
+4,9 1408
+4,9 1408
+1487.7,22 1423
+1488.4,9 1424
+1490.4,31 1425
+20,23 1425
+25,30 1425
+4,31 1425
+4,31 1425
+4,31 1426
+4,31 1408
+1493.8,11 1427
+1,11 1427
+1524.1,25 1428
+18,19 1428
+21,24 1428
+1,25 1428
+1,25 1428
+1525.1,48 1429
+22,28 1429
+30,33 1429
+35,42 1429
+44,47 1429
+1,48 1429
+1526.5,13 1430
+1527.7,15 1431
+23,34 1432
+17,34 1432
+1528.3,27 1433
+9,12 1433
+14,26 1433
+14,26 1433
+3,27 1433
+3,27 1433
+3,27 1434
+1527.36,41 1435
+36,41 1435
+1530.2,14 1436
+10,13 1436
+2,14 1436
+1531.6,19 1437
+15,18 1437
+6,19 1437
+6,19 1437
+6,19 1437
+21,58 1438
+27,30 1438
+32,57 1438
+21,58 1438
+21,58 1438
+21,58 1439
+1533.1,14 1440
+10,13 1440
+1,14 1440
+1534.8,22 1441
+15,21 1441
+8,22 1441
+8,22 1441
+26,40 1441
+33,39 1441
+26,40 1441
+26,40 1441
+44,58 1441
+51,57 1441
+44,58 1441
+44,58 1441
+62,65 1441
+44,65 1441
+26,65 1441
+1,65 1441
+1,65 1441
+1,65 1442
+1535.5,32 1443
+14,17 1443
+25,31 1443
+22,31 1443
+19,31 1443
+19,31 1444
+5,32 1443
+5,32 1443
+5,37 1443
+1536.6,30 1445
+15,18 1445
+23,29 1445
+20,29 1445
+20,29 1446
+6,30 1445
+6,30 1445
+6,35 1445
+1537.3,24 1447
+12,15 1447
+17,23 1447
+3,24 1447
+3,24 1447
+1538.5,13 1448
+1539.2,31 1449
+14,17 1449
+19,21 1449
+23,26 1449
+28,30 1449
+2,31 1449
+1540.2,47 1450
+18,21 1450
+23,46 1450
+2,47 1450
+2,47 1450
+1541.2,45 1451
+17,20 1451
+22,44 1451
+2,45 1451
+2,45 1451
+2,45 1452
+2,45 1453
+1545.1,17 1454
+1546.0,1 1455
+1550.1,63 1456
+30,40 1456
+19,40 1456
+19,49 1456
+19,49 1457
+51,62 1456
+1,63 1456
+1,63 1456
+1551.5,16 1458
+1552.2,52 1459
+13,17 1459
+19,39 1459
+41,51 1459
+2,52 1459
+2,52 1459
+1553.0,1 1460
+1557.1,57 1461
+7,10 1461
+11,56 1461
+1,57 1461
+1,57 1461
+1,57 1462
+1558.1,57 1463
+7,10 1463
+11,56 1463
+1,57 1463
+1,57 1463
+1,57 1464
+1559.1,49 1465
+20,37 1465
+38,48 1465
+1,49 1465
+1,49 1465
+1560.5,15 1466
+1561.2,21 1467
+7,10 1467
+16,20 1467
+2,21 1467
+2,21 1467
+1562.6,14 1468
+1563.9,14 1469
+9,18 1469
+7,19 1469
+7,27 1469
+36,41 1470
+36,45 1470
+29,46 1470
+1564.24,38 1471
+24,38 1471
+24,38 1471
+3,39 1471
+3,39 1471
+3,39 1471
+3,39 1471
+1565.3,1566.29 1472
+1565.23,42 1472
+44,52 1472
+54,61 1472
+63,70 1472
+63,74 1472
+1566.7,14 1472
+15,21 1472
+22,28 1472
+1565.3,1566.29 1472
+1565.3,1566.29 1472
+1567.3,25 1473
+20,24 1473
+3,25 1473
+3,25 1473
+1568.3,39 1474
+20,38 1474
+20,21 1474
+20,38 1474
+3,39 1474
+3,39 1474
+1569.3,63 1475
+11,14 1475
+15,58 1475
+15,62 1475
+15,62 1476
+3,63 1475
+3,63 1475
+3,63 1477
+1570.3,63 1478
+11,14 1478
+15,58 1478
+15,62 1478
+15,62 1479
+3,63 1478
+3,63 1478
+3,63 1480
+3,63 1481
+3,63 1482
+3,63 1483
+1573.5,14 1484
+5,19 1484
+1574.2,29 1485
+1575.5,14 1486
+5,19 1486
+1576.2,29 1487
+1577.1,21 1488
+7,10 1488
+12,20 1488
+1,21 1488
+1,21 1488
+1,21 1489
+1578.0,1 1490
+1582.3,8 1491
+1,15 1491
+1583.1,9 1492
+1584.1,11 1493
+1585.1,11 1494
+1586.6,12 1495
+18,23 1496
+14,23 1496
+1587.6,10 1497
+6,16 1497
+20,24 1497
+20,30 1497
+1588.7,12 1498
+16,25 1498
+16,29 1498
+34,40 1499
+31,47 1499
+1589.17,20 1500
+9,10 1500
+9,21 1500
+3,21 1500
+3,21 1501
+1590.3,14 1502
+1591.3,12 1503
+3,12 1504
+1593.7,16 1505
+1586.25,28 1506
+25,28 1506
+1595.5,11 1507
+1,15 1507
+1596.8,14 1508
+18,23 1508
+18,30 1508
+32,35 1509
+32,35 1509
+1597.12,15 1510
+8,10 1510
+8,16 1510
+1,16 1510
+1602.1,49 1511
+13,16 1511
+18,48 1511
+1,49 1511
+1,49 1511
+1603.1,49 1512
+13,16 1512
+18,48 1512
+1,49 1512
+1,49 1512
+1604.5,13 1513
+34,35 1514
+27,35 1514
+1605.28,34 1515
+28,38 1515
+24,26 1515
+24,39 1515
+9,15 1515
+9,19 1515
+5,7 1515
+5,20 1515
+5,39 1515
+5,39 1516
+5,39 1517
+48,49 1518
+41,49 1518
+1606.8,9 1519
+1,9 1519
+1611.22,36 1520
+22,36 1520
+22,36 1520
+1,37 1520
+1,37 1520
+1,37 1520
+1,37 1520
+1612.1,48 1521
+17,34 1521
+36,47 1521
+1,48 1521
+1,48 1521
+1613.5,14 1522
+1614.33,1615.58 1523
+1614.45,64 1523
+1615.4,12 1523
+14,21 1523
+23,30 1523
+23,34 1523
+36,43 1523
+44,50 1523
+51,57 1523
+1614.33,1615.58 1523
+1614.33,1615.58 1523
+1614.24,1615.59 1523
+1614.24,1615.59 1523
+1614.24,1615.59 1524
+1614.24,1615.59 1523
+1614.24,1615.59 1523
+1614.2,1615.60 1523
+1614.14,16 1523
+18,22 1523
+18,22 1523
+18,22 1525
+2,1615.60 1523
+1614.2,1615.60 1523
+1617.0,1 1526
+1621.1,52 1527
+20,40 1527
+41,51 1527
+1,52 1527
+1,52 1527
+1622.5,15 1528
+1623.6,12 1529
+14,19 1530
+1624.3,22 1531
+8,11 1531
+17,21 1531
+3,22 1531
+3,22 1531
+1625.7,15 1532
+7,15 1533
+17,22 1534
+1626.7,12 1535
+1627.15,39 1536
+29,30 1536
+31,38 1536
+15,39 1536
+15,39 1536
+1628.25,31 1537
+22,31 1537
+18,31 1537
+18,31 1538
+4,31 1537
+1629.8,14 1539
+18,28 1539
+1630.5,55 1540
+11,14 1540
+16,54 1540
+5,55 1540
+5,55 1540
+5,55 1541
+5,55 1542
+1631.9,57 1543
+15,18 1543
+20,56 1543
+9,57 1543
+9,57 1543
+9,57 1544
+1632.4,78 1545
+10,13 1545
+41,46 1545
+34,46 1545
+14,46 1545
+14,67 1545
+14,71 1545
+14,77 1545
+14,77 1546
+4,78 1545
+4,78 1545
+4,78 1547
+4,78 1548
+4,78 1549
+4,78 1550
+4,78 1551
+1623.21,24 1552
+21,24 1552
+1635.2,22 1553
+8,11 1553
+13,21 1553
+2,22 1553
+2,22 1553
+2,22 1554
+1637.0,1 1555
+1641.1,8 1556
+1642.16,21 1557
+5,13 1557
+5,21 1557
+30,31 1558
+23,31 1558
+1643.6,12 1559
+23,30 1560
+19,30 1560
+33,43 1560
+18,44 1560
+14,44 1560
+1644.20,28 1561
+18,28 1561
+14,15 1561
+14,29 1561
+6,29 1561
+6,29 1562
+31,36 1563
+1643.46,49 1564
+46,49 1564
+1646.8,11 1565
+1,11 1565
+1651.1,1655.16 1566
+1651.33,40 1566
+1652.7,20 1566
+1653.7,42 1566
+1654.7,10 1566
+1655.7,15 1566
+1651.1,1655.16 1566
+1651.1,1655.16 1566
+1656.5,18 1567
+22,32 1567
+22,39 1567
+51,62 1567
+51,66 1567
+43,67 1567
+43,74 1567
+1657.2,8 1568
+1658.1,8 1569
+1659.6,12 1570
+14,25 1571
+1660.6,17 1572
+6,17 1572
+1661.3,23 1573
+13,14 1573
+15,22 1573
+3,23 1573
+3,23 1573
+1662.7,13 1574
+1663.9,20 1575
+9,20 1575
+9,28 1575
+4,28 1575
+4,28 1576
+1664.7,13 1577
+1665.4,22 1578
+1666.4,9 1579
+1668.12,18 1580
+1669.4,19 1581
+1670.3,14 1582
+1659.27,30 1583
+27,30 1583
+1673.5,12 1584
+14,27 1585
+1674.1,51 1586
+8,38 1586
+39,40 1586
+41,43 1586
+44,50 1586
+1,51 1586
+1,51 1586
+1675.0,1 1587
+1681.1,23 1588
+1682.1,27 1589
+1683.1,26 1590
+1684.1,51 1591
+22,28 1591
+30,31 1591
+33,41 1591
+43,50 1591
+1,51 1591
+1685.1,50 1592
+16,17 1592
+18,22 1592
+23,30 1592
+32,40 1592
+42,49 1592
+1,50 1592
+1686.1,17 1593
+1688.9,17 1594
+9,17 1594
+1700.9,16 1594
+9,16 1594
+1687.1,7 1594
+1,7 1594
+1,7 1594
+1,7 1594
+1689.3,23 1595
+1690.7,18 1596
+1691.8,25 1597
+1692.16,51 1598
+30,41 1598
+43,50 1598
+16,51 1598
+16,51 1598
+1693.10,20 1599
+1694.6,25 1600
+18,24 1600
+6,25 1600
+6,25 1600
+1693.22,34 1601
+22,34 1601
+22,34 1602
+22,34 1603
+1696.4,13 1604
+9,12 1604
+4,13 1604
+1697.11,12 1605
+4,12 1605
+1699.15,29 1606
+20,21 1606
+23,28 1606
+15,29 1606
+15,29 1606
+8,29 1606
+1701.3,23 1607
+1702.3,23 1608
+1703.10,11 1609
+3,11 1609
+1710.1,46 1610
+17,33 1610
+34,45 1610
+1,46 1610
+1,46 1610
+1711.5,14 1611
+1712.2,28 1612
+14,16 1612
+18,27 1612
+2,28 1612
+2,28 1612
+1713.14,33 1613
+24,32 1613
+14,33 1613
+14,33 1613
+1714.6,13 1614
+1715.10,12 1615
+3,12 1615
+1716.9,23 1616
+2,23 1616
+1718.8,10 1617
+1,10 1617
+1723.1,30 1618
+21,29 1618
+1,30 1618
+1,30 1618
+1724.5,11 1619
+1725.2,81 1620
+15,68 1620
+69,70 1620
+71,73 1620
+74,80 1620
+2,81 1620
+2,81 1620
+1726.6,13 1621
+1727.10,11 1622
+3,11 1622
+1728.2,24 1623
+1729.2,39 1624
+21,29 1624
+31,38 1624
+2,39 1624
+1730.2,18 1625
+1731.2,13 1626
+1732.6,18 1627
+1733.10,11 1628
+3,11 1628
+1734.9,31 1629
+22,30 1629
+9,31 1629
+9,31 1629
+2,31 1629
+1736.13,14 1630
+6,14 1630
+1741.1,25 1631
+18,19 1631
+21,24 1631
+1,25 1631
+1,25 1631
+1742.1,43 1632
+22,28 1632
+29,32 1632
+33,40 1632
+41,42 1632
+1,43 1632
+1744.6,30 1633
+21,29 1633
+6,30 1633
+6,30 1633
+6,35 1633
+1745.3,8 1634
+1746.2,18 1635
+13,17 1635
+2,18 1635
+2,18 1635
+2,18 1635
+1748.1,17 1636
+1749.0,1 1637
+1753.13,30 1638
+23,24 1638
+26,29 1638
+13,30 1638
+13,30 1638
+1,30 1638
+1754.1,17 1639
+1756.5,15 1640
+1757.2,1761.17 1641
+1757.34,41 1641
+1758.8,21 1641
+1759.16,27 1641
+8,27 1641
+8,50 1641
+8,50 1642
+1760.31,34 1641
+19,34 1641
+8,34 1641
+8,34 1641
+8,34 1643
+1761.8,16 1641
+1757.2,1761.17 1641
+1757.2,1761.17 1641
+1762.6,20 1644
+24,35 1644
+24,42 1644
+1763.3,16 1645
+1764.3,9 1646
+1767.6,21 1647
+1770.5,16 1648
+5,23 1648
+1771.2,28 1649
+12,23 1649
+12,23 1649
+24,27 1649
+2,28 1649
+1772.2,25 1650
+2,25 1650
+1773.2,11 1651
+1775.1,13 1652
+1777.5,16 1653
+5,23 1653
+1778.2,13 1654
+1779.2,25 1655
+2,25 1655
+1782.14,26 1656
+14,30 1656
+5,31 1656
+5,38 1656
+1783.14,25 1657
+14,25 1657
+14,32 1657
+2,32 1657
+2,32 1658
+1785.6,30 1659
+6,30 1659
+6,30 1659
+6,30 1659
+6,30 1659
+13,21 1659
+6,30 1659
+6,30 1659
+6,30 1660
+6,30 1659
+6,30 1659
+6,30 1659
+6,30 1659
+1786.2,20 1661
+1788.1,25 1662
+12,20 1662
+21,24 1662
+1,25 1662
+1,25 1662
+1789.22,25 1663
+12,20 1663
+1,26 1663
+1791.13,30 1664
+31,42 1664
+13,42 1664
+1,49 1664
+1,49 1665
+1792.1,35 1666
+26,34 1666
+1,35 1666
+1,35 1666
+1793.1,12 1667
+1794.5,17 1668
+21,46 1668
+30,41 1668
+30,41 1668
+42,45 1668
+21,46 1668
+21,46 1668
+21,46 1668
+50,58 1668
+1795.27,38 1669
+19,38 1669
+2,57 1669
+2,57 1670
+1796.6,33 1671
+19,32 1671
+6,33 1671
+6,33 1671
+6,45 1671
+1797.3,13 1672
+1798.3,27 1673
+3,27 1674
+1800.7,33 1675
+17,28 1675
+17,28 1675
+29,32 1675
+7,33 1675
+7,33 1676
+1802.1,38 1677
+17,25 1677
+27,37 1677
+1,38 1677
+1,38 1677
+1803.5,17 1678
+21,30 1678
+1804.2,16 1679
+1805.2,8 1680
+1808.1,10 1681
+1811.26,29 1682
+26,29 1682
+1812.22,33 1683
+14,33 1683
+1,52 1683
+1,52 1684
+1813.5,12 1685
+30,54 1686
+37,45 1686
+47,53 1686
+30,54 1686
+30,54 1686
+15,18 1686
+20,26 1686
+20,26 1687
+20,26 1688
+1814.6,52 1689
+24,32 1689
+33,44 1689
+46,51 1689
+6,52 1689
+6,52 1689
+1815.5,15 1690
+1816.2,20 1691
+1817.2,8 1692
+1819.5,13 1693
+18,24 1693
+1820.2,48 1694
+20,29 1694
+30,41 1694
+42,47 1694
+2,48 1694
+2,48 1694
+1821.1,21 1695
+1822.1,32 1696
+1823.1,19 1697
+1825.1,23 1698
+1826.5,15 1699
+1827.17,30 1700
+2,30 1700
+2,30 1701
+1829.2,14 1702
+1830.6,17 1703
+6,29 1703
+31,53 1704
+1831.2,27 1705
+1832.2,31 1706
+16,18 1706
+19,22 1706
+23,30 1706
+2,31 1706
+2,31 1706
+1833.2,11 1707
+1834.25,35 1708
+23,45 1708
+16,45 1708
+2,45 1708
+2,45 1709
+1835.2,18 1710
+1836.6,11 1711
+6,11 1712
+13,18 1713
+1837.2,14 1714
+1838.9,20 1715
+1839.3,30 1716
+20,23 1716
+24,27 1716
+28,29 1716
+3,30 1716
+3,30 1716
+1840.7,13 1717
+7,13 1718
+15,20 1719
+1841.7,17 1720
+19,40 1721
+30,33 1721
+34,37 1721
+38,39 1721
+19,40 1721
+19,40 1721
+1842.3,16 1722
+3,16 1722
+3,16 1723
+3,16 1723
+1845.1,21 1724
+1846.1,17 1725
+1847.1,9 1726
+1848.1,10 1727
+1849.5,20 1728
+24,31 1728
+1850.6,12 1729
+1851.3,24 1730
+1852.3,9 1731
+1854.2,23 1732
+14,22 1732
+2,23 1732
+2,23 1732
+1855.2,24 1733
+14,23 1733
+2,24 1733
+2,24 1733
+1856.6,16 1734
+1857.10,1858.31 1735
+1857.22,70 1735
+1858.5,16 1735
+5,16 1735
+17,21 1735
+22,30 1735
+1857.10,1858.31 1735
+1857.10,1858.31 1735
+1857.3,1858.45 1735
+1857.3,1858.45 1735
+1857.3,1858.45 1736
+33,34 1735
+36,37 1735
+38,44 1735
+1857.3,1858.45 1735
+1857.3,1858.45 1735
+1859.2,15 1737
+1860.2,8 1738
+1864.5,13 1739
+1865.15,26 1740
+15,26 1740
+27,30 1740
+2,44 1740
+2,44 1741
+1866.5,15 1742
+17,65 1743
+24,35 1743
+24,35 1743
+24,53 1743
+24,53 1744
+54,55 1743
+56,57 1743
+58,64 1743
+17,65 1743
+17,65 1743
+1867.1,14 1745
+1868.0,1 1746
+1883.1,12 1747
+1884.1,10 1748
+1,10 1749
+1885.15,67 1750
+34,41 1750
+42,44 1750
+46,49 1750
+51,66 1750
+15,67 1750
+15,67 1750
+2,5 1750
+2,5 1751
+2,5 1752
+1886.16,17 1753
+18,19 1753
+22,25 1753
+26,28 1753
+1887.1,59 1754
+10,17 1754
+27,32 1754
+9:90.18,31 1754
+0:1887.45,46 1754
+47,58 1754
+1,59 1754
+1,59 1754
+1888.1,59 1755
+10,17 1755
+27,32 1755
+9:90.18,31 1755
+0:1888.45,46 1755
+47,58 1755
+1,59 1755
+1,59 1755
+1889.1,59 1756
+10,17 1756
+27,32 1756
+9:90.18,31 1756
+0:1889.45,46 1756
+47,58 1756
+1,59 1756
+1,59 1756
+1890.1,58 1757
+10,17 1757
+27,32 1757
+9:90.18,31 1757
+0:1890.45,46 1757
+47,57 1757
+1,58 1757
+1,58 1757
+1891.1,88 1758
+7,10 1758
+12,87 1758
+1,88 1758
+1,88 1758
+1,88 1759
+1892.1,36 1760
+14,17 1760
+19,25 1760
+26,31 1760
+32,35 1760
+1,36 1760
+1,36 1760
+1,36 1761
+1893.1,40 1762
+14,17 1762
+19,27 1762
+29,39 1762
+1,40 1762
+1,40 1762
+1,40 1763
+1894.6,14 1764
+22,37 1765
+16,37 1765
+1895.2,30 1766
+8,11 1766
+13,29 1766
+13,29 1766
+2,30 1766
+2,30 1766
+2,30 1767
+1894.39,44 1768
+39,44 1768
+1896.22,25 1769
+1897.5,11 1770
+15,43 1770
+24,35 1770
+24,35 1770
+37,42 1770
+15,43 1770
+15,43 1770
+15,43 1770
+47,55 1770
+1898.2,65 1771
+11,18 1771
+32,43 1771
+24,43 1771
+24,47 1771
+24,47 1772
+2,65 1771
+2,65 1771
+1899.5,18 1773
+1900.2,18 1774
+1901.5,18 1775
+1902.2,20 1776
+7,15 1776
+2,20 1776
+2,20 1776
+1903.2,20 1777
+7,15 1777
+2,20 1777
+2,20 1777
+1904.2,1905.38 1778
+1904.8,11 1778
+35,43 1778
+13,43 1778
+13,55 1778
+56,64 1778
+13,64 1778
+13,64 1779
+13,1905.37 1778
+1904.13,1905.37 1780
+1904.2,1905.38 1778
+1904.2,1905.38 1778
+1904.2,1905.38 1781
+1906.2,41 1782
+15,18 1782
+20,27 1782
+29,35 1782
+37,40 1782
+2,41 1782
+2,41 1782
+2,41 1783
+1907.2,64 1784
+8,11 1784
+13,63 1784
+2,64 1784
+2,64 1784
+2,64 1785
+1908.2,67 1786
+8,11 1786
+58,66 1786
+51,66 1786
+13,66 1786
+13,66 1787
+2,67 1786
+2,67 1786
+2,67 1788
+1911.1,58 1789
+7,10 1789
+38,49 1789
+12,49 1789
+12,57 1789
+12,57 1790
+1,58 1789
+1,58 1789
+1,58 1791
+1912.1,19 1792
+11,14 1792
+15,16 1792
+17,18 1792
+1,19 1792
+1913.1,20 1793
+1914.1,33 1794
+20,23 1794
+25,32 1794
+1,33 1794
+1915.1,45 1795
+22,25 1795
+41,44 1795
+34,44 1795
+27,44 1795
+27,44 1795
+27,44 1796
+1,45 1795
+1919.9,17 1797
+9,21 1797
+9,21 1798
+9,21 1797
+1921.9,17 1797
+9,21 1797
+9,21 1799
+9,21 1797
+1923.12,18 1797
+12,18 1797
+1918.2,8 1797
+2,8 1797
+2,8 1797
+2,8 1797
+1920.3,23 1800
+16,19 1800
+21,22 1800
+3,23 1800
+3,23 1797
+1922.3,23 1801
+15,18 1801
+20,22 1801
+3,23 1801
+3,23 1802
+3,23 1797
+1924.8,28 1803
+8,17 1803
+21,27 1803
+8,28 1803
+8,28 1803
+8,28 1803
+1925.4,27 1804
+14,17 1804
+18,24 1804
+25,26 1804
+4,27 1804
+1926.4,22 1805
+1928.7,23 1806
+7,23 1807
+25,30 1808
+1929.7,11 1809
+7,15 1809
+7,23 1809
+7,23 1810
+1930.15,23 1811
+15,19 1811
+15,23 1811
+4,23 1811
+4,23 1812
+1931.4,49 1813
+4,9 1813
+17,18 1813
+19,20 1813
+23,26 1813
+27,29 1813
+33,38 1813
+39,42 1813
+44,45 1813
+46,47 1813
+4,49 1813
+1932.8,18 1814
+1933.5,54 1815
+5,10 1815
+18,23 1815
+24,25 1815
+28,31 1815
+32,34 1815
+38,43 1815
+44,47 1815
+49,50 1815
+51,52 1815
+5,54 1815
+1934.4,53 1816
+4,9 1816
+16,18 1816
+19,20 1816
+22,27 1816
+29,30 1816
+31,32 1816
+34,38 1816
+40,48 1816
+40,44 1816
+40,48 1816
+40,52 1816
+40,52 1817
+4,53 1816
+4,53 1816
+1935.4,35 1818
+10,13 1818
+14,34 1818
+4,35 1818
+4,35 1818
+4,35 1819
+4,35 1820
+1937.12,16 1821
+12,20 1821
+12,28 1821
+12,28 1822
+1938.4,62 1823
+10,13 1823
+41,49 1823
+41,45 1823
+41,49 1823
+15,49 1823
+15,61 1823
+15,61 1824
+4,62 1823
+4,62 1823
+4,62 1825
+4,62 1826
+4,62 1797
+1941.1,12 1827
+1942.0,1 1828
+1946.1,8 1829
+1947.5,10 1830
+1948.2,16 1831
+1949.10,38 1832
+16,19 1832
+21,37 1832
+10,38 1832
+10,38 1832
+1,38 1832
+1,38 1833
+1950.10,39 1834
+16,19 1834
+21,38 1834
+10,39 1834
+10,39 1834
+1,39 1834
+1,39 1835
+1951.1,42 1836
+16,19 1836
+21,41 1836
+1,42 1836
+1,42 1836
+1952.5,14 1837
+18,24 1837
+18,31 1837
+1953.7,14 1838
+2,14 1838
+1954.2,17 1839
+1956.19,36 1840
+18,41 1840
+17,46 1840
+1,46 1840
+1957.19,36 1841
+18,41 1841
+17,46 1841
+1,46 1841
+1958.1,57 1842
+7,10 1842
+30,39 1842
+12,39 1842
+12,46 1842
+47,56 1842
+12,56 1842
+12,56 1843
+12,56 1844
+1,57 1842
+1,57 1842
+1,57 1845
+1959.1,32 1846
+7,10 1846
+12,31 1846
+1,32 1846
+1,32 1846
+1,32 1847
+1960.0,1 1848
+1977.15,66 1849
+34,41 1849
+42,44 1849
+45,48 1849
+50,65 1849
+15,66 1849
+15,66 1849
+2,5 1849
+2,5 1850
+2,5 1851
+1978.1,25 1852
+1979.1,36 1853
+14,17 1853
+19,25 1853
+27,35 1853
+1,36 1853
+1,36 1853
+1,36 1854
+1980.6,14 1855
+22,37 1856
+16,37 1856
+1981.2,30 1857
+8,11 1857
+13,29 1857
+13,29 1857
+2,30 1857
+2,30 1857
+2,30 1858
+1980.39,44 1859
+39,44 1859
+1983.5,12 1860
+1985.6,20 1861
+1986.3,22 1862
+8,17 1862
+3,22 1862
+3,22 1862
+1987.3,22 1863
+8,17 1863
+3,22 1863
+3,22 1863
+1988.3,1989.39 1864
+1988.9,12 1864
+35,43 1864
+14,43 1864
+14,55 1864
+56,64 1864
+14,64 1864
+14,64 1865
+14,1989.38 1864
+1988.14,1989.38 1866
+1988.3,1989.39 1864
+1988.3,1989.39 1864
+1988.3,1989.39 1867
+1990.3,42 1868
+16,19 1868
+21,27 1868
+29,36 1868
+38,41 1868
+3,42 1868
+3,42 1868
+3,42 1869
+1991.3,74 1870
+9,12 1870
+14,73 1870
+3,74 1870
+3,74 1870
+3,74 1871
+1992.3,75 1872
+9,12 1872
+14,74 1872
+3,75 1872
+3,75 1872
+3,75 1873
+3,75 1874
+1996.6,20 1875
+1997.3,22 1876
+8,17 1876
+3,22 1876
+3,22 1876
+1998.3,22 1877
+8,17 1877
+3,22 1877
+3,22 1877
+1999.3,2000.39 1878
+1999.9,12 1878
+35,43 1878
+14,43 1878
+14,55 1878
+56,64 1878
+14,64 1878
+14,64 1879
+14,2000.38 1878
+1999.14,2000.38 1880
+1999.3,2000.39 1878
+1999.3,2000.39 1878
+1999.3,2000.39 1881
+2001.3,42 1882
+16,19 1882
+21,27 1882
+29,36 1882
+38,41 1882
+3,42 1882
+3,42 1882
+3,42 1883
+2002.3,57 1884
+9,12 1884
+14,56 1884
+3,57 1884
+3,57 1884
+3,57 1885
+2003.3,51 1886
+9,12 1886
+14,50 1886
+3,51 1886
+3,51 1886
+3,51 1887
+2004.3,51 1888
+9,12 1888
+14,50 1888
+3,51 1888
+3,51 1888
+3,51 1889
+2008.1,19 1890
+11,14 1890
+15,16 1890
+17,18 1890
+1,19 1890
+2009.1,32 1891
+21,24 1891
+25,31 1891
+1,32 1891
+2010.1,33 1892
+20,23 1892
+25,32 1892
+1,33 1892
+2011.1,45 1893
+22,25 1893
+41,44 1893
+34,44 1893
+27,44 1893
+27,44 1893
+27,44 1894
+1,45 1893
+2015.9,17 1895
+9,21 1895
+9,21 1896
+9,21 1895
+2017.9,17 1895
+9,21 1895
+9,21 1897
+9,21 1895
+2019.11,17 1895
+11,17 1895
+2014.2,8 1895
+2,8 1895
+2,8 1895
+2,8 1895
+2016.3,23 1898
+16,19 1898
+21,22 1898
+3,23 1898
+3,23 1895
+2018.3,23 1899
+15,18 1899
+20,22 1899
+3,23 1899
+3,23 1900
+3,23 1895
+2020.7,20 1901
+7,20 1902
+2030.0,1 1903
+2021.7,20 1904
+2022.4,15 1905
+2023.8,17 1906
+19,28 1907
+24,27 1907
+19,28 1907
+2024.4,22 1908
+2025.4,12 1909
+4,12 1910
+4,12 1911
+2030.0,1 1903
+0,1 1912
+0,1 1895
+2034.1,46 1913
+22,25 1913
+22,25 1913
+27,30 1913
+27,30 1913
+32,38 1913
+32,38 1913
+40,43 1913
+40,43 1913
+2035.5,12 1914
+2036.2,20 1915
+2037.2,8 1916
+2039.1,12 1917
+2040.1,20 1918
+2041.1,12 1919
+2043.7,13 1920
+15,20 1921
+2044.3,18 1922
+14,17 1922
+3,18 1922
+3,18 1922
+2045.3,60 1923
+9,12 1923
+40,47 1923
+14,47 1923
+14,59 1923
+14,59 1924
+3,60 1923
+3,60 1923
+3,60 1925
+2046.8,15 1926
+17,22 1927
+2047.8,28 1928
+8,17 1928
+21,27 1928
+8,28 1928
+8,28 1928
+8,28 1928
+2048.4,28 1929
+14,17 1929
+19,25 1929
+26,27 1929
+4,28 1929
+2049.4,22 1930
+2043.22,25 1931
+22,25 1931
+2053.1,19 1932
+2054.0,1 1933
+2062.5,9 1934
+2063.2,23 1935
+13,16 1935
+18,22 1935
+2,23 1935
+2064.10,45 1936
+16,19 1936
+21,44 1936
+10,45 1936
+10,45 1936
+6,45 1936
+6,45 1937
+2065.7,39 1936
+13,16 1936
+18,38 1936
+7,39 1936
+7,39 1936
+3,39 1936
+3,39 1938
+2064.6,2065.39 1936
+2066.17,26 1936
+14,27 1936
+7,28 1936
+3,28 1936
+2064.2,2066.28 1936
+2067.10,30 1939
+10,23 1939
+10,25 1939
+10,25 1940
+10,30 1939
+10,30 1939
+6,30 1939
+2068.3,27 1941
+7,20 1941
+7,22 1941
+7,22 1942
+3,27 1941
+3,27 1941
+2069.2,26 1943
+6,19 1943
+6,21 1943
+6,21 1944
+2,26 1943
+2,26 1943
+2,26 1945
+2072.2,28 1946
+16,19 1946
+21,24 1946
+26,27 1946
+2,28 1946
+2,28 1946
+2073.2,12 1947
+6,7 1947
+2,12 1947
+2,12 1947
+2074.2,12 1948
+6,7 1948
+2,12 1948
+2,12 1948
+2077.11,43 1949
+17,20 1949
+22,42 1949
+11,43 1949
+11,43 1949
+1,43 1949
+1,43 1950
+2079.11,40 1951
+17,20 1951
+22,39 1951
+11,40 1951
+11,40 1951
+1,40 1951
+1,40 1952
+2080.11,39 1953
+17,20 1953
+22,38 1953
+11,39 1953
+11,39 1953
+1,39 1953
+1,39 1954
+2081.12,47 1955
+18,21 1955
+23,46 1955
+12,47 1955
+12,47 1955
+1,47 1955
+1,47 1956
+2083.1,22 1957
+11,14 1957
+16,21 1957
+1,22 1957
+2084.11,45 1958
+17,20 1958
+22,44 1958
+11,45 1958
+11,45 1958
+1,45 1958
+1,45 1959
+2085.9,15 1960
+5,15 1960
+2086.2,12 1961
+2087.1,23 1962
+13,16 1962
+17,22 1962
+1,23 1962
+2088.10,44 1963
+16,19 1963
+21,43 1963
+10,44 1963
+10,44 1963
+1,44 1963
+1,44 1964
+2089.5,11 1965
+15,19 1965
+2090.2,12 1966
+2092.13,21 1967
+10,22 1967
+9,25 1967
+1,29 1967
+2093.1,22 1968
+12,15 1968
+17,21 1968
+1,22 1968
+2094.1,24 1969
+14,17 1969
+19,23 1969
+1,24 1969
+2095.11,46 1970
+17,20 1970
+22,45 1970
+11,46 1970
+11,46 1970
+1,46 1970
+1,46 1971
+2097.12,60 1972
+18,21 1972
+23,59 1972
+12,60 1972
+12,60 1972
+1,60 1972
+1,60 1973
+2098.9,14 1974
+9,20 1974
+9,26 1974
+5,26 1974
+32,37 1975
+32,41 1975
+28,47 1975
+2101.12,46 1976
+18,21 1976
+23,45 1976
+12,46 1976
+12,46 1976
+1,46 1976
+1,46 1977
+2103.8,14 1978
+8,19 1978
+1,23 1978
+2104.8,13 1979
+1,15 1979
+2106.1,75 1980
+7,10 1980
+42,52 1980
+12,52 1980
+12,63 1980
+64,74 1980
+12,74 1980
+12,74 1981
+12,74 1982
+1,75 1980
+1,75 1980
+1,75 1983
+2108.9,16 1984
+5,16 1984
+2109.2,13 1985
+2110.10,44 1986
+16,19 1986
+21,43 1986
+10,44 1986
+10,44 1986
+1,44 1986
+1,44 1987
+2111.10,45 1988
+16,19 1988
+21,44 1988
+10,45 1988
+10,45 1988
+1,45 1988
+1,45 1989
+2113.1,75 1990
+7,10 1990
+35,43 1990
+12,43 1990
+12,54 1990
+55,63 1990
+12,63 1990
+12,63 1991
+12,74 1990
+12,74 1992
+1,75 1990
+1,75 1990
+1,75 1993
+2114.1,24 1994
+17,20 1994
+22,23 1994
+1,24 1994
+1,24 1994
+2115.0,1 1995
+2119.11,45 1996
+17,20 1996
+22,44 1996
+11,45 1996
+11,45 1996
+1,45 1996
+1,45 1997
+2120.5,13 1998
+17,27 1998
+17,27 1998
+2121.2,58 1999
+8,11 1999
+13,57 1999
+2,58 1999
+2,58 1999
+2,58 2000
+2122.2,59 2001
+8,11 2001
+13,58 2001
+2,59 2001
+2,59 2001
+2,59 2002
+2123.2,69 2003
+8,11 2003
+13,68 2003
+2,69 2003
+2,69 2003
+2,69 2004
+2124.2,12 2005
+2,16 2005
+2126.10,44 2006
+16,19 2006
+21,43 2006
+10,44 2006
+10,44 2006
+1,44 2006
+1,44 2007
+2127.5,13 2008
+17,27 2008
+17,27 2008
+2128.2,61 2009
+8,11 2009
+13,56 2009
+13,60 2009
+13,60 2010
+2,61 2009
+2,61 2009
+2,61 2011
+2129.2,61 2012
+8,11 2012
+13,56 2012
+13,60 2012
+13,60 2013
+2,61 2012
+2,61 2012
+2,61 2014
+2130.2,76 2015
+8,11 2015
+13,75 2015
+2,76 2015
+2,76 2015
+2,76 2016
+2131.2,12 2017
+2,16 2017
+2133.10,44 2018
+16,19 2018
+21,43 2018
+10,44 2018
+10,44 2018
+1,44 2018
+1,44 2019
+2134.5,13 2020
+17,27 2020
+17,27 2020
+2135.2,68 2021
+8,11 2021
+13,67 2021
+2,68 2021
+2,68 2021
+2,68 2022
+2136.2,12 2023
+2,16 2023
+2138.10,44 2024
+16,19 2024
+21,43 2024
+10,44 2024
+10,44 2024
+1,44 2024
+1,44 2025
+2139.5,13 2026
+2140.9,17 2027
+2,17 2027
+2141.20,29 2028
+16,30 2028
+12,30 2028
+6,30 2028
+46,55 2029
+42,56 2029
+32,56 2029
+2142.2,68 2030
+8,11 2030
+57,67 2030
+13,67 2030
+13,67 2031
+2,68 2030
+2,68 2030
+2,68 2032
+2144.0,1 2033
+2148.11,46 2034
+17,20 2034
+22,45 2034
+11,46 2034
+11,46 2034
+1,46 2034
+1,46 2035
+2149.5,13 2036
+2150.2,73 2037
+10,13 2037
+15,72 2037
+2,73 2037
+2,73 2037
+2,73 2038
+2151.2,71 2039
+10,13 2039
+15,70 2039
+2,71 2039
+2,71 2039
+2,71 2040
+2152.2,70 2041
+10,13 2041
+15,69 2041
+2,70 2041
+2,70 2041
+2,70 2042
+2154.10,45 2043
+16,19 2043
+21,44 2043
+10,45 2043
+10,45 2043
+1,45 2043
+1,45 2044
+2155.5,13 2045
+2156.13,57 2046
+19,22 2046
+24,56 2046
+13,57 2046
+13,57 2046
+2,57 2046
+2,57 2047
+2157.9,17 2048
+2,17 2048
+2158.19,28 2049
+15,29 2049
+12,29 2049
+6,29 2049
+44,53 2050
+40,54 2050
+31,54 2050
+2159.2,63 2051
+8,11 2051
+52,62 2051
+13,62 2051
+13,62 2052
+2,63 2051
+2,63 2051
+2,63 2053
+2161.10,45 2054
+16,19 2054
+21,44 2054
+10,45 2054
+10,45 2054
+1,45 2054
+1,45 2055
+2162.5,13 2056
+2163.9,17 2057
+2,17 2057
+2164.20,29 2058
+17,30 2058
+12,30 2058
+6,30 2058
+45,54 2059
+42,55 2059
+32,55 2059
+2165.2,65 2060
+8,11 2060
+54,64 2060
+13,64 2060
+13,64 2061
+2,65 2060
+2,65 2060
+2,65 2062
+2166.2,65 2063
+8,11 2063
+54,64 2063
+13,64 2063
+13,64 2064
+2,65 2063
+2,65 2063
+2,65 2065
+2167.2,65 2066
+8,11 2066
+54,64 2066
+13,64 2066
+13,64 2067
+2,65 2066
+2,65 2066
+2,65 2068
+2169.0,1 2069
+2173.11,46 2070
+17,20 2070
+22,45 2070
+11,46 2070
+11,46 2070
+1,46 2070
+1,46 2071
+2174.5,13 2072
+2175.9,17 2073
+2,17 2073
+2176.6,14 2074
+16,24 2075
+2177.2,65 2076
+8,11 2076
+54,64 2076
+13,64 2076
+13,64 2077
+2,65 2076
+2,65 2076
+2,65 2078
+2178.2,65 2079
+8,11 2079
+54,64 2079
+13,64 2079
+13,64 2080
+2,65 2079
+2,65 2079
+2,65 2081
+2179.2,65 2082
+8,11 2082
+54,64 2082
+13,64 2082
+13,64 2083
+2,65 2082
+2,65 2082
+2,65 2084
+2181.10,45 2085
+16,19 2085
+21,44 2085
+10,45 2085
+10,45 2085
+1,45 2085
+1,45 2086
+2182.5,13 2087
+2183.13,57 2088
+19,22 2088
+24,56 2088
+13,57 2088
+13,57 2088
+2,57 2088
+2,57 2089
+2184.9,17 2090
+2,17 2090
+2185.18,27 2091
+15,28 2091
+12,28 2091
+6,28 2091
+42,51 2092
+39,52 2092
+30,52 2092
+2186.2,63 2093
+8,11 2093
+52,62 2093
+13,62 2093
+13,62 2094
+2,63 2093
+2,63 2093
+2,63 2095
+2188.10,45 2096
+16,19 2096
+21,44 2096
+10,45 2096
+10,45 2096
+1,45 2096
+1,45 2097
+2189.5,13 2098
+2190.2,52 2099
+10,13 2099
+15,51 2099
+2,52 2099
+2,52 2099
+2,52 2100
+2191.2,47 2101
+10,13 2101
+15,46 2101
+2,47 2101
+2,47 2101
+2,47 2102
+2192.2,46 2103
+10,13 2103
+15,45 2103
+2,46 2103
+2,46 2103
+2,46 2104
+2194.0,1 2105
+2198.11,45 2106
+17,20 2106
+22,44 2106
+11,45 2106
+11,45 2106
+1,45 2106
+1,45 2107
+2199.12,58 2108
+18,21 2108
+23,57 2108
+12,58 2108
+12,58 2108
+1,58 2108
+1,58 2109
+2200.5,13 2110
+2201.2,18 2111
+2202.2,13 2112
+2203.6,15 2113
+17,26 2114
+2204.2,68 2115
+8,11 2115
+57,67 2115
+13,67 2115
+13,67 2116
+2,68 2115
+2,68 2115
+2,68 2117
+2206.10,44 2118
+16,19 2118
+21,43 2118
+10,44 2118
+10,44 2118
+1,44 2118
+1,44 2119
+2207.5,13 2120
+2208.2,61 2121
+8,11 2121
+13,60 2121
+2,61 2121
+2,61 2121
+2,61 2122
+2209.2,12 2123
+2,16 2123
+2211.10,44 2124
+16,19 2124
+21,43 2124
+10,44 2124
+10,44 2124
+1,44 2124
+1,44 2125
+2212.5,13 2126
+2213.2,77 2127
+8,11 2127
+51,72 2127
+57,66 2127
+57,70 2127
+51,56 2127
+51,72 2127
+13,72 2127
+13,76 2127
+13,76 2128
+2,77 2127
+2,77 2127
+2,77 2129
+2214.2,77 2130
+8,11 2130
+51,72 2130
+57,66 2130
+57,70 2130
+51,56 2130
+51,72 2130
+13,72 2130
+13,76 2130
+13,76 2131
+2,77 2130
+2,77 2130
+2,77 2132
+2215.2,69 2133
+8,11 2133
+13,68 2133
+2,69 2133
+2,69 2133
+2,69 2134
+2216.2,12 2135
+2,16 2135
+2218.10,44 2136
+16,19 2136
+21,43 2136
+10,44 2136
+10,44 2136
+1,44 2136
+1,44 2137
+2219.5,13 2138
+2220.2,54 2139
+8,11 2139
+13,53 2139
+2,54 2139
+2,54 2139
+2,54 2140
+2221.2,52 2141
+8,11 2141
+13,51 2141
+2,52 2141
+2,52 2141
+2,52 2142
+2222.2,91 2143
+8,11 2143
+72,81 2143
+72,85 2143
+57,66 2143
+57,71 2143
+51,56 2143
+51,86 2143
+13,86 2143
+13,90 2143
+13,90 2144
+2,91 2143
+2,91 2143
+2,91 2145
+2223.2,61 2146
+8,11 2146
+13,60 2146
+2,61 2146
+2,61 2146
+2,61 2147
+2224.2,12 2148
+2,16 2148
+2226.10,44 2149
+16,19 2149
+21,43 2149
+10,44 2149
+10,44 2149
+1,44 2149
+1,44 2150
+2227.5,13 2151
+2228.16,25 2152
+12,26 2152
+2,26 2152
+2229.2,68 2153
+8,11 2153
+57,67 2153
+13,67 2153
+13,67 2154
+2,68 2153
+2,68 2153
+2,68 2155
+2231.0,1 2156
+2240.10,38 2157
+16,19 2157
+21,37 2157
+10,38 2157
+10,38 2157
+1,38 2157
+1,38 2158
+2241.10,37 2159
+16,19 2159
+21,36 2159
+10,37 2159
+10,37 2159
+1,37 2159
+1,37 2160
+2242.10,36 2161
+16,19 2161
+21,35 2161
+10,36 2161
+10,36 2161
+1,36 2161
+1,36 2162
+2243.10,36 2163
+16,19 2163
+21,35 2163
+10,36 2163
+10,36 2163
+1,36 2163
+1,36 2164
+2244.12,13 2165
+14,15 2165
+18,21 2165
+22,25 2165
+2245.8,9 2166
+1,9 2166
+2269.10,37 2167
+16,19 2167
+21,36 2167
+10,37 2167
+10,37 2167
+1,37 2167
+1,37 2168
+2270.10,38 2169
+16,19 2169
+21,37 2169
+10,38 2169
+10,38 2169
+1,38 2169
+1,38 2170
+2271.11,43 2171
+17,20 2171
+22,42 2171
+11,43 2171
+11,43 2171
+1,43 2171
+1,43 2172
+2272.11,42 2173
+17,20 2173
+22,41 2173
+11,42 2173
+11,42 2173
+1,42 2173
+1,42 2174
+2273.11,43 2175
+17,20 2175
+22,42 2175
+11,43 2175
+11,43 2175
+1,43 2175
+1,43 2176
+2274.7,13 2177
+1,17 2177
+2275.7,13 2178
+7,18 2178
+1,22 2178
+2276.1,15 2179
+2277.1,15 2180
+2278.5,12 2181
+2279.2,11 2182
+2280.2,10 2183
+2282.5,12 2184
+2283.2,11 2185
+2284.2,10 2186
+2286.1,64 2187
+7,10 2187
+35,43 2187
+12,43 2187
+12,54 2187
+55,63 2187
+12,63 2187
+12,63 2188
+12,63 2189
+1,64 2187
+1,64 2187
+1,64 2190
+2287.1,69 2191
+7,10 2191
+38,47 2191
+12,47 2191
+12,58 2191
+59,68 2191
+12,68 2191
+12,68 2192
+12,68 2193
+1,69 2191
+1,69 2191
+1,69 2194
+2288.1,21 2195
+7,10 2195
+12,20 2195
+1,21 2195
+1,21 2195
+1,21 2196
+2289.0,1 2197
+2293.1,8 2198
+2294.6,12 2199
+14,25 2200
+2295.6,17 2201
+6,17 2201
+2296.3,13 2202
+11,12 2202
+3,13 2202
+3,13 2202
+2297.7,13 2203
+2298.9,20 2204
+9,20 2204
+9,28 2204
+4,28 2204
+4,28 2205
+2299.7,13 2206
+2300.4,22 2207
+2301.4,9 2208
+2303.12,19 2209
+2304.4,19 2210
+2294.27,30 2211
+27,30 2211
+2307.5,12 2212
+2308.2,53 2213
+9,40 2213
+41,42 2213
+43,45 2213
+46,52 2213
+2,53 2213
+2,53 2213
+2309.0,1 2214
+2314.1,17 2215
+2315.7,17 2216
+2316.29,35 2217
+3,8 2217
+10,14 2217
+10,14 2218
+10,14 2219
+10,14 2220
+2317.6,17 2221
+6,17 2221
+6,24 2221
+6,32 2221
+6,32 2222
+2318.3,43 2223
+9,14 2223
+16,42 2223
+3,43 2223
+3,43 2223
+3,43 2224
+2319.10,11 2225
+3,11 2225
+3,11 2226
+3,11 2227
+2315.19,31 2228
+19,31 2228
+2323.1,23 2229
+2324.1,27 2230
+2325.1,26 2231
+2326.1,25 2232
+2327.1,51 2233
+22,28 2233
+30,31 2233
+33,41 2233
+43,50 2233
+1,51 2233
+2328.1,21 2234
+2329.1,39 2235
+12,13 2235
+14,21 2235
+23,29 2235
+31,38 2235
+1,39 2235
+2330.1,17 2236
+2331.1,12 2237
+2333.9,17 2238
+9,17 2238
+2338.9,16 2238
+9,16 2238
+2332.10,16 2238
+10,16 2238
+10,16 2238
+10,16 2238
+2334.7,18 2239
+2335.4,21 2240
+2336.4,14 2241
+4,14 2242
+4,14 2238
+2339.3,23 2243
+2340.7,13 2244
+2341.11,12 2245
+4,12 2245
+2342.7,14 2246
+2343.11,66 2247
+23,53 2247
+54,65 2247
+54,65 2247
+11,66 2247
+11,66 2247
+4,78 2247
+4,78 2247
+4,78 2248
+67,68 2247
+69,70 2247
+71,77 2247
+4,78 2247
+4,78 2247
+2344.7,14 2249
+23,28 2250
+26,27 2250
+23,28 2250
+23,28 2250
+16,28 2250
+2345.15,16 2251
+8,16 2251
+2352.13,30 2252
+23,24 2252
+26,29 2252
+13,30 2252
+13,30 2252
+1,30 2252
+2353.14,25 2253
+14,25 2253
+1,32 2253
+1,32 2254
+2355.13,30 2255
+31,42 2255
+13,42 2255
+1,49 2255
+1,49 2256
+2356.1,35 2257
+26,34 2257
+1,35 2257
+1,35 2257
+2357.1,12 2258
+2358.5,17 2259
+21,46 2259
+30,41 2259
+30,41 2259
+42,45 2259
+21,46 2259
+21,46 2259
+21,46 2259
+50,58 2259
+2359.27,38 2260
+19,38 2260
+2,57 2260
+2,57 2261
+2360.6,33 2262
+19,32 2262
+6,33 2262
+6,33 2262
+6,45 2262
+2361.3,13 2263
+2362.3,27 2264
+3,27 2265
+2364.7,33 2266
+17,28 2266
+17,28 2266
+29,32 2266
+7,33 2266
+7,33 2267
+2366.5,17 2268
+2367.2,16 2269
+2368.2,8 2270
+2372.1,16 2271
+2373.6,12 2272
+16,24 2272
+2374.22,33 2273
+14,33 2273
+2,52 2273
+2,52 2274
+2375.1,61 2275
+24,32 2275
+34,43 2275
+45,51 2275
+53,60 2275
+1,61 2275
+1,61 2275
+2376.4,14 2276
+2377.6,22 2277
+2378.3,25 2278
+15,24 2278
+3,25 2278
+3,25 2278
+2379.7,13 2279
+2380.3,17 2280
+2385.2,8 2281
+2382.3,30 2282
+13,24 2282
+13,24 2282
+26,29 2282
+3,30 2282
+2383.3,17 2283
+2385.2,8 2281
+2388.2,29 2284
+2389.6,21 2285
+2390.16,27 2286
+16,27 2286
+29,32 2286
+3,46 2286
+3,46 2287
+2391.20,78 2288
+39,46 2288
+48,50 2288
+52,61 2288
+63,77 2288
+20,78 2288
+20,78 2288
+2392.2,27 2289
+2393.2,37 2290
+15,16 2290
+18,25 2290
+27,36 2290
+2,37 2290
+2,37 2290
+2,37 2291
+2394.2,33 2292
+8,9 2292
+11,32 2292
+2,33 2292
+2,33 2292
+2,33 2293
+2395.7,15 2294
+23,34 2295
+17,34 2295
+2396.3,25 2296
+9,10 2296
+12,24 2296
+12,24 2296
+3,25 2296
+3,25 2296
+3,25 2297
+2395.36,41 2298
+36,41 2298
+2397.2,17 2299
+7,12 2299
+2,17 2299
+2,17 2299
+2398.2,18 2300
+8,13 2300
+2,18 2300
+2,18 2300
+2399.2,60 2301
+8,9 2301
+30,38 2301
+11,38 2301
+11,50 2301
+51,59 2301
+11,59 2301
+11,59 2302
+11,59 2303
+2,60 2301
+2,60 2301
+2,60 2304
+2400.2,31 2305
+15,16 2305
+18,22 2305
+23,26 2305
+27,30 2305
+2,31 2305
+2,31 2305
+2,31 2306
+2401.2,63 2307
+8,9 2307
+11,62 2307
+2,63 2307
+2,63 2307
+2,63 2308
+2402.2,62 2309
+8,9 2309
+11,61 2309
+2,62 2309
+2,62 2309
+2,62 2310
+2403.2,63 2311
+8,9 2311
+11,62 2311
+2,63 2311
+2,63 2311
+2,63 2312
+2404.2,58 2313
+8,9 2313
+11,57 2313
+2,58 2313
+2,58 2313
+2,58 2314
+2405.2,74 2315
+8,9 2315
+48,56 2315
+11,56 2315
+11,60 2315
+61,69 2315
+11,69 2315
+11,69 2316
+11,73 2315
+11,73 2317
+2,74 2315
+2,74 2315
+2,74 2318
+2406.2,15 2319
+2407.31,47 2320
+41,42 2320
+43,46 2320
+31,47 2320
+31,47 2320
+2,48 2320
+14,15 2320
+16,25 2320
+26,29 2320
+26,29 2320
+2,48 2320
+2409.2,11 2321
+2410.2,11 2322
+2411.12,42 2323
+18,19 2323
+21,41 2323
+12,42 2323
+12,42 2323
+2,42 2323
+2,42 2324
+2412.11,31 2325
+11,24 2325
+11,26 2325
+11,26 2326
+11,31 2325
+11,31 2325
+11,36 2325
+6,36 2325
+43,63 2327
+43,56 2327
+43,58 2327
+43,58 2328
+43,63 2327
+43,63 2327
+38,68 2327
+2413.11,31 2329
+11,24 2329
+11,26 2329
+11,26 2330
+11,31 2329
+11,31 2329
+6,31 2329
+33,58 2331
+38,51 2331
+38,53 2331
+38,53 2332
+33,58 2331
+33,58 2331
+2414.2,65 2333
+8,9 2333
+33,42 2333
+11,42 2333
+11,54 2333
+55,64 2333
+11,64 2333
+11,64 2334
+11,64 2335
+2,65 2333
+2,65 2333
+2,65 2336
+2415.2,19 2337
+13,14 2337
+15,16 2337
+17,18 2337
+2,19 2337
+2416.2,29 2338
+8,9 2338
+11,28 2338
+2,29 2338
+2,29 2338
+2,29 2339
+2417.2,16 2340
+2418.19,20 2341
+21,22 2341
+2419.2,28 2342
+21,22 2342
+24,27 2342
+2,28 2342
+2420.2,44 2343
+23,24 2343
+40,43 2343
+33,43 2343
+26,43 2343
+26,43 2343
+26,43 2344
+2,44 2343
+2423.10,16 2345
+10,20 2345
+10,20 2346
+10,20 2345
+2425.10,16 2345
+10,20 2345
+10,20 2347
+10,20 2345
+2427.13,20 2345
+13,20 2345
+2482.10,16 2345
+10,20 2345
+10,20 2348
+10,20 2345
+2483.9,15 2345
+9,15 2345
+2484.9,18 2345
+9,18 2345
+2422.16,22 2345
+16,22 2345
+16,22 2345
+16,22 2345
+2424.4,22 2349
+17,18 2349
+20,21 2349
+4,22 2349
+4,22 2345
+2426.4,22 2350
+16,17 2350
+19,21 2350
+4,22 2350
+4,22 2351
+4,22 2345
+2428.16,43 2352
+30,33 2352
+35,42 2352
+16,43 2352
+16,43 2352
+5,6 2352
+8,11 2352
+8,11 2353
+2429.9,15 2354
+9,15 2354
+2431.22,28 2355
+19,28 2355
+6,28 2355
+6,28 2356
+2432.6,2436.17 2357
+2432.39,46 2357
+2433.8,21 2357
+2434.16,27 2357
+8,27 2357
+8,33 2357
+8,52 2357
+8,52 2358
+2435.8,17 2357
+21,24 2357
+8,24 2357
+8,24 2357
+8,24 2359
+8,24 2360
+2436.8,16 2357
+2432.6,2436.17 2357
+2432.6,2436.17 2357
+2437.10,24 2361
+28,39 2361
+28,46 2361
+2438.28,47 2362
+34,42 2362
+43,46 2362
+28,47 2362
+28,47 2362
+28,49 2362
+18,26 2362
+7,50 2362
+2439.20,32 2363
+20,36 2363
+11,37 2363
+11,44 2363
+2440.20,31 2364
+20,31 2364
+20,37 2364
+8,37 2364
+8,37 2365
+2442.12,35 2366
+12,35 2366
+12,35 2366
+12,35 2366
+12,35 2366
+12,35 2366
+12,35 2366
+19,27 2366
+12,35 2366
+12,35 2366
+12,35 2367
+12,35 2366
+12,35 2366
+12,35 2366
+12,35 2366
+2443.8,25 2368
+2444.40,52 2369
+50,51 2369
+40,52 2369
+40,52 2369
+23,53 2369
+30,38 2369
+30,38 2369
+23,53 2369
+23,53 2369
+2445.11,20 2370
+2446.8,16 2371
+2447.12,27 2372
+2448.9,40 2373
+14,21 2373
+33,35 2373
+36,39 2373
+9,40 2373
+9,40 2373
+2449.12,27 2374
+2450.18,39 2375
+23,24 2375
+26,38 2375
+18,39 2375
+18,39 2375
+9,39 2375
+2451.12,19 2376
+2452.47,59 2377
+57,58 2377
+47,59 2377
+47,59 2377
+9,60 2377
+16,27 2377
+16,27 2377
+16,33 2377
+16,42 2377
+16,42 2378
+43,44 2377
+45,46 2377
+45,46 2377
+9,60 2377
+9,60 2377
+9,60 2379
+9,60 2380
+9,60 2381
+2453.9,14 2382
+2455.56,68 2383
+66,67 2383
+56,68 2383
+56,68 2383
+8,69 2383
+34,45 2383
+15,45 2383
+15,51 2383
+15,51 2384
+52,53 2383
+54,55 2383
+54,55 2383
+8,69 2383
+8,69 2383
+2457.12,18 2385
+2458.56,68 2386
+66,67 2386
+56,68 2386
+56,68 2386
+8,69 2386
+34,45 2386
+15,45 2386
+15,51 2386
+15,51 2387
+52,53 2386
+54,55 2386
+54,55 2386
+8,69 2386
+8,69 2386
+8,69 2388
+8,69 2389
+8,69 2390
+2459.7,12 2391
+7,12 2392
+7,12 2393
+7,12 2354
+2463.6,53 2394
+12,13 2394
+29,35 2394
+26,35 2394
+15,35 2394
+15,39 2394
+46,52 2394
+43,52 2394
+40,52 2394
+15,52 2394
+15,52 2395
+15,52 2396
+6,53 2394
+6,53 2394
+6,53 2397
+6,53 2354
+2465.6,19 2398
+6,19 2354
+2467.32,38 2399
+29,38 2399
+25,38 2399
+25,38 2400
+50,56 2399
+47,56 2399
+44,56 2399
+40,56 2399
+40,56 2401
+2469.10,19 2402
+2470.15,37 2403
+16,22 2403
+27,35 2403
+15,37 2403
+15,37 2403
+7,44 2403
+7,44 2403
+42,43 2403
+7,44 2403
+7,44 2403
+2471.7,60 2404
+13,14 2404
+37,50 2404
+16,50 2404
+16,59 2404
+16,59 2405
+7,60 2404
+7,60 2404
+7,60 2406
+2472.7,60 2407
+13,14 2407
+37,50 2407
+16,50 2407
+16,59 2407
+16,59 2408
+7,60 2407
+7,60 2407
+7,60 2409
+2473.7,24 2410
+7,24 2411
+2477.7,24 2412
+2478.7,20 2413
+7,20 2354
+7,20 2414
+7,20 2415
+7,20 2345
+7,20 2345
+7,20 2345
+2485.8,19 2416
+8,19 2417
+8,19 2418
+2486.5,10 2419
+2487.4,30 2420
+25,26 2420
+28,29 2420
+4,30 2420
+4,30 2420
+2488.8,16 2421
+20,24 2421
+20,31 2421
+2489.5,22 2422
+16,17 2422
+18,19 2422
+20,21 2422
+5,22 2422
+5,22 2423
+5,22 2424
+5,22 2345
+2491.2,16 2425
+14,15 2425
+2,16 2425
+2,16 2426
+2,16 2427
+2,16 2428
+2,16 2429
+2493.0,1 2430
+2497.12,31 2431
+22,30 2431
+12,31 2431
+12,31 2431
+2498.5,12 2432
+17,58 2432
+24,45 2432
+24,49 2432
+24,49 2433
+50,51 2432
+52,54 2432
+55,57 2432
+17,58 2432
+17,58 2432
+17,58 2432
+2499.10,13 2434
+14,15 2434
+2,16 2434
+2500.9,48 2435
+21,29 2435
+30,41 2435
+42,47 2435
+9,48 2435
+9,48 2435
+50,51 2435
+1,52 2435
+19
+aSys->Dir 3:26.1,39.2 64
+11
+0:name:28.2,6 s
+4:uid:29.2,5 s
+8:gid:30.2,5 s
+12:muid:31.2,6 s
+16:qid:32.2,5 @1
+
+32:mode:33.2,6 i
+36:atime:34.2,7 i
+40:mtime:35.2,7 i
+48:length:36.2,8 B
+56:dtype:37.2,7 i
+60:dev:38.2,5 i
+aSys->Qid 11.1,16.2 16
+3
+0:path:13.2,6 B
+8:vers:14.2,6 i
+12:qtype:15.2,7 i
+aDraw->Chans 9:70.1,82.2 4
+1
+0:desc:72.2,6 i
+aDraw->Rect 116.1,139.2 16
+2
+0:min:118.2,5 @4
+
+8:max:119.2,5 @4
+
+aDraw->Point 99.1,113.2 8
+2
+0:x:101.2,3 i
+4:y:102.2,3 i
+aTk->Toplevel 1:5.1,12.2 32
+5
+0:display:7.2,9 R@6
+
+4:wreq:8.2,6 Cs
+8:image:9.2,7 R@7
+
+12:ctxt:10.2,6 R@9
+
+16:screenr:11.2,9 @3
+
+aDraw->Display 9:201.1,230.2 20
+5
+0:image:203.2,7 R@7
+
+4:white:204.2,7 R@7
+
+8:black:205.2,7 R@7
+
+12:opaque:206.2,8 R@7
+
+16:transparent:207.2,13 R@7
+
+aDraw->Image 142.1,198.2 56
+8
+0:r:146.2,3 @3
+
+16:clipr:147.2,7 @3
+
+32:depth:148.2,7 i
+36:chans:149.2,7 @2
+
+40:repl:150.2,6 i
+44:display:151.2,9 R@6
+
+48:screen:152.2,8 R@8
+
+52:iname:153.2,7 s
+aDraw->Screen 249.1,263.2 16
+4
+0:id:251.2,4 i
+4:image:252.2,7 R@7
+
+8:fill:253.2,6 R@7
+
+12:display:254.2,9 R@6
+
+aDraw->Wmcontext 282.1,291.2 28
+7
+0:kbd:284.2,5 Ci
+4:ptr:285.2,5 CR@10
+
+8:ctl:286.2,5 Cs
+12:wctl:287.2,6 Cs
+16:images:288.2,8 CR@7
+
+20:connfd:289.2,8 R@11
+
+24:ctxt:290.2,6 R@12
+
+aDraw->Pointer 266.1,271.2 16
+3
+0:buttons:268.2,9 i
+4:xy:269.2,4 @4
+
+12:msec:270.2,6 i
+aSys->FD 3:45.1,48.2 4
+1
+0:fd:47.2,4 i
+aDraw->Context 9:274.1,279.2 12
+3
+0:display:276.2,9 R@6
+
+4:screen:277.2,8 R@8
+
+8:wm:278.2,4 Ct8.2
+0:t0:15,21 s
+4:t1:15,21 Ct8.2
+0:t0:32,38 s
+4:t1:32,38 R@9
+
+
+
+aMtype 0:1310.0,1312.1 8
+2
+0:text:1311.1,5 s
+4:com:7,10 s
+aDraw->Font 9:233.1,246.2 16
+4
+0:name:235.2,6 s
+4:height:236.2,8 i
+8:ascent:237.2,8 i
+12:display:238.2,9 R@6
+
+aAitem 0:201.0,206.1 28
+7
+0:pname:202.1,6 s
+4:desc:7,11 s
+8:dtype:203.1,6 i
+12:factory:7,14 i
+16:read:204.1,5 s
+20:location:7,15 s
+24:data:205.1,5 Lt8.2
+0:t0:16,22 s
+4:t1:16,22 i
+
+aBufio->Iobuf 6:16.1,50.2 48
+9
+0:fd:41.2,4 R@11
+
+4:buffer:42.2,8 Ab
+8:index:43.2,7 i
+12:size:44.2,6 i
+16:dirty:45.2,7 i
+24:bufpos:46.2,8 B
+32:filpos:47.2,8 B
+40:lastop:48.2,8 i
+44:mode:49.2,6 i
+aImgloaded 0:711.0,714.1 8
+2
+0:name:712.1,5 s
+4:imgtype:713.1,8 i
+aDaytime->Tm 4:5.1,16.2 40
+10
+0:sec:6.2,5 i
+4:min:7.2,5 i
+8:hour:8.2,6 i
+12:mday:9.2,6 i
+16:mon:10.2,5 i
+20:year:11.2,6 i
+24:wday:12.2,6 i
+28:yday:13.2,6 i
+32:zone:14.2,6 s
+36:tzoff:15.2,7 i
+75
+0:init
+2
+32:ctxt:0:56.5,9 R@12
+
+36:argv:31,35 Ls
+3
+40:runfrom:81.1,8 s
+44:p:82.1,2 i
+60:r:95.1,2 @3
+
+n131:getdesc
+1
+32:l:214.8,9 Ls
+1
+36:s:216.1,2 s
+Ls162:getabilities
+0
+15
+32:i:237.1,2 i
+36:s:240.2,3 s
+40:val:257.5,8 i
+44:fd:234.1,3 R@16
+
+48:k:253.9,10 i
+52:noitems:252.4,11 i
+56:take:239.2,6 i
+60:name:256.5,9 s
+80:n:242.3,4 i
+84:lst:6,9 Ls
+88:n2:255.6,8 i
+92:lst2:10,14 Ls
+52:max:276.4,7 i
+40:min:275.4,7 i
+48:mul:277.4,7 i
+n436:isat
+2
+32:s:311.5,6 s
+36:test:16,20 s
+2
+40:i:315.6,7 i
+44:num:313.1,4 i
+i460:isat2
+2
+32:s:321.6,7 s
+36:test:17,21 s
+2
+40:i:325.6,7 i
+44:num:323.1,4 i
+i482:nomatches
+1
+32:s:332.10,11 s
+3
+36:i:335.6,7 i
+40:n:334.1,2 i
+44:test:336.2,6 s
+i501:matches
+2
+32:s1:342.8,10 s
+36:s2:11,13 s
+0
+i515:biggestmatch
+3
+32:nm:349.13,15 i
+36:s:22,23 s
+40:l:33,34 i
+3
+44:bigmatch:351.1,9 s
+48:match:352.1,6 s
+52:p:356.2,3 i
+s539:getabllist
+0
+9
+32:i:367.6,7 i
+36:los:365.1,4 Ls
+40:p2:369.2,4 i
+44:nm:370.2,4 i
+48:p:368.2,3 i
+52:tmpl:373.3,7 Ls
+56:ar:392.1,3 As
+60:tmp:380.3,6 s
+64:listitem:388.3,11 s
+As613:buildabilitiesframes
+1
+32:top:400.21,24 R@5
+
+1
+36:k:405.6,7 i
+n698:buildabilitiesframe
+3
+32:top:421.20,23 R@5
+
+36:k:42,43 i
+40:chanout:50,57 s
+13
+44:frame:428.3,8 s
+48:i:425.6,7 i
+52:count2:424.1,7 i
+56:tmp:463.4,7 Lt8.2
+0:t0:205.16,22 s
+4:t1:16,22 i
+
+60:mul:443.5,8 i
+64:s:444.5,6 s
+68:max:454.4,7 i
+72:name:466.6,10 s
+76:val:12,15 i
+80:nm:423.1,3 s
+84:s:467.5,6 s
+60:row:464.4,7 i
+60:min:453.4,7 i
+n995:getvaluescreen
+2
+32:x:511.15,16 s
+36:y:17,18 s
+7
+40:top:515.2,5 R@5
+
+44:s:532.4,5 s
+48:inp:528.2,5 s
+52:tk1:518.6,9 i
+56:chanin:516.1,7 Cs
+60:s:524.2,3 i
+64:s:526.2,3 R@10
+
+i1125:infoscreen
+0
+10
+32:top:546.2,5 R@5
+
+36:titlebar:7,15 Cs
+40:s:556.2,3 s
+44:title:573.2,7 s
+48:tmp:547.1,4 Lt8.2
+0:t0:227.19,25 s
+4:t1:19,25 s
+
+52:infrow:553.1,7 i
+56:d1:557.3,5 s
+60:d2:6,8 s
+64:s:569.2,3 i
+68:s:571.2,3 R@10
+
+n1276:settingsscreen
+2
+32:k:582.15,16 i
+36:ctlchan:23,30 Ci
+12
+40:top:594.2,5 R@5
+
+44:titlebar:7,15 Cs
+48:i:604.6,7 i
+52:ltmp:617.2,6 Li
+56:l:603.1,2 Li
+60:low:584.1,4 Lt16.4
+0:t0:48.21,37 R@5
+
+4:t1:21,37 s
+8:t2:21,37 Li
+12:t3:21,37 i
+
+64:allread:602.1,8 i
+68:chanin:595.1,7 Cs
+72:err:601.1,4 i
+76:name:586.10,14 s
+80:pid:593.1,4 i
+84:tplvl:586.3,8 R@5
+
+n1416:settingsloop
+5
+32:top:630.13,16 R@5
+
+36:chanin:36,42 Cs
+40:titlebar:43,51 Cs
+44:k:69,70 i
+48:abls:77,81 Li
+10
+52:title:660.2,7 s
+56:ctlchan:635.1,8 Ci
+60:val:648.5,8 i
+64:inp:642.2,5 s
+68:pid:633.1,4 i
+72:s:638.2,3 i
+76:s:640.2,3 R@10
+
+104:n:644.4,5 i
+108:lst:7,10 Ls
+72:i:647.5,6 i
+n1563:clearbuffer
+1
+32:c:670.12,13 Cs
+3
+36:tc:672.1,3 Ci
+44:del:675.2,5 s
+48:tick:676.2,6 i
+n1578:timer
+1
+32:tick:681.6,10 Ci
+0
+n1584:getval
+2
+32:l:687.7,8 Lt8.2
+0:t0:19,25 s
+4:t1:19,25 i
+
+36:s:32,33 s
+2
+40:name:690.3,7 s
+44:val:8,11 i
+i1594:list2string
+1
+32:l:697.12,13 Ls
+1
+36:s:699.1,2 s
+s1609:nocamera
+0
+2
+32:n:728.2,3 i
+40:dir:4,7 @0
+
+i1618:startuptkstuff
+2
+32:top:733.15,18 R@5
+
+36:ctlchan:38,45 Ci
+3
+40:pid:735.1,4 i
+52:dirs:738.2,6 AR@0
+
+56:n:7,8 i
+n1648:tkstuff
+0
+34
+32:win:754.2,5 R@5
+
+36:titlebar:7,15 Cs
+40:title:853.2,7 s
+44:ctlchan:765.1,8 Ci
+48:butchan:760.1,8 Cs
+52:k:831.10,11 i
+56:tk1:762.6,9 i
+60:title:839.5,10 s
+64:val:802.5,8 i
+68:e:769.1,2 i
+72:err:858.3,6 s
+76:fname:873.3,8 s
+80:ftype:10,15 i
+84:inp:793.2,5 s
+88:s:789.2,3 i
+92:s:791.2,3 R@10
+
+96:si:841.5,7 s
+120:n:795.4,5 i
+124:lst:7,10 Ls
+128:n:860.5,6 i
+132:lst:8,11 Ls
+64:k:808.10,11 i
+88:i:837.5,6 i
+64:i:816.10,11 i
+64:k:843.10,11 i
+64:i:821.10,11 i
+88:i:829.5,6 i
+88:i:807.5,6 i
+88:i:825.5,6 i
+88:pid:868.18,21 i
+64:val:830.5,8 i
+88:i:801.5,6 i
+88:val:820.5,8 i
+88:nf:815.5,7 i
+n2095:dealwithcamera
+2
+32:win:881.15,18 R@5
+
+36:lst:38,41 Ls
+4
+40:ctlchan:883.1,8 Ci
+44:e:900.3,4 i
+44:i:917.3,4 i
+44:i:928.3,4 i
+n2241:refresh
+2
+32:top:942.8,11 R@5
+
+36:ctlchan:31,38 Ci
+1
+40:pid:944.1,4 i
+n2259:delete
+3
+32:top:950.7,10 R@5
+
+36:i:30,31 i
+40:ctlchan:38,45 Ci
+6
+44:loi:955.1,4 Li
+48:s:954.1,2 s
+52:k:958.7,8 i
+56:ok:953.1,3 i
+60:pid:952.1,4 i
+52:k:971.6,7 i
+n2384:delselect
+1
+32:n:1000.10,11 i
+1
+36:i:1002.6,7 i
+n2397:doselect
+1
+32:top:1007.9,12 R@5
+
+4
+36:i:1010.6,7 i
+40:n:1009.1,2 i
+44:col:1011.2,5 s
+48:s:1019.1,2 s
+n2433:takephoto
+2
+32:top:1024.10,13 R@5
+
+36:ctlchan:33,40 Ci
+5
+40:fd:1028.1,3 R@11
+
+44:i:1038.8,9 i
+48:e:1030.2,3 i
+52:n:1037.3,4 i
+56:pid:1026.1,4 i
+n2488:unnew
+2
+32:top:1049.6,9 R@5
+
+36:i:29,30 i
+1
+40:tmp:1053.1,4 Li
+n2516:refreshtime
+2
+32:top:1065.12,15 R@5
+
+36:ctlchan:35,42 Ci
+1
+40:pid:1067.1,4 i
+n2546:addtoplevel
+4
+32:top:1074.12,15 R@5
+
+36:name:35,39 s
+40:abls:49,53 Li
+44:pid:68,71 i
+3
+48:ltmp:1076.1,5 Lt16.4
+0:t0:48.21,37 R@5
+
+4:t1:21,37 s
+8:t2:21,37 Li
+12:t3:21,37 i
+
+52:isin:1077.1,5 i
+56:tplvl:1079.3,8 R@5
+
+n2569:deltoplevel
+1
+32:top:1086.12,15 R@5
+
+5
+36:ltmp:1088.1,5 Lt16.4
+0:t0:17,33 R@5
+
+4:t1:17,33 s
+8:t2:17,33 Li
+12:t3:17,33 i
+
+40:tplvl:1090.3,8 R@5
+
+44:nm:10,12 s
+48:loi:14,17 Li
+52:p:19,20 i
+n2587:resetcam
+3
+32:top:1097.9,12 R@5
+
+36:show:32,36 i
+40:ctlchan:43,50 Ci
+7
+44:i:1101.6,7 i
+48:ltmp:1104.2,6 Lt16.4
+0:t0:48.21,37 R@5
+
+4:t1:21,37 s
+8:t2:21,37 Li
+12:t3:21,37 i
+
+52:pid:1099.1,4 i
+56:tplvl:1106.4,9 R@5
+
+60:nm:11,13 s
+64:loi:15,18 Li
+68:p:20,21 i
+n2636:set
+4
+32:top:1116.4,7 R@5
+
+36:i:27,28 i
+40:s:35,36 s
+44:ctlchan:46,53 Ci
+4
+48:val:1121.1,4 s
+52:mul:1129.3,6 i
+56:pid:1118.1,4 i
+52:e:1137.1,2 i
+n2706:setstate
+2
+32:i:1144.9,10 i
+36:val:17,20 s
+1
+40:fd:1146.1,3 R@11
+
+i2732:getabl
+1
+32:pname:1163.7,12 s
+1
+36:i:1165.6,7 i
+i2742:getstate
+2
+32:top:1170.9,12 R@5
+
+36:i:32,33 i
+6
+40:fd:1172.1,3 R@11
+
+44:fdi:1176.2,5 R@16
+
+48:s:1178.3,4 s
+52:val:1181.4,7 s
+72:n:1180.5,6 i
+76:lst:7,10 Ls
+i2799:setmystate
+3
+32:top:1191.11,14 R@5
+
+36:i:34,35 i
+40:val:42,45 s
+1
+44:mul:1197.2,5 i
+n2843:refreshfilelist
+2
+32:win:1209.16,19 R@5
+
+36:refresh:39,46 i
+22
+40:i:1221.6,7 i
+44:si:1248.2,4 s
+48:col:1231.1,4 i
+52:nocols:1232.1,7 i
+56:k:1242.7,8 i
+60:row:1230.1,4 i
+64:si:1222.2,4 s
+68:size:1290.1,5 s
+72:w:1234.1,2 i
+76:width:1298.1,6 s
+80:fd:1212.2,4 R@11
+
+84:isnew:1241.2,7 i
+88:oldlist:1220.1,8 As
+92:thisw:1263.2,7 i
+96:dirs:1226.2,6 AR@0
+
+100:n:7,8 i
+104:height:1297.1,7 s
+108:w1:1233.1,3 i
+136:e:1256.2,3 s
+92:colsize:1299.1,8 i
+84:csize:1291.1,6 i
+56:rsize:1292.1,6 i
+i3273:tkcmd
+2
+32:top:1323.6,9 R@5
+
+36:cmd:29,32 s
+1
+40:e:1332.1,2 s
+s3321:loadnewthumb
+2
+32:top:1337.13,16 R@5
+
+36:ctlchan:36,43 Ci
+2
+40:tmp:1342.6,9 Li
+44:pid:1339.1,4 i
+n3346:loadthumb
+3
+32:top:1347.10,13 R@5
+
+36:i:33,34 i
+40:ctlchan:41,48 Ci
+2
+44:k:1352.7,8 i
+48:pid:1349.1,4 i
+n3378:loadthumbnail
+2
+32:top:1360.14,17 R@5
+
+36:i:37,38 i
+10
+40:fd:1362.1,3 R@11
+
+44:image:1374.1,6 R@7
+
+48:n:1389.2,3 i
+52:x:1394.2,3 i
+56:x1:1397.2,4 i
+60:y:1395.2,3 i
+64:y1:1398.2,4 i
+68:h:1396.2,3 i
+72:si:1386.2,4 s
+100:p:1384.2,3 @4
+
+i3600:isloaded
+2
+32:name:1406.9,13 s
+36:ftype:23,28 i
+2
+40:tmp:1408.1,4 L@17
+
+44:ic:1410.2,4 @17
+
+i3612:delloaded
+2
+32:name:1417.10,14 s
+36:ftype:24,29 i
+2
+40:tmp:1419.1,4 L@17
+
+60:ic:1422.2,4 @17
+
+n3634:dialog
+4
+32:msg:1431.7,10 s
+36:diagtype:20,28 i
+40:img:30,33 i
+44:r:40,41 @3
+
+10
+60:win:1441.2,5 R@5
+
+64:titlebar:7,15 Cs
+68:title:1439.1,6 s
+72:tmpimg:1437.1,7 R@7
+
+76:diagchan:1442.1,9 Cs
+80:fd:1449.2,4 R@11
+
+84:inp:1476.2,5 s
+88:out:1438.1,4 i
+92:s:1472.2,3 i
+96:s:1474.2,3 R@10
+
+i3850:mainscreen
+3
+32:win:1522.11,14 R@5
+
+36:opt:34,37 i
+40:ctlchan:44,51 Ci
+5
+44:lst:1534.1,4 Li
+48:tk1:1527.7,10 i
+52:pid:1524.1,4 i
+76:height:1540.2,8 s
+80:width:1541.2,7 s
+n3952:kill
+1
+32:pid:1548.5,8 i
+1
+36:pctl:1550.1,5 R@11
+
+n3968:gettime
+1
+32:win:1555.8,11 R@5
+
+4
+36:s:1561.2,3 s
+40:tm:1564.3,5 R@18
+
+44:fdi:1559.1,4 R@16
+
+48:time:1565.3,7 s
+n4059:addzeros
+1
+32:s:1580.9,10 s
+4
+36:i:1586.6,7 i
+40:rs:1583.1,3 s
+44:isnum:1585.1,6 i
+48:start:1584.1,6 i
+s4098:samedate
+1
+32:win:1600.9,12 R@5
+
+2
+36:s1:1602.1,3 s
+40:s2:1603.1,3 s
+i4126:settime
+0
+2
+32:tm:1611.1,3 R@18
+
+36:fd:1612.1,3 R@11
+
+n4163:getstore
+1
+32:win:1619.9,12 R@5
+
+6
+36:i:1623.6,7 i
+40:fdi:1621.1,4 R@16
+
+44:s:1624.3,4 s
+48:val:1628.4,7 s
+68:n:1627.5,6 i
+72:lst:7,10 Ls
+n4230:contains
+2
+32:s:1639.9,10 s
+36:test:20,24 s
+2
+40:i:1643.6,7 i
+44:num:1641.1,4 i
+i4253:multidownload
+0
+4
+32:s:1658.1,2 s
+36:getpath:1651.1,8 s
+40:k:1659.6,7 i
+44:e:1661.3,4 i
+n4303:dnld
+2
+32:i:1679.5,6 i
+36:path:13,17 s
+8
+40:chanout:1683.1,8 Cs
+44:ctlchan:1681.1,8 Ci
+48:ctlchans:1682.1,9 Cs
+52:s:1688.2,3 s
+56:e:1700.2,3 i
+60:pid:1686.1,4 i
+72:n:1692.6,7 i
+76:lst:8,11 Ls
+i4360:filelenrefresh
+1
+32:filename:1708.15,23 s
+3
+36:fd:1710.1,3 R@11
+
+40:n:1713.3,4 i
+48:dir:6,9 @0
+
+i4382:testfilesize
+1
+32:filename:1721.13,21 s
+4
+36:ctlchan:1728.2,9 Ci
+40:e:1723.1,2 i
+44:e2:1725.2,4 i
+48:e3:1730.2,4 i
+i4414:waittilready
+2
+32:filename:1739.13,21 s
+36:ctlchan:31,38 Ci
+1
+40:pid:1741.1,4 i
+n4438:download
+5
+32:i:1751.9,10 i
+36:path:17,21 s
+40:ctlchan:31,38 Ci
+44:ctlchans:53,61 Cs
+48:chanout:63,70 Cs
+19
+52:savename:1755.1,9 s
+56:filesize:1792.1,9 i
+60:n:1824.1,2 i
+64:read:1808.1,5 i
+68:fd2:1811.1,4 R@11
+
+72:buf:1810.1,4 Ab
+76:fd3:1811.6,9 R@11
+
+80:cached:1793.1,7 i
+84:cachename:1812.1,10 s
+88:fd:1802.1,3 R@11
+
+92:filename:1791.1,9 s
+96:rlen:1829.2,6 i
+100:cachefilename:1795.2,15 s
+104:confirm:1775.1,8 i
+108:n2:1839.3,5 i
+112:written:1837.2,9 i
+116:cancel:1809.1,7 i
+120:p:1788.1,2 i
+124:sout:1834.2,6 s
+n4700:downloadscreen
+4
+32:r:1881.15,16 @3
+
+48:i:24,25 i
+52:ctlchans:32,40 Cs
+56:chanin:42,48 Cs
+15
+60:top:1885.2,5 R@5
+
+64:tmpimg:1896.1,7 R@7
+
+68:text:1923.2,6 s
+72:imgbg:1887.1,6 R@7
+
+76:tk1:1894.6,9 i
+80:w:1902.2,3 i
+84:black:1888.1,6 R@7
+
+88:h:1903.2,3 i
+92:imgfg:1890.1,6 R@7
+
+96:s:1921.2,3 R@10
+
+100:white:1889.1,6 R@7
+
+128:progr:1886.1,6 @3
+
+144:oldcoords:1913.1,10 @3
+
+80:val:1930.4,7 i
+80:s:1919.2,3 i
+n4987:centrewin
+3
+32:top:1944.10,13 R@5
+
+36:r:33,34 @3
+
+52:first:42,47 i
+6
+56:s:1946.1,2 s
+60:tmp:1951.1,4 s
+64:h:1950.1,2 i
+68:px:1956.1,3 i
+72:py:1957.1,3 i
+76:w:1949.1,2 i
+n5042:workingscreen2
+4
+32:r:1975.15,16 @3
+
+48:pid:25,28 i
+52:ctlchan:35,42 Ci
+56:loading:57,64 i
+10
+60:top:1977.2,5 R@5
+
+64:chanin:1978.1,7 Cs
+68:tk1:1980.6,9 i
+72:inp:2019.2,5 s
+76:h:1987.3,4 i
+80:s:2017.2,3 R@10
+
+84:w:1986.3,4 i
+76:h:1998.3,4 i
+84:s:2015.2,3 i
+84:w:1997.3,4 i
+n5226:workingupdate
+2
+32:top:2032.14,17 R@5
+
+36:chanout:37,44 Cs
+4
+40:i:2043.7,8 i
+44:show:2034.1,5 As
+64:hidden:2041.1,7 i
+68:oldcoords:2040.1,10 @3
+
+n5274:resizemain
+2
+32:top:2059.11,14 R@5
+
+36:init:34,38 i
+14
+40:w:2061.4,5 i
+44:h:1,2 i
+48:ws:2084.1,3 i
+52:hs:2095.1,3 i
+56:ht:2077.1,3 i
+60:hmax:2092.1,5 i
+64:hmb:2097.1,4 i
+68:wc2:2101.1,4 i
+72:hc1:2103.1,4 i
+76:wc1:2104.1,4 i
+80:wsb:2081.1,4 i
+108:hf:2079.1,3 i
+112:wf:2080.1,3 i
+116:r:2072.2,3 @3
+
+n5482:growwidth
+2
+32:top:2117.10,13 R@5
+
+36:wc2:33,36 i
+1
+40:ws:2119.1,3 i
+n5590:growheight
+2
+32:top:2146.11,14 R@5
+
+36:hc2:34,37 i
+2
+40:hs:2148.1,3 i
+44:hsc:2156.2,5 i
+n5690:shrinkheight
+2
+32:top:2171.13,16 R@5
+
+36:hc2:36,39 i
+2
+40:hs:2173.1,3 i
+44:hsc:2183.2,5 i
+n5785:shrinkwidth
+2
+32:top:2196.12,15 R@5
+
+36:wc2:35,38 i
+3
+40:ws:2198.1,3 i
+44:wib:2199.1,4 i
+48:diff:2201.2,6 i
+n5932:getcoords
+1
+32:top:2238.10,13 R@5
+
+5
+36:x:2242.1,2 i
+40:y:2243.1,2 i
+44:h:2240.1,2 i
+48:w:2241.1,2 i
+60:r:2244.1,2 @3
+
+@3
+5966:resizeview
+3
+32:top:2267.11,14 R@5
+
+36:wp:34,36 i
+40:hp:37,39 i
+9
+44:h:2270.1,2 i
+48:hc:2275.1,3 i
+52:hpc:2277.1,4 i
+56:w:2269.1,2 i
+60:wc:2274.1,3 i
+64:wpc:2276.1,4 i
+68:hs:2271.1,3 i
+72:ht:2273.1,3 i
+76:ws:2272.1,3 i
+n6045:multiview
+0
+3
+32:k:2294.6,7 i
+36:s:2293.1,2 s
+40:e:2296.3,4 i
+n6076:vw
+1
+32:i:2311.3,4 i
+11
+36:chanout:2325.1,8 Cs
+40:low:2314.1,4 Lt16.4
+0:t0:48.21,37 R@5
+
+4:t1:21,37 s
+8:t2:21,37 Li
+12:t3:21,37 i
+
+44:ctlchan:2323.1,8 Ci
+48:e:2338.2,3 i
+52:chanin:2326.1,7 Cs
+56:ctlchans:2324.1,9 Cs
+60:killed:2331.1,7 i
+64:name:2316.10,14 s
+68:s:2333.2,3 s
+72:tplvl:2316.3,8 R@5
+
+96:pid:2330.1,4 i
+i6160:view
+4
+32:i:2350.5,6 i
+36:ctlchan:13,20 Ci
+40:chanin:35,41 Cs
+44:chanout:43,50 Cs
+32
+48:t:2391.3,4 R@5
+
+52:titlechan:6,15 Cs
+56:savename:2432.6,14 s
+60:ftype:2431.6,11 s
+64:cachepath:2372.1,10 s
+68:img:2371.1,4 R@7
+
+72:s:2482.3,4 s
+76:h:2398.2,3 i
+80:w:2397.2,3 i
+84:cached:2357.1,7 i
+88:filename:2355.1,9 s
+92:filesize:2356.1,9 i
+96:h1:2409.2,4 i
+100:scrolling:2417.2,11 i
+104:tk1:2395.7,10 i
+108:w1:2410.2,4 i
+112:butchan:2392.2,9 Cs
+116:cachefilename:2359.2,15 s
+120:fd:2444.8,10 R@11
+
+124:cancel:12,18 i
+128:ht:2411.2,4 i
+132:titlename:2353.1,10 s
+136:e:2487.4,5 s
+140:inp:2427.3,6 s
+144:s:2423.3,4 i
+148:s:2425.3,4 R@10
+
+176:n:2428.5,6 i
+180:lst:8,11 Ls
+184:newpoint:2467.6,14 @4
+
+192:origin:2418.2,8 @4
+
+216:diff:2470.7,11 @4
+
+144:n2:2446.8,10 i
+n6707:create
+2
+32:filename:2495.7,15 s
+36:co:25,27 @3
+
+2
+56:n:2497.2,3 i
+64:dir:4,7 @0
+
+t8.2
+0:t0:2495.37,48 R@11
+
+4:t1:37,48 i
+51
+1580:abilities:212.0,9 A@15
+
+1588:ablmenu:228.0,7 As
+1624:bufio:16.1,6 mBufio
+6:1.0,57.1 0
+
+1684:context:0:30.0,7 R@12
+
+1688:coords:37.0,6 @3
+
+1704:ctime:2233.7,12 s
+1720:daytime:12.1,8 mDaytime
+4:1.0,53.1 0
+
+1740:display:0:29.0,7 R@6
+
+1752:downloadscr:1870.0,11 As
+1756:draw:24.1,5 mDraw
+9:1.0,298.1 0
+
+1772:filelist:0:717.0,8 As
+1776:fnew:721.0,4 Li
+1796:font:40.0,4 R@14
+
+1816:getvaluescr:488.0,11 As
+1960:hfs:2235.0,3 i
+1964:imgloaded:722.0,9 L@17
+
+1968:inflist:227.0,7 Lt8.2
+0:t0:19,25 s
+4:t1:19,25 s
+
+2028:loadimg:50.0,7 R@7
+
+2032:ltime:2233.0,5 s
+2040:maxsize:45.0,7 @4
+
+2048:menu:1314.0,4 A@13
+
+2076:nilrect:46.0,7 @3
+
+2092:noabilities:211.0,11 i
+2100:nofiles:716.0,7 i
+2104:noselected:720.0,10 i
+2108:nothumbs:724.0,8 i
+2184:processing:36.0,10 i
+2188:procimg:49.0,7 R@7
+
+2208:readdir:14.1,8 mReaddir
+5:1.0,19.1 0
+
+2212:readjpg:0:27.1,8 mReadjpg
+10:1.0,95.1 0
+
+2216:reducew:0:2236.0,7 Ai
+2228:runwithoutcam:47.0,13 i
+2244:scrollx:2056.0,7 i
+2248:scrolly:2057.0,7 i
+2252:selected:719.0,8 Ai
+2256:selectfile:19.1,11 mSelectfile
+7:1.0,13.1 0
+
+2268:snapscr:0:1496.0,7 As
+2276:ssize:44.0,5 i
+2288:str:22.1,4 mString
+8:1.0,39.1 0
+
+2292:sys:0:10.1,4 mSys
+3:4.0,160.1 0
+
+2304:thumbimg:0:718.0,8 AR@7
+
+2308:thumbscr:133.0,8 As
+2312:tibuild:745.0,7 i
+2316:tk:6.1,3 mTk
+1:1.0,25.1 0
+
+2324:tkclient:0:8.1,9 mTkclient
+2:1.0,26.1 0
+
+2344:toplevels:0:48.0,9 Lt16.4
+0:t0:21,37 R@5
+
+4:t1:21,37 s
+8:t2:21,37 Li
+12:t3:21,37 i
+
+2352:usecache:34.0,8 i
+2368:viewscr:2248.0,7 As
+2372:wfs:2234.0,3 i
+2380:working:35.0,7 i
+2384:workingscr2:1962.0,11 As
diff --git a/appl/demo/chat/chat.b b/appl/demo/chat/chat.b
new file mode 100644
index 00000000..fe0d4fbf
--- /dev/null
+++ b/appl/demo/chat/chat.b
@@ -0,0 +1,203 @@
+implement Chat;
+
+include "sys.m";
+ sys: Sys;
+
+include "draw.m";
+ draw: Draw;
+
+include "tk.m";
+ tk: Tk;
+
+include "tkclient.m";
+ tkclient: Tkclient;
+
+Chat: module {
+ init: fn(ctxt: ref Draw->Context, args: list of string);
+};
+
+stderr: ref Sys->FD;
+
+tksetup := array [] of {
+ "frame .f",
+ "text .f.t -state disabled -wrap word -yscrollcommand {.f.sb set}",
+ "scrollbar .f.sb -orient vertical -command {.f.t yview}",
+ "entry .e -bg white",
+ "bind .e <Key-\n> {send cmd send}",
+ "pack .f.sb -in .f -side left -fill y",
+ "pack .f.t -in .f -side left -fill both -expand 1",
+ "pack .f -side top -fill both -expand 1",
+ "pack .e -side bottom -fill x",
+ "pack propagate . 0",
+ "update",
+};
+
+init(ctxt: ref Draw->Context, args: list of string)
+{
+ sys = load Sys Sys->PATH;
+ sys->pctl(Sys->NEWPGRP, nil);
+ stderr = sys->fildes(2);
+
+ draw = load Draw Draw->PATH;
+ if (draw == nil)
+ badmodule(Draw->PATH);
+
+ tk = load Tk Tk->PATH;
+ if (tk == nil)
+ badmodule(Tk->PATH);
+
+ tkclient = load Tkclient Tkclient->PATH;
+ if (tkclient == nil)
+ badmodule(Tkclient->PATH);
+
+
+ if (args == nil || tl args == nil) {
+ sys->fprint(stderr, "usage: chat [servicedir]\n");
+ raise "fail:init";
+ }
+ args = tl args;
+
+ servicedir := ".";
+ if(args != nil)
+ servicedir = hd args;
+
+ tkclient->init();
+ (win, winctl) := tkclient->toplevel(ctxt, nil, "Chat", Tkclient->Appl);
+
+ cmd := chan of string;
+ tk->namechan(win, cmd, "cmd");
+ tkcmds(win, tksetup);
+ tkcmd(win, ". configure -height 300");
+ fittoscreen(win);
+ tkclient->onscreen(win, nil);
+ tkclient->startinput(win, "kbd"::"ptr"::nil);
+
+ msgs := chan of string;
+ conn := chan of (string, ref Sys->FD);
+ spawn connect(servicedir, msgs, conn);
+ msgsfd: ref Sys->FD;
+
+ for (;;) alt {
+ (e, fd) := <-conn =>
+ if (msgsfd == nil) {
+ if (e == nil) {
+ output(win, "*** connected");
+ msgsfd = fd;
+ } else
+ output(win, "*** " + e);
+ } else {
+ output(win, "*** disconnected");
+ msgsfd = nil;
+ }
+
+ txt := <-msgs =>
+ output(win, txt);
+
+ <- cmd =>
+ msg := tkcmd(win, ".e get");
+ if (msgsfd != nil && msg != nil) {
+ tkcmd(win, ".f.t see end");
+ tkcmd(win, ".e delete 0 end");
+ tkcmd(win, "update");
+ d := array of byte msg;
+ sys->write(msgsfd, d, len d);
+ }
+
+ s := <-win.ctxt.kbd =>
+ tk->keyboard(win, s);
+ s := <-win.ctxt.ptr =>
+ tk->pointer(win, *s);
+ s := <-win.ctxt.ctl or
+ s = <-win.wreq or
+ s = <-winctl =>
+ tkclient->wmctl(win, s);
+ }
+}
+
+err(s: string)
+{
+ sys->fprint(stderr, "chat: %s\n", s);
+ raise "fail:err";
+}
+
+badmodule(path: string)
+{
+ err(sys->sprint("can't load module %s: %r", path));
+}
+
+tkcmds(t: ref Tk->Toplevel, cmds: array of string)
+{
+ for (i := 0; i < len cmds; i++)
+ tkcmd(t, cmds[i]);
+}
+
+tkcmd(t: ref Tk->Toplevel, cmd: string): string
+{
+ s := tk->cmd(t, cmd);
+ if (s != nil && s[0] == '!')
+ sys->fprint(stderr, "chat: tk error: %s [%s]\n", s, cmd);
+ return s;
+}
+
+connect(dir: string, msgs: chan of string, conn: chan of (string, ref Sys->FD))
+{
+ srvpath := dir+"/msgs";
+ msgsfd := sys->open(srvpath, Sys->ORDWR);
+ if(msgsfd == nil) {
+ conn <-= (sys->sprint("internal error: can't open %s: %r", srvpath), nil);
+ return;
+ }
+ conn <-= (nil, msgsfd);
+ buf := array[Sys->ATOMICIO] of byte;
+ while((n := sys->read(msgsfd, buf, len buf)) > 0)
+ msgs <-= string buf[0:n];
+ conn <-= (nil, nil);
+}
+
+firstmsg := 1;
+output(win: ref Tk->Toplevel, txt: string)
+{
+ if (firstmsg)
+ firstmsg = 0;
+ else
+ txt = "\n" + txt;
+ yview := tkcmd(win, ".f.t yview");
+ (nil, toks) := sys->tokenize(yview, " ");
+ toks = tl toks;
+
+ tkcmd(win, ".f.t insert end '" + txt);
+ if (hd toks == "1")
+ tkcmd(win, ".f.t see end");
+ tkcmd(win, "update");
+}
+
+KEYBOARDH: con 90;
+
+fittoscreen(win: ref Tk->Toplevel)
+{
+ Point, Rect: import draw;
+ if (win.image == nil || win.image.screen == nil)
+ return;
+ r := win.image.screen.image.r;
+ scrsize := Point((r.max.x - r.min.x), (r.max.y - r.min.y)- KEYBOARDH);
+ bd := int tkcmd(win, ". cget -bd");
+ winsize := Point(int tkcmd(win, ". cget -actwidth") + bd * 2, int tkcmd(win, ". cget -actheight") + bd * 2);
+ if (winsize.x > scrsize.x)
+ tkcmd(win, ". configure -width " + string (scrsize.x - bd * 2));
+ if (winsize.y > scrsize.y)
+ tkcmd(win, ". configure -height " + string (scrsize.y - bd * 2));
+ actr: Rect;
+ actr.min = Point(int tkcmd(win, ". cget -actx"), int tkcmd(win, ". cget -acty"));
+ actr.max = actr.min.add((int tkcmd(win, ". cget -actwidth") + bd*2,
+ int tkcmd(win, ". cget -actheight") + bd*2));
+ (dx, dy) := (actr.dx(), actr.dy());
+ if (actr.max.x > r.max.x)
+ (actr.min.x, actr.max.x) = (r.min.x - dx, r.max.x - dx);
+ if (actr.max.y > r.max.y)
+ (actr.min.y, actr.max.y) = (r.min.y - dy, r.max.y - dy);
+ if (actr.min.x < r.min.x)
+ (actr.min.x, actr.max.x) = (r.min.x, r.min.x + dx);
+ if (actr.min.y < r.min.y)
+ (actr.min.y, actr.max.y) = (r.min.y, r.min.y + dy);
+ tkcmd(win, ". configure -x " + string actr.min.x + " -y " + string actr.min.y);
+}
diff --git a/appl/demo/chat/chat.dis b/appl/demo/chat/chat.dis
new file mode 100644
index 00000000..9dd3a3a3
--- /dev/null
+++ b/appl/demo/chat/chat.dis
Binary files differ
diff --git a/appl/demo/chat/chat.sbl b/appl/demo/chat/chat.sbl
new file mode 100644
index 00000000..860c56d7
--- /dev/null
+++ b/appl/demo/chat/chat.sbl
@@ -0,0 +1,695 @@
+limbo .sbl 2.1
+Chat
+5
+chat.b
+sys.m
+draw.m
+tk.m
+tkclient.m
+462
+37.1,25 0
+38.1,29 1
+11,23 1
+25,28 1
+1,29 1
+1,29 1
+39.1,24 2
+22,23 2
+1,24 2
+1,24 2
+41.1,28 3
+42.5,16 4
+43.2,23 5
+12,22 5
+2,23 5
+45.1,22 6
+46.5,14 7
+47.2,21 8
+12,20 8
+2,21 8
+49.1,40 9
+50.5,20 10
+51.2,27 11
+12,26 11
+2,27 11
+54.5,16 12
+20,27 12
+20,34 12
+20,34 13
+55.2,51 14
+14,20 14
+22,50 14
+2,51 14
+2,51 14
+56.2,19 15
+58.1,15 16
+60.1,18 17
+61.4,15 18
+62.2,22 19
+64.1,17 20
+1,17 20
+65.18,71 21
+37,41 21
+43,46 21
+48,54 21
+56,70 21
+18,71 21
+18,71 21
+67.1,22 22
+68.1,30 23
+14,17 23
+19,22 23
+24,29 23
+1,30 23
+1,30 23
+1,30 24
+69.1,21 25
+8,11 25
+13,20 25
+1,21 25
+70.1,38 26
+7,10 26
+12,37 26
+1,38 26
+1,38 26
+1,38 27
+71.1,17 28
+13,16 28
+1,17 28
+72.1,29 29
+20,23 29
+25,28 29
+1,29 29
+73.1,45 30
+22,25 30
+41,44 30
+34,44 30
+27,44 30
+27,44 30
+27,44 31
+1,45 30
+75.1,23 32
+76.1,38 33
+77.1,38 34
+15,25 34
+27,31 34
+33,37 34
+1,38 34
+81.14,18 35
+14,18 35
+93.10,14 35
+10,14 35
+96.4,7 35
+4,7 35
+106.8,16 35
+8,20 35
+8,20 36
+8,20 35
+108.8,16 35
+8,20 35
+8,20 37
+8,20 35
+110.8,16 35
+8,20 35
+8,20 38
+8,20 35
+111.7,15 35
+7,15 35
+112.7,13 35
+7,13 35
+80.10,16 35
+10,16 35
+10,16 35
+10,16 35
+81.12,18 35
+12,18 39
+12,18 40
+82.6,19 41
+83.7,15 42
+84.4,32 43
+11,14 43
+16,31 43
+4,32 43
+85.4,15 44
+4,15 45
+87.4,27 46
+11,14 46
+16,26 46
+4,27 46
+4,27 47
+89.3,34 48
+10,13 48
+15,33 48
+3,34 48
+90.3,15 49
+3,15 50
+3,15 51
+3,15 52
+3,15 35
+94.2,18 53
+9,12 53
+14,17 53
+2,18 53
+2,18 54
+2,18 35
+2,18 55
+97.2,29 56
+15,18 56
+20,28 56
+2,29 56
+2,29 56
+98.6,19 57
+23,33 57
+99.3,29 58
+9,12 58
+14,28 58
+3,29 58
+3,29 58
+3,29 59
+100.3,32 60
+9,12 60
+14,31 60
+3,32 60
+3,32 60
+3,32 61
+101.3,23 62
+9,12 62
+14,22 62
+3,23 62
+3,23 62
+3,23 63
+102.3,25 64
+103.3,31 65
+14,20 65
+22,23 65
+25,30 65
+3,31 65
+3,31 65
+3,31 66
+3,31 67
+3,31 35
+107.2,22 68
+15,18 68
+20,21 68
+2,22 68
+2,22 35
+109.2,22 69
+14,17 69
+19,21 69
+2,22 69
+2,22 70
+2,22 35
+2,22 35
+2,22 35
+113.2,25 71
+18,21 71
+23,24 71
+2,25 71
+2,25 71
+2,25 72
+2,25 73
+2,25 35
+119.1,37 74
+13,19 74
+21,33 74
+35,36 74
+1,37 74
+1,37 74
+120.1,17 75
+125.5,50 76
+17,43 76
+45,49 76
+5,50 76
+5,50 76
+1,51 76
+1,51 76
+1,51 77
+1,51 76
+126.0,1 78
+130.6,12 79
+18,26 80
+14,26 80
+131.2,19 81
+8,9 81
+11,18 81
+11,18 81
+2,19 81
+2,19 81
+2,19 82
+130.28,31 83
+28,31 83
+132.0,1 84
+136.1,21 85
+14,15 85
+17,20 85
+1,21 85
+1,21 85
+137.5,13 86
+17,21 86
+17,28 86
+138.2,58 87
+14,20 87
+22,49 87
+51,52 87
+54,57 87
+2,58 87
+2,58 87
+139.8,9 88
+1,9 88
+144.1,23 89
+145.1,41 90
+21,28 90
+30,40 90
+1,41 90
+1,41 90
+146.4,17 91
+147.12,69 92
+24,59 92
+61,68 92
+12,69 92
+12,69 92
+71,74 92
+2,75 92
+2,75 93
+2,75 94
+148.2,8 95
+150.11,14 96
+16,22 96
+1,23 96
+1,23 97
+1,23 98
+151.1,36 99
+152.7,45 100
+23,29 100
+31,34 100
+36,43 100
+7,45 100
+7,45 100
+7,45 100
+7,49 100
+153.18,21 101
+18,26 101
+11,26 101
+2,26 101
+2,26 102
+2,26 102
+154.11,14 103
+16,19 103
+1,20 103
+1,20 104
+1,20 105
+155.0,1 106
+160.5,13 107
+161.2,14 108
+2,14 109
+163.2,18 110
+164.1,34 111
+16,19 111
+21,33 111
+1,34 111
+1,34 111
+165.16,41 112
+30,35 112
+37,40 112
+16,41 112
+16,41 112
+7,11 112
+7,11 113
+166.1,15 114
+168.1,38 115
+7,10 115
+12,37 115
+1,38 115
+1,38 115
+1,38 116
+169.5,12 117
+5,19 117
+5,19 118
+170.2,28 119
+8,11 119
+13,27 119
+2,28 119
+2,28 119
+2,28 120
+171.1,21 121
+7,10 121
+12,20 121
+1,21 121
+1,21 121
+1,21 122
+172.0,1 123
+179.5,21 124
+25,34 124
+25,48 124
+25,48 125
+180.2,8 126
+181.6,15 127
+6,22 127
+6,28 127
+1,30 127
+1,30 128
+182.18,37 129
+39,58 129
+39,69 129
+183.11,35 130
+17,20 130
+22,34 130
+11,35 130
+11,35 130
+1,35 130
+1,35 131
+184.22,52 132
+28,31 132
+33,51 132
+22,52 132
+22,52 132
+18,52 132
+18,52 133
+55,61 132
+18,61 132
+67,98 132
+73,76 132
+78,97 132
+67,98 132
+67,98 132
+63,98 132
+63,98 134
+101,107 132
+63,107 132
+185.5,26 135
+186.2,65 136
+8,11 136
+57,63 136
+44,64 136
+37,64 136
+13,64 136
+13,64 137
+2,65 136
+2,65 136
+2,65 138
+187.5,26 139
+188.2,66 140
+8,11 140
+58,64 140
+45,65 140
+38,65 140
+13,65 140
+13,65 141
+2,66 140
+2,66 140
+2,66 142
+190.22,48 143
+28,31 143
+33,47 143
+22,48 143
+22,48 143
+18,48 143
+18,48 144
+54,80 143
+60,63 143
+65,79 143
+54,80 143
+54,80 143
+50,80 143
+50,80 145
+1,81 143
+191.30,60 146
+36,39 146
+41,59 146
+30,60 146
+30,60 146
+26,60 146
+26,60 147
+63,67 146
+26,67 146
+192.8,39 146
+14,17 146
+19,38 146
+8,39 146
+8,39 146
+4,39 146
+4,39 148
+42,46 146
+4,46 146
+191.1,192.48 146
+191.12,20 146
+12,20 146
+1,192.48 146
+191.1,192.48 146
+193.14,23 149
+14,18 149
+14,23 149
+14,23 149
+25,34 149
+25,29 149
+25,34 149
+25,34 149
+194.5,25 150
+195.30,42 151
+44,56 151
+196.5,25 152
+197.30,42 153
+44,56 153
+198.5,25 154
+199.30,37 155
+39,51 155
+200.5,25 156
+201.30,37 157
+39,51 157
+202.1,79 158
+7,10 158
+32,49 158
+12,49 158
+12,58 158
+61,78 158
+12,78 158
+12,78 159
+12,78 160
+1,79 158
+1,79 158
+1,79 161
+203.0,1 162
+13
+aSys->Dir 1:26.1,39.2 64
+11
+0:name:28.2,6 s
+4:uid:29.2,5 s
+8:gid:30.2,5 s
+12:muid:31.2,6 s
+16:qid:32.2,5 @1
+
+32:mode:33.2,6 i
+36:atime:34.2,7 i
+40:mtime:35.2,7 i
+48:length:36.2,8 B
+56:dtype:37.2,7 i
+60:dev:38.2,5 i
+aSys->Qid 11.1,16.2 16
+3
+0:path:13.2,6 B
+8:vers:14.2,6 i
+12:qtype:15.2,7 i
+aDraw->Chans 2:70.1,82.2 4
+1
+0:desc:72.2,6 i
+aDraw->Context 274.1,279.2 12
+3
+0:display:276.2,9 R@4
+
+4:screen:277.2,8 R@8
+
+8:wm:278.2,4 Ct8.2
+0:t0:15,21 s
+4:t1:15,21 Ct8.2
+0:t0:32,38 s
+4:t1:32,38 R@9
+
+
+
+aDraw->Display 201.1,230.2 20
+5
+0:image:203.2,7 R@5
+
+4:white:204.2,7 R@5
+
+8:black:205.2,7 R@5
+
+12:opaque:206.2,8 R@5
+
+16:transparent:207.2,13 R@5
+
+aDraw->Image 142.1,198.2 56
+8
+0:r:146.2,3 @6
+
+16:clipr:147.2,7 @6
+
+32:depth:148.2,7 i
+36:chans:149.2,7 @2
+
+40:repl:150.2,6 i
+44:display:151.2,9 R@4
+
+48:screen:152.2,8 R@8
+
+52:iname:153.2,7 s
+aDraw->Rect 116.1,139.2 16
+2
+0:min:118.2,5 @7
+
+8:max:119.2,5 @7
+
+aDraw->Point 99.1,113.2 8
+2
+0:x:101.2,3 i
+4:y:102.2,3 i
+aDraw->Screen 249.1,263.2 16
+4
+0:id:251.2,4 i
+4:image:252.2,7 R@5
+
+8:fill:253.2,6 R@5
+
+12:display:254.2,9 R@4
+
+aDraw->Wmcontext 282.1,291.2 28
+7
+0:kbd:284.2,5 Ci
+4:ptr:285.2,5 CR@10
+
+8:ctl:286.2,5 Cs
+12:wctl:287.2,6 Cs
+16:images:288.2,8 CR@5
+
+20:connfd:289.2,8 R@11
+
+24:ctxt:290.2,6 R@3
+
+aDraw->Pointer 266.1,271.2 16
+3
+0:buttons:268.2,9 i
+4:xy:269.2,4 @7
+
+12:msec:270.2,6 i
+aSys->FD 1:45.1,48.2 4
+1
+0:fd:47.2,4 i
+aTk->Toplevel 3:5.1,12.2 32
+5
+0:display:7.2,9 R@4
+
+4:wreq:8.2,6 Cs
+8:image:9.2,7 R@5
+
+12:ctxt:10.2,6 R@9
+
+16:screenr:11.2,9 @6
+
+8
+0:init
+2
+32:ctxt:0:35.5,9 R@3
+
+36:args:30,34 Ls
+15
+40:win:65.2,5 R@12
+
+44:winctl:7,13 Cs
+48:msgsfd:78.1,7 R@11
+
+52:s:110.1,2 s
+56:cmd:67.1,4 Cs
+60:conn:76.1,5 Ct8.2
+0:t0:18,24 s
+4:t1:18,24 R@11
+
+
+64:d:102.3,4 Ab
+68:e:81.2,3 s
+72:fd:5,7 R@11
+
+76:msg:97.2,5 s
+80:msgs:75.1,5 Cs
+84:servicedir:60.1,11 s
+88:s:106.1,2 i
+92:s:108.1,2 R@10
+
+96:txt:93.1,4 s
+n202:err
+1
+32:s:117.4,5 s
+0
+n209:badmodule
+1
+32:path:123.10,14 s
+0
+n219:tkcmds
+2
+32:t:128.7,8 R@12
+
+36:cmds:28,32 As
+1
+40:i:130.6,7 i
+n232:tkcmd
+2
+32:t:134.6,7 R@12
+
+36:cmd:27,30 s
+1
+40:s:136.1,2 s
+s249:connect
+3
+32:dir:142.8,11 s
+36:msgs:21,25 Cs
+40:conn:43,47 Ct8.2
+0:t0:58,64 s
+4:t1:58,64 R@11
+
+
+4
+44:buf:151.1,4 Ab
+48:msgsfd:145.1,7 R@11
+
+52:srvpath:144.1,8 s
+56:n:152.8,9 i
+n292:output
+2
+32:win:158.7,10 R@12
+
+36:txt:30,33 s
+2
+40:toks:165.7,11 Ls
+44:yview:164.1,6 s
+n331:fittoscreen
+1
+32:win:176.12,15 R@12
+
+7
+36:bd:183.1,3 i
+40:dx:193.2,4 i
+44:dy:6,8 i
+72:actr:189.1,5 @6
+
+88:r:181.1,2 @6
+
+104:scrsize:182.1,8 @7
+
+112:winsize:184.1,8 @7
+
+n7
+164:draw:7.1,5 mDraw
+2:1.0,298.1 0
+
+176:firstmsg:0:157.0,8 i
+196:stderr:19.0,6 R@11
+
+200:sys:4.1,4 mSys
+1:0,160.1 0
+
+204:tk:0:10.1,3 mTk
+3:1.0,25.1 0
+
+208:tkclient:0:13.1,9 mTkclient
+4:1.0,26.1 0
+
+212:tksetup:0:21.0,7 As
diff --git a/appl/demo/chat/chatclient.sh b/appl/demo/chat/chatclient.sh
new file mode 100755
index 00000000..11ebf15b
--- /dev/null
+++ b/appl/demo/chat/chatclient.sh
@@ -0,0 +1,20 @@
+#!/dis/sh
+load std
+autoload=std
+ndb/cs
+
+chatroom=$1
+
+fn ck {
+ or {$*} {
+ echo chatclient: exiting >[1=2]
+ raise error
+ }
+}
+user="{cat /dev/user}
+
+ck mount -A 'tcp!$registry!registry' /mnt/registry
+ck /dis/grid/remotelogon wm/wm {
+ k = /usr/$user/keyring/default
+ grid/find -a resource chat -a pk `{getpk -s $k} Enter {demo/chat/chat /n/client} Shell {wm/sh}
+}
diff --git a/appl/demo/chat/chatsrv.b b/appl/demo/chat/chatsrv.b
new file mode 100644
index 00000000..adf56ef4
--- /dev/null
+++ b/appl/demo/chat/chatsrv.b
@@ -0,0 +1,268 @@
+implement Chatsrv;
+
+#
+# simple text-based chat service
+#
+
+include "sys.m";
+ sys: Sys;
+ Qid: import Sys;
+
+include "draw.m";
+
+include "styx.m";
+ styx: Styx;
+ Tmsg, Rmsg: import Styx;
+
+include "styxservers.m";
+ styxservers: Styxservers;
+ Styxserver, Navigator: import styxservers;
+ nametree: Nametree;
+ Tree: import nametree;
+
+Chatsrv : module {
+ init : fn (ctxt : ref Draw->Context, args : list of string);
+};
+
+Qdir, Qusers, Qmsgs: con iota;
+
+tc: chan of ref Tmsg;
+srv: ref Styxserver;
+
+user := "inferno";
+
+dir(name: string, perm: int, path: int): Sys->Dir
+{
+ d := sys->zerodir;
+ d.name = name;
+ d.uid = user;
+ d.gid = user;
+ d.qid.path = big path;
+ if(perm & Sys->DMDIR)
+ d.qid.qtype = Sys->QTDIR;
+ else
+ d.qid.qtype = Sys->QTFILE;
+ d.mode = perm;
+ return d;
+}
+
+badmod(path: string)
+{
+ sys->fprint(sys->fildes(1), "chatsrv: cannot load %s: %r\n", path);
+ exit;
+}
+
+init(nil: ref Draw->Context, nil: list of string)
+{
+ sys = load Sys Sys->PATH;
+ styx = load Styx Styx->PATH;
+ if(styx == nil)
+ badmod(Styx->PATH);
+ styxservers = load Styxservers Styxservers->PATH;
+ if(styxservers == nil)
+ badmod(Styxservers->PATH);
+ nametree = load Nametree Nametree->PATH;
+ if(nametree == nil)
+ badmod(Nametree->PATH);
+ styx->init();
+ styxservers->init(styx);
+ nametree->init();
+
+ (tree, treeop) := nametree->start();
+ tree.create(big Qdir, dir(".", Sys->DMDIR|8r555, Qdir));
+ tree.create(big Qdir, dir("users", 8r444, Qusers));
+ tree.create(big Qdir, dir("msgs", 8r666, Qmsgs));
+
+ nextmsg = ref Msg (0, nil, nil, nil);
+ keptmsg = nextmsg;
+
+ (tc, srv) = Styxserver.new(sys->fildes(0), Navigator.new(treeop), big Qdir);
+ chatsrv(tree);
+}
+
+chatsrv(tree: ref Tree)
+{
+ while((tmsg := <-tc) != nil){
+ pick tm := tmsg {
+ Readerror =>
+ break;
+ Flush =>
+ cancelpending(tm.tag);
+ srv.reply(ref Rmsg.Flush(tm.tag));
+ Open =>
+ c := srv.open(tm);
+ if (c == nil)
+ break;
+ if (int c.path == Qmsgs){
+ newmsgclient(tm.fid, c.uname);
+ #root[0].qid.vers++; # TO DO
+ }
+ Read =>
+ c := srv.getfid(tm.fid);
+ if (c == nil || !c.isopen) {
+ srv.reply(ref Rmsg.Error(tm.tag, Styxservers->Ebadfid));
+ break;
+ }
+ case int c.path {
+ Qdir =>
+ srv.read(tm);
+ Qmsgs =>
+ mc := getmsgclient(tm.fid);
+ if (mc == nil) {
+ srv.reply(ref Rmsg.Error(tm.tag, "internal error -- lost client"));
+ continue;
+ }
+ tm.offset = big 0;
+ msg := getnextmsg(mc);
+ if (msg == nil) {
+ if(mc.pending != nil)
+ srv.reply(ref Rmsg.Error(tm.tag, "read already pending"));
+ else
+ mc.pending = tm;
+ continue;
+ }
+ srv.reply(styxservers->readstr(tm, msg));
+ Qusers =>
+ srv.reply(styxservers->readstr(tm, usernames()));
+ * =>
+ srv.reply(ref Rmsg.Error(tm.tag, "phase error -- bad path"));
+ }
+ Write =>
+ c := srv.getfid(tm.fid);
+ if (c == nil || !c.isopen) {
+ srv.reply(ref Rmsg.Error(tm.tag, Styxservers->Ebadfid));
+ continue;
+ }
+ if (int c.path != Qmsgs) {
+ srv.reply(ref Rmsg.Error(tm.tag, Styxservers->Eperm));
+ continue;
+ }
+ writemsgclients(tm.fid, c.uname, string tm.data);
+ srv.reply(ref Rmsg.Write(tm.tag, len tm.data));
+ Clunk =>
+ c := srv.clunk(tm);
+ if (c != nil && int c.path == Qmsgs){
+ closemsgclient(tm.fid);
+ # root[0].qid.vers++; # TO DO
+ }
+ * =>
+ srv.default(tmsg);
+ }
+ }
+ tree.quit();
+ sys->print("chatsrv exit\n");
+}
+
+Msg: adt {
+ fromfid: int;
+ from: string;
+ msg: string;
+ next: cyclic ref Msg;
+};
+
+Msgclient: adt {
+ fid: int;
+ name: string;
+ nextmsg: ref Msg;
+ pending: ref Tmsg.Read;
+ next: cyclic ref Msgclient;
+};
+
+NKEPT: con 6;
+keptcount := 0;
+nextmsg: ref Msg;
+keptmsg: ref Msg;
+msgclients: ref Msgclient;
+
+usernames(): string
+{
+ s := "";
+ for (c := msgclients; c != nil; c = c.next)
+ s += c.name+"\n";
+ return s;
+}
+
+newmsgclient(fid: int, name: string)
+{
+ writemsgclients(fid, nil, "+++ " + name + " has arrived");
+ msgclients = ref Msgclient(fid, name, keptmsg, nil, msgclients);
+}
+
+getmsgclient(fid: int): ref Msgclient
+{
+ for (c := msgclients; c != nil; c = c.next)
+ if (c.fid == fid)
+ return c;
+ return nil;
+}
+
+cancelpending(tag: int)
+{
+ for (c := msgclients; c != nil; c = c.next)
+ if((tm := c.pending) != nil && tm.tag == tag){
+ c.pending = nil;
+ break;
+ }
+}
+
+closemsgclient(fid: int)
+{
+ prev: ref Msgclient;
+ s := "";
+ for (c := msgclients; c != nil; c = c.next) {
+ if (c.fid == fid) {
+ if (prev == nil)
+ msgclients = c.next;
+ else
+ prev.next = c.next;
+ s = "--- " + c.name + " has left";
+ break;
+ }
+ prev = c;
+ }
+ if (s != nil)
+ writemsgclients(fid, nil, s);
+}
+
+writemsgclients(fromfid: int, from: string, msg: string)
+{
+ nm := ref Msg(0, nil, nil, nil);
+ nextmsg.fromfid = fromfid;
+ nextmsg.from = from;
+ nextmsg.msg = msg;
+ nextmsg.next = nm;
+
+ for (c := msgclients; c != nil; c = c.next) {
+ if (c.pending != nil) {
+ s := msgtext(nextmsg);
+ srv.reply(styxservers->readstr(c.pending, s));
+ c.pending = nil;
+ c.nextmsg = nm;
+ }
+ }
+ nextmsg = nm;
+ if (keptcount < NKEPT)
+ keptcount++;
+ else
+ keptmsg = keptmsg.next;
+}
+
+getnextmsg(mc: ref Msgclient): string
+{
+# uncomment next two lines to eliminate queued messages to self
+# while(mc.nextmsg.next != nil && mc.nextmsg.fromfid == mc.fid)
+# mc.nextmsg = mc.nextmsg.next;
+ if ((m := mc.nextmsg).next != nil){
+ mc.nextmsg = m.next;
+ return msgtext(m);
+ }
+ return nil;
+}
+
+msgtext(m: ref Msg): string
+{
+ prefix := "";
+ if (m.from != nil)
+ prefix = m.from + ": ";
+ return prefix + m.msg;
+}
diff --git a/appl/demo/chat/chatsrv.dis b/appl/demo/chat/chatsrv.dis
new file mode 100644
index 00000000..f333c6be
--- /dev/null
+++ b/appl/demo/chat/chatsrv.dis
Binary files differ
diff --git a/appl/demo/chat/chatsrv.sbl b/appl/demo/chat/chatsrv.sbl
new file mode 100644
index 00000000..eb2561a8
--- /dev/null
+++ b/appl/demo/chat/chatsrv.sbl
@@ -0,0 +1,938 @@
+limbo .sbl 2.1
+Chatsrv
+5
+chatsrv.b
+sys.m
+draw.m
+styx.m
+styxservers.m
+502
+1:41.18,21 0
+23,26 0
+28,31 0
+33,36 0
+39,44 0
+46,47 0
+49,50 0
+53,54 0
+56,57 0
+59,60 0
+62,67 0
+69,70 0
+72,73 0
+0:37.1,14 1
+38.1,13 2
+39.1,13 3
+40.1,22 4
+41.4,21 5
+4,21 5
+42.2,26 6
+2,26 7
+44.2,27 8
+45.1,14 9
+46.8,9 10
+1,9 10
+51.13,27 11
+25,26 11
+13,27 11
+13,27 11
+1,67 11
+1,67 11
+1,67 12
+29,60 11
+62,66 11
+1,67 11
+1,67 11
+52.1,5 13
+57.1,25 14
+58.1,28 15
+59.4,15 16
+60.2,20 17
+9,19 17
+2,20 17
+61.1,49 18
+62.4,22 19
+63.2,27 20
+9,26 20
+2,27 20
+64.1,40 21
+65.4,19 22
+66.2,24 23
+9,23 23
+2,24 23
+67.1,13 24
+1,13 24
+68.1,24 25
+19,23 25
+1,24 25
+69.1,17 26
+1,17 26
+71.19,36 27
+19,36 27
+19,36 27
+72.23,55 28
+27,30 28
+32,48 28
+50,54 28
+23,55 28
+23,55 28
+1,56 28
+1,5 28
+13,21 28
+13,21 28
+13,21 29
+13,21 30
+13,21 31
+13,21 32
+1,56 28
+1,56 28
+1,56 33
+73.23,50 34
+27,34 34
+36,41 34
+43,49 34
+23,50 34
+23,50 34
+1,51 34
+1,5 34
+13,21 34
+13,21 34
+13,21 35
+13,21 36
+13,21 37
+13,21 38
+1,51 34
+1,51 34
+1,51 39
+74.23,48 40
+27,33 40
+35,40 40
+42,47 40
+23,48 40
+23,48 40
+1,49 40
+1,5 40
+13,21 40
+13,21 40
+13,21 41
+13,21 42
+13,21 43
+13,21 44
+1,49 40
+1,49 40
+1,49 45
+76.1,37 46
+20,21 46
+23,26 46
+28,31 46
+33,36 46
+1,37 46
+1,37 47
+77.1,18 48
+79.28,42 49
+40,41 49
+28,42 49
+28,42 49
+44,65 49
+58,64 49
+44,65 49
+44,65 49
+13,76 49
+13,76 49
+13,76 50
+13,76 49
+13,76 51
+67,75 49
+13,76 49
+13,76 49
+2,4 49
+6,9 49
+6,9 52
+6,9 53
+80.1,14 54
+9,13 54
+1,14 54
+81.0,1 55
+85.7,21 56
+7,21 56
+7,28 56
+7,28 57
+86.7,17 58
+7,17 58
+88.3,8 59
+90.3,24 60
+17,23 60
+3,24 60
+91.3,36 61
+3,6 61
+13,35 61
+17,35 61
+28,34 61
+13,35 61
+13,35 62
+3,36 61
+3,36 61
+3,36 58
+93.3,20 63
+8,11 63
+17,19 63
+3,20 63
+3,20 63
+94.7,15 64
+7,15 65
+95.4,9 66
+96.7,17 67
+7,26 67
+97.4,33 68
+17,23 68
+25,32 68
+4,33 68
+4,33 69
+4,33 58
+101.3,26 70
+8,11 70
+19,25 70
+3,26 70
+3,26 70
+102.7,15 71
+20,28 71
+103.4,59 72
+4,7 72
+14,58 72
+18,58 72
+29,35 72
+37,57 72
+14,58 72
+14,58 73
+4,59 72
+4,59 72
+4,59 74
+104.4,9 75
+106.8,18 76
+8,18 76
+8,18 76
+8,18 76
+108.4,16 77
+4,7 77
+13,15 77
+4,16 77
+4,16 77
+4,16 78
+4,16 76
+110.4,30 79
+23,29 79
+4,30 79
+4,30 79
+111.8,17 80
+112.5,71 81
+5,8 81
+15,70 81
+19,70 81
+30,36 81
+38,69 81
+15,70 81
+15,70 82
+5,71 81
+5,71 81
+5,71 83
+5,71 84
+5,71 85
+113.5,13 86
+115.4,21 87
+116.4,25 88
+22,24 88
+4,25 88
+4,25 88
+117.8,18 89
+118.8,25 90
+119.6,63 91
+6,9 91
+16,62 91
+20,62 91
+31,37 91
+39,61 91
+16,62 91
+16,62 92
+6,63 91
+6,63 91
+6,63 93
+121.6,21 94
+6,21 95
+6,21 96
+6,21 97
+122.5,13 98
+124.14,43 99
+35,37 99
+39,42 99
+14,43 99
+14,43 99
+4,44 99
+4,7 99
+4,7 99
+4,7 100
+4,44 99
+4,44 99
+4,44 101
+4,44 102
+4,44 76
+126.39,50 103
+39,50 103
+39,50 103
+14,51 103
+35,37 103
+35,37 103
+35,37 104
+14,51 103
+14,51 103
+4,52 103
+4,7 103
+4,7 103
+4,7 105
+4,52 103
+4,52 103
+4,52 76
+128.4,64 106
+4,7 106
+14,63 106
+18,63 106
+29,35 106
+37,62 106
+14,63 106
+14,63 107
+4,64 106
+4,64 106
+4,64 76
+4,64 108
+4,64 58
+131.3,26 109
+8,11 109
+19,25 109
+3,26 109
+3,26 109
+132.7,15 110
+20,28 110
+133.4,59 111
+4,7 111
+14,58 111
+18,58 111
+29,35 111
+37,57 111
+14,58 111
+14,58 112
+4,59 111
+4,59 111
+4,59 113
+134.4,12 114
+136.7,17 115
+7,26 115
+137.4,57 116
+4,7 116
+14,56 116
+18,56 116
+29,35 116
+37,55 116
+14,56 116
+14,56 117
+4,57 116
+4,57 116
+4,57 118
+138.4,12 119
+140.3,51 120
+19,25 120
+27,34 120
+36,50 120
+3,51 120
+141.3,49 121
+3,6 121
+13,48 121
+17,48 121
+28,34 121
+36,47 121
+13,48 121
+13,48 122
+3,49 121
+3,49 121
+3,49 123
+3,49 58
+143.3,21 124
+8,11 124
+18,20 124
+3,21 124
+3,21 124
+144.7,15 125
+19,29 125
+19,38 125
+145.4,26 126
+19,25 126
+4,26 126
+4,26 127
+4,26 58
+149.3,20 128
+3,6 128
+15,19 128
+3,20 128
+3,20 58
+152.1,12 129
+1,5 129
+1,12 129
+153.1,29 130
+12,28 130
+1,29 130
+1,29 130
+154.0,1 131
+179.1,8 132
+180.6,21 133
+23,31 134
+181.7,13 135
+7,18 135
+2,18 135
+2,18 136
+180.33,43 137
+33,43 137
+182.8,9 138
+1,9 138
+187.1,58 139
+17,20 139
+22,25 139
+27,40 139
+27,57 139
+27,57 140
+1,58 139
+188.1,64 141
+28,31 141
+33,37 141
+39,46 141
+48,51 141
+53,63 141
+1,64 141
+1,64 142
+189.0,1 143
+193.6,21 144
+23,31 145
+194.6,18 146
+195.10,11 147
+3,11 147
+193.33,43 148
+33,43 148
+196.8,11 149
+1,11 149
+201.6,21 150
+23,31 151
+202.5,22 152
+5,22 152
+5,29 152
+5,29 153
+33,46 152
+203.3,18 154
+206.0,1 155
+201.33,43 156
+33,43 156
+206.0,1 155
+211.1,8 157
+212.6,21 158
+23,31 159
+213.6,18 160
+214.7,18 161
+215.4,23 162
+4,23 163
+217.4,22 164
+218.7,22 165
+3,36 165
+3,36 166
+219.3,8 167
+221.2,10 168
+212.33,43 169
+33,43 169
+223.5,13 170
+224.2,30 171
+18,21 171
+23,26 171
+28,29 171
+2,30 171
+225.0,1 172
+229.1,32 173
+15,16 173
+18,21 173
+23,26 173
+28,31 173
+1,32 173
+1,32 174
+230.1,26 175
+231.1,20 176
+232.1,18 177
+233.1,18 178
+235.6,21 179
+23,31 180
+236.6,22 181
+237.3,24 182
+16,23 182
+3,24 182
+3,24 182
+238.13,47 183
+34,43 183
+45,46 183
+13,47 183
+13,47 183
+3,48 183
+3,6 183
+3,6 183
+3,6 184
+3,48 183
+3,48 183
+239.3,18 185
+240.3,17 186
+3,17 187
+235.33,43 188
+33,43 188
+243.1,13 189
+244.5,22 190
+245.2,13 191
+248.0,1 192
+247.2,24 193
+248.0,1 192
+255.5,22 194
+5,22 194
+5,34 194
+5,34 195
+256.2,21 196
+257.9,19 197
+17,18 197
+9,19 197
+9,19 197
+2,19 197
+259.8,11 198
+1,11 198
+264.1,13 199
+265.5,18 200
+266.11,17 201
+2,24 201
+2,24 202
+267.8,22 203
+1,22 203
+22
+aSys->Dir 1:26.1,39.2 64
+11
+0:name:28.2,6 s
+4:uid:29.2,5 s
+8:gid:30.2,5 s
+12:muid:31.2,6 s
+16:qid:32.2,5 @1
+
+32:mode:33.2,6 i
+36:atime:34.2,7 i
+40:mtime:35.2,7 i
+48:length:36.2,8 B
+56:dtype:37.2,7 i
+60:dev:38.2,5 i
+aSys->Qid 11.1,16.2 16
+3
+0:path:13.2,6 B
+8:vers:14.2,6 i
+12:qtype:15.2,7 i
+aDraw->Chans 2:70.1,82.2 4
+1
+0:desc:72.2,6 i
+aDraw->Context 274.1,279.2 12
+3
+0:display:276.2,9 R@4
+
+4:screen:277.2,8 R@8
+
+8:wm:278.2,4 Ct8.2
+0:t0:15,21 s
+4:t1:15,21 Ct8.2
+0:t0:32,38 s
+4:t1:32,38 R@9
+
+
+
+aDraw->Display 201.1,230.2 20
+5
+0:image:203.2,7 R@5
+
+4:white:204.2,7 R@5
+
+8:black:205.2,7 R@5
+
+12:opaque:206.2,8 R@5
+
+16:transparent:207.2,13 R@5
+
+aDraw->Image 142.1,198.2 56
+8
+0:r:146.2,3 @6
+
+16:clipr:147.2,7 @6
+
+32:depth:148.2,7 i
+36:chans:149.2,7 @2
+
+40:repl:150.2,6 i
+44:display:151.2,9 R@4
+
+48:screen:152.2,8 R@8
+
+52:iname:153.2,7 s
+aDraw->Rect 116.1,139.2 16
+2
+0:min:118.2,5 @7
+
+8:max:119.2,5 @7
+
+aDraw->Point 99.1,113.2 8
+2
+0:x:101.2,3 i
+4:y:102.2,3 i
+aDraw->Screen 249.1,263.2 16
+4
+0:id:251.2,4 i
+4:image:252.2,7 R@5
+
+8:fill:253.2,6 R@5
+
+12:display:254.2,9 R@4
+
+aDraw->Wmcontext 282.1,291.2 28
+7
+0:kbd:284.2,5 Ci
+4:ptr:285.2,5 CR@10
+
+8:ctl:286.2,5 Cs
+12:wctl:287.2,6 Cs
+16:images:288.2,8 CR@5
+
+20:connfd:289.2,8 R@11
+
+24:ctxt:290.2,6 R@3
+
+aDraw->Pointer 266.1,271.2 16
+3
+0:buttons:268.2,9 i
+4:xy:269.2,4 @7
+
+12:msec:270.2,6 i
+aSys->FD 1:45.1,48.2 4
+1
+0:fd:47.2,4 i
+aNametree->Tree 4:112.1,121.2 8
+2
+0:c:113.2,3 CR@13
+
+4:reply:114.2,7 Cs
+pNametree->Treeop 122.1,132.2 0
+2
+4:reply:123.2,7 Cs
+8:q:124.2,3 B
+4
+Create:126.2,8 80
+1
+16:d:128.3,4 @0
+
+Wstat:127.2,7
+Remove:129.2,8 16
+0
+Getpath:130.2,9 16
+0
+aMsgclient 0:163.0,169.1 20
+5
+0:fid:164.1,4 i
+4:name:165.1,5 s
+8:nextmsg:166.1,8 R@15
+
+12:pending:167.1,8 R@16
+
+16:next:168.1,5 R@14
+
+aMsg 156.0,161.1 16
+4
+0:fromfid:157.1,8 i
+4:from:158.1,5 s
+8:msg:159.1,4 s
+12:next:160.1,5 R@15
+
+pStyx->Tmsg 3:75.1,123.2 0
+1
+4:tag:76.2,5 i
+14
+Readerror:78.2,11 12
+1
+8:error:79.3,8 s
+Version:80.2,9 16
+2
+8:msize:81.3,8 i
+12:version:82.3,10 s
+Auth:83.2,6 20
+3
+8:afid:84.3,7 i
+12:uname:85.3,8 s
+16:aname:10,15 s
+Attach:86.2,8 24
+4
+8:fid:87.3,6 i
+12:afid:8,12 i
+16:uname:88.3,8 s
+20:aname:10,15 s
+Flush:89.2,7 12
+1
+8:oldtag:90.3,9 i
+Walk:91.2,6 20
+3
+8:fid:92.3,6 i
+12:newfid:8,14 i
+16:names:93.3,8 As
+Open:94.2,6 16
+2
+8:fid:95.3,6 i
+12:mode:8,12 i
+Create:96.2,8 24
+4
+8:fid:97.3,6 i
+12:name:98.3,7 s
+16:perm:99.3,7 i
+20:mode:9,13 i
+Read:100.2,6 32
+3
+8:fid:101.3,6 i
+16:offset:102.3,9 B
+24:count:103.3,8 i
+Write:104.2,7 32
+3
+8:fid:105.3,6 i
+16:offset:106.3,9 B
+24:data:107.3,7 Ab
+Clunk:108.2,7 12
+1
+8:fid:111.3,6 i
+Stat:109.2,6
+Remove:110.2,8
+Wstat:112.2,7 80
+2
+8:fid:113.3,6 i
+16:stat:114.3,7 @0
+
+pStyxservers->Navop 4:31.1,42.2 0
+2
+4:reply:32.2,7 Ct8.2
+0:t0:18,30 R@0
+
+4:t1:18,30 s
+
+8:path:33.2,6 B
+3
+Stat:35.2,6 16
+0
+Walk:36.2,6 24
+1
+16:name:37.3,7 s
+Readdir:38.2,9 24
+2
+16:offset:39.3,9 i
+20:count:40.3,8 i
+aStyxservers->Styxserver 44.1,82.2 32
+7
+0:fd:45.2,4 R@11
+
+4:fids:46.2,6 ALR@19
+
+8:fidlock:47.2,9 Ci
+12:t:48.2,3 R@20
+
+16:rootpath:49.2,10 B
+24:msize:50.2,7 i
+28:replychan:51.2,11 CR@21
+
+aStyxservers->Fid 5.1,19.2 48
+9
+0:fid:6.2,5 i
+8:path:7.2,6 B
+16:qtype:8.2,7 i
+20:isopen:9.2,8 i
+24:mode:10.2,6 i
+28:doffset:11.2,9 t8.2
+0:t0:12,15 i
+4:t1:12,15 i
+
+36:uname:12.2,7 s
+40:param:13.2,7 s
+44:data:14.2,6 Ab
+aStyxservers->Navigator 21.1,29.2 8
+2
+0:c:22.2,3 CR@17
+
+4:reply:23.2,7 Ct8.2
+0:t0:18,30 R@0
+
+4:t1:18,30 s
+
+pStyx->Rmsg 3:125.1,163.2 0
+1
+4:tag:126.2,5 i
+15
+Readerror:128.2,11 12
+1
+8:error:129.3,8 s
+Version:130.2,9 16
+2
+8:msize:131.3,8 i
+12:version:132.3,10 s
+Auth:133.2,6 24
+1
+8:aqid:134.3,7 @1
+
+Attach:135.2,8 24
+1
+8:qid:136.3,6 @1
+
+Flush:137.2,7 8
+0
+Error:138.2,7 12
+1
+8:ename:139.3,8 s
+Clunk:140.2,7 8
+0
+Remove:141.2,8
+Wstat:142.2,7
+Walk:143.2,6 12
+1
+8:qids:144.3,7 A@1
+
+Create:145.2,8 32
+2
+8:qid:147.3,6 @1
+
+24:iounit:148.3,9 i
+Open:146.2,6
+Read:149.2,6 12
+1
+8:data:150.3,7 Ab
+Write:151.2,7 12
+1
+8:count:152.3,8 i
+Stat:153.2,6 72
+1
+8:stat:154.3,7 @0
+
+12
+0:dir
+3
+32:name:0:34.4,8 s
+36:perm:18,22 i
+40:path:29,33 i
+1
+48:d:36.1,2 @0
+
+@0
+25:badmod
+1
+32:path:49.7,11 s
+0
+n37:init
+0
+2
+40:tree:71.2,6 R@12
+
+44:treeop:8,14 CR@17
+
+n146:chatsrv
+1
+32:tree:83.8,12 R@12
+
+8
+36:tm:86.7,9 R@16
+
+40:c:131.3,4 R@19
+
+44:mc:110.4,6 R@14
+
+48:c:93.3,4 R@19
+
+52:c:101.3,4 R@19
+
+56:c:143.3,4 R@19
+
+60:msg:116.4,7 s
+64:tmsg:85.8,12 R@16
+
+n373:usernames
+0
+2
+32:c:180.6,7 R@14
+
+36:s:179.1,2 s
+s384:newmsgclient
+2
+32:fid:185.13,16 i
+36:name:23,27 s
+0
+n400:getmsgclient
+1
+32:fid:191.13,16 i
+1
+36:c:193.6,7 R@14
+
+R@14
+409:cancelpending
+1
+32:tag:199.14,17 i
+2
+36:c:201.6,7 R@14
+
+40:tm:202.6,8 R@16
+
+n421:closemsgclient
+1
+32:fid:208.15,18 i
+3
+36:c:212.6,7 R@14
+
+40:s:211.1,2 s
+44:prev:210.1,5 R@14
+
+n443:writemsgclients
+3
+32:fromfid:227.16,23 i
+36:from:30,34 s
+40:msg:44,47 s
+3
+44:c:235.6,7 R@14
+
+48:nm:229.1,3 R@15
+
+52:s:237.3,4 s
+n483:getnextmsg
+1
+32:mc:250.11,13 R@14
+
+1
+36:m:255.6,7 R@15
+
+s495:msgtext
+1
+32:m:262.8,9 R@15
+
+1
+36:prefix:264.1,7 s
+s10
+180:keptcount:172.0,9 i
+184:keptmsg:174.0,7 R@15
+
+188:msgclients:175.0,10 R@14
+
+196:nametree:20.1,9 mNametree
+4:110.0,135.1 0
+
+200:nextmsg:0:173.0,7 R@15
+
+220:srv:30.0,3 R@18
+
+224:styx:14.1,5 mStyx
+3:1.0,182.1 0
+
+228:styxservers:0:18.1,12 mStyxservers
+4:1.0,108.1 0
+
+232:sys:0:8.1,4 mSys
+1:4.0,160.1 0
+
+236:tc:0:29.0,2 CR@16
+
diff --git a/appl/demo/chat/mkfile b/appl/demo/chat/mkfile
new file mode 100644
index 00000000..13045209
--- /dev/null
+++ b/appl/demo/chat/mkfile
@@ -0,0 +1,30 @@
+<../../../mkconfig
+
+TARG=\
+ chat.dis\
+ chatsrv.dis\
+
+SHTARG=\
+ chatclient.sh\
+
+MODULES=\
+
+SYSMODULES= \
+ draw.m\
+ styx.m\
+ styxservers.m\
+ sys.m\
+ tk.m\
+ tkclient.m\
+
+DISBIN=$ROOT/dis/demo/chat
+
+<$ROOT/mkfiles/mkdis
+
+SHFILES=${SHTARG:%.sh=$DISBIN/%}
+install:V: $SHFILES
+%.install:V: $DISBIN/%
+%.installall:V: $DISBIN/%
+
+$DISBIN/%: %.sh
+ cp $stem.sh $target && chmod a+rx $target
diff --git a/appl/demo/cpupool/mkfile b/appl/demo/cpupool/mkfile
new file mode 100644
index 00000000..4531899b
--- /dev/null
+++ b/appl/demo/cpupool/mkfile
@@ -0,0 +1,26 @@
+<../../../mkconfig
+
+TARG=\
+ regpoll.dis\
+
+SHTARG=\
+ runrstyx.sh\
+
+MODULES=\
+
+SYSMODULES= \
+ draw.m\
+ registries.m\
+ sys.m\
+
+DISBIN=$ROOT/dis/demo/cpupool
+
+<$ROOT/mkfiles/mkdis
+
+SHFILES=${SHTARG:%.sh=$DISBIN/%}
+install:V: $SHFILES
+%.install:V: $DISBIN/%
+%.installall:V: $DISBIN/%
+
+$DISBIN/%: %.sh
+ cp $stem.sh $target && chmod a+rx $target
diff --git a/appl/demo/cpupool/regpoll.b b/appl/demo/cpupool/regpoll.b
new file mode 100644
index 00000000..52ea3d1f
--- /dev/null
+++ b/appl/demo/cpupool/regpoll.b
@@ -0,0 +1,63 @@
+implement RegPoll;
+
+include "sys.m";
+ sys : Sys;
+include "draw.m";
+include "registries.m";
+ registries: Registries;
+ Attributes, Service: import registries;
+
+RegPoll: module {
+ init: fn(nil: ref Draw->Context, argv: list of string);
+};
+
+init(nil: ref Draw->Context, argv: list of string)
+{
+ sys = load Sys Sys->PATH;
+ if (sys == nil)
+ badmod(Sys->PATH);
+ registries = load Registries Registries->PATH;
+ if (registries == nil)
+ badmod(Registries->PATH);
+ registries->init();
+
+ if (len argv != 3)
+ usage();
+
+ regaddr := hd tl argv;
+ action := hd tl tl argv;
+ if (action != "up" && action != "down")
+ usage();
+
+ sys->pctl(sys->FORKNS, nil);
+ sys->unmount(nil, "/mnt/registry");
+ svc := ref Service(hd tl argv, Attributes.new(("auth", "none") :: nil));
+ for (;;) {
+ a := svc.attach(nil, nil);
+ if (a != nil && sys->mount(a.fd, nil, "/mnt/registry", Sys->MREPL, nil) != -1) {
+ if (action == "up")
+ return;
+ else
+ break;
+ }
+ sys->sleep(30000);
+ }
+ for (;;) {
+ fd := sys->open("/mnt/registry/new", sys->OREAD);
+ sys->sleep(30000);
+ if (fd == nil)
+ return;
+ }
+}
+
+badmod(path: string)
+{
+ sys->print("RegPoll: failed to load: %s\n",path);
+ exit;
+}
+
+usage()
+{
+ sys->print("usage: regpoll regaddr up | down\n");
+ raise "fail:usage";
+} \ No newline at end of file
diff --git a/appl/demo/cpupool/regpoll.dis b/appl/demo/cpupool/regpoll.dis
new file mode 100644
index 00000000..d64a7a55
--- /dev/null
+++ b/appl/demo/cpupool/regpoll.dis
Binary files differ
diff --git a/appl/demo/cpupool/regpoll.sbl b/appl/demo/cpupool/regpoll.sbl
new file mode 100644
index 00000000..613e78a8
--- /dev/null
+++ b/appl/demo/cpupool/regpoll.sbl
@@ -0,0 +1,262 @@
+limbo .sbl 2.1
+RegPoll
+4
+regpoll.b
+sys.m
+draw.m
+registries.m
+104
+16.1,25 0
+17.5,15 1
+18.2,19 2
+9,18 2
+2,19 2
+19.1,46 3
+20.5,22 4
+21.2,26 5
+9,25 5
+2,26 5
+22.1,19 6
+1,19 6
+24.5,13 7
+5,18 7
+25.2,9 8
+2,9 8
+27.15,22 9
+1,22 9
+1,22 10
+28.17,24 11
+14,24 11
+1,24 11
+1,24 12
+29.5,19 13
+23,39 13
+30.2,9 14
+2,9 14
+32.1,28 15
+11,22 15
+24,27 15
+1,28 15
+1,28 15
+33.1,35 16
+14,17 16
+19,34 16
+1,35 16
+1,35 16
+34.1,72 17
+23,30 17
+20,30 17
+20,30 18
+32,71 17
+48,54 17
+56,62 17
+67,70 17
+47,70 17
+47,70 17
+47,70 19
+47,70 20
+47,70 21
+32,71 17
+32,71 17
+1,72 17
+1,72 22
+36.2,27 23
+7,10 23
+18,21 23
+23,26 23
+2,27 23
+2,27 23
+37.6,14 24
+18,73 24
+29,33 24
+35,38 24
+40,55 24
+57,67 24
+69,72 24
+18,73 24
+18,73 24
+18,79 24
+38.7,21 25
+39.4,10 26
+4,10 27
+41.4,9 28
+43.2,19 29
+13,18 29
+2,19 29
+2,19 29
+2,19 30
+2,19 30
+46.2,50 31
+18,37 31
+39,49 31
+2,50 31
+2,50 31
+47.2,19 32
+13,18 32
+2,19 32
+2,19 32
+48.6,15 33
+49.3,9 34
+3,9 35
+3,9 35
+55.1,49 36
+12,43 36
+44,48 36
+1,49 36
+1,49 36
+56.1,5 37
+61.1,49 38
+12,48 38
+1,49 38
+1,49 38
+62.1,19 39
+15
+aSys->Dir 1:26.1,39.2 64
+11
+0:name:28.2,6 s
+4:uid:29.2,5 s
+8:gid:30.2,5 s
+12:muid:31.2,6 s
+16:qid:32.2,5 @1
+
+32:mode:33.2,6 i
+36:atime:34.2,7 i
+40:mtime:35.2,7 i
+48:length:36.2,8 B
+56:dtype:37.2,7 i
+60:dev:38.2,5 i
+aSys->Qid 11.1,16.2 16
+3
+0:path:13.2,6 B
+8:vers:14.2,6 i
+12:qtype:15.2,7 i
+aDraw->Chans 2:70.1,82.2 4
+1
+0:desc:72.2,6 i
+aDraw->Context 274.1,279.2 12
+3
+0:display:276.2,9 R@4
+
+4:screen:277.2,8 R@8
+
+8:wm:278.2,4 Ct8.2
+0:t0:15,21 s
+4:t1:15,21 Ct8.2
+0:t0:32,38 s
+4:t1:32,38 R@9
+
+
+
+aDraw->Display 201.1,230.2 20
+5
+0:image:203.2,7 R@5
+
+4:white:204.2,7 R@5
+
+8:black:205.2,7 R@5
+
+12:opaque:206.2,8 R@5
+
+16:transparent:207.2,13 R@5
+
+aDraw->Image 142.1,198.2 56
+8
+0:r:146.2,3 @6
+
+16:clipr:147.2,7 @6
+
+32:depth:148.2,7 i
+36:chans:149.2,7 @2
+
+40:repl:150.2,6 i
+44:display:151.2,9 R@4
+
+48:screen:152.2,8 R@8
+
+52:iname:153.2,7 s
+aDraw->Rect 116.1,139.2 16
+2
+0:min:118.2,5 @7
+
+8:max:119.2,5 @7
+
+aDraw->Point 99.1,113.2 8
+2
+0:x:101.2,3 i
+4:y:102.2,3 i
+aDraw->Screen 249.1,263.2 16
+4
+0:id:251.2,4 i
+4:image:252.2,7 R@5
+
+8:fill:253.2,6 R@5
+
+12:display:254.2,9 R@4
+
+aDraw->Wmcontext 282.1,291.2 28
+7
+0:kbd:284.2,5 Ci
+4:ptr:285.2,5 CR@10
+
+8:ctl:286.2,5 Cs
+12:wctl:287.2,6 Cs
+16:images:288.2,8 CR@5
+
+20:connfd:289.2,8 R@11
+
+24:ctxt:290.2,6 R@3
+
+aDraw->Pointer 266.1,271.2 16
+3
+0:buttons:268.2,9 i
+4:xy:269.2,4 @7
+
+12:msec:270.2,6 i
+aSys->FD 1:45.1,48.2 4
+1
+0:fd:47.2,4 i
+aRegistries->Service 3:20.1,25.2 8
+2
+0:addr:21.2,6 s
+4:attrs:22.2,7 R@13
+
+aRegistries->Attributes 5.1,11.2 4
+1
+0:attrs:6.2,7 Lt8.2
+0:t0:18,24 s
+4:t1:18,24 s
+
+aRegistries->Attached 13.1,18.2 16
+4
+0:fd:14.2,4 R@11
+
+4:signerpkhash:15.2,14 s
+8:localuser:16.2,11 s
+12:remoteuser:17.2,12 s
+3
+0:init
+1
+36:argv:0:14.29,33 Ls
+5
+40:action:28.1,7 s
+44:a:36.2,3 R@14
+
+48:fd:46.2,4 R@11
+
+52:svc:34.1,4 R@12
+
+72:regaddr:27.1,8 s
+n93:badmod
+1
+32:path:53.7,11 s
+0
+n99:usage
+0
+0
+n2
+40:registries:7.1,11 mRegistries
+3:1.0,44.1 0
+
+44:sys:0:4.1,4 mSys
+1:0,160.1 0
+
diff --git a/appl/demo/cpupool/runrstyx.sh b/appl/demo/cpupool/runrstyx.sh
new file mode 100755
index 00000000..21a548a3
--- /dev/null
+++ b/appl/demo/cpupool/runrstyx.sh
@@ -0,0 +1,50 @@
+#!/dis/sh
+fn bindfs {
+ # this may be useful as a general purpose cmd
+ (mntpt dirs)=$*
+ memfs $mntpt
+ for d in $dirs {
+ parts=${split / $d}
+ fpath=''
+ for p in $parts {
+ fpath=$fpath^/^$p
+ if {! ftest -e $mntpt^$fpath} {
+ if {ftest -d $fpath} {
+ mkdir $mntpt^$fpath
+ } {
+ if {! ftest -e $fpath} {
+ echo $fpath does not exist >[1=2]
+ raise 'fail:errors'
+ }
+ }
+ }
+ }
+ if {! ftest -d $d} {
+ touch $mntpt/$d
+ }
+ bind $d $mntpt^$d
+ }
+}
+
+fn x {
+ echo tcp!^$2
+}
+
+bindfs /tmp /dis /n/client /dev /prog
+listen -A `{x `{ndb/csquery tcp!^`{cat /dev/sysname}^!rstyx}} {
+ @{
+ load std
+ pctl forkns nodevs
+ bind /tmp /
+ runas rstyx {auxi/rstyxd}
+ }&
+ }
+
+while {} {
+ demo/cpupool/regpoll tcp!200.1.1.104!6676 up
+ echo Registering Rstyx service
+ mount -A 'tcp!200.1.1.104!6676' /mnt/registry
+ echo `{x `{ndb/csquery tcp!^`{cat /dev/sysname}^!rstyx}} proto styx auth none persist 1 resource '''Rstyx resource''' name `{cat /dev/sysname} > /mnt/registry/new
+ demo/cpupool/regpoll tcp!200.1.1.104!6676 down
+ echo Registry gone down
+} \ No newline at end of file
diff --git a/appl/demo/lego/clockface.b b/appl/demo/lego/clockface.b
new file mode 100644
index 00000000..1f2aa105
--- /dev/null
+++ b/appl/demo/lego/clockface.b
@@ -0,0 +1,367 @@
+# Model 1
+implement Clockface;
+
+include "sys.m";
+include "draw.m";
+
+Clockface : module {
+ init : fn (ctxt : ref Draw->Context, argv : list of string);
+};
+
+sys : Sys;
+
+hmpath : con "motor/0"; # hour-hand motor
+mmpath : con "motor/2"; # minute-hand motor
+allmpath : con "motor/012"; # all motors (for stopall msg)
+
+hbpath : con "sensor/0"; # hour-hand sensor
+mbpath : con "sensor/2"; # minute-hand sensor
+lspath: con "sensor/1"; # light sensor;
+
+ONTHRESH : con 780; # light sensor thresholds
+OFFTHRESH : con 740;
+NCLICKS : con 120;
+MINCLICKS : con 2; # min number of clicks required to stop a motor
+
+Hand : adt {
+ motor : ref Sys->FD;
+ sensor : ref Sys->FD;
+ fwd : array of byte;
+ rev : array of byte;
+ stop : array of byte;
+ pos : int;
+};
+
+lightsensor : ref Sys->FD;
+allmotors : ref Sys->FD;
+hourhand : ref Hand;
+minutehand : ref Hand;
+
+reqch: chan of (string, chan of int);
+
+init(nil : ref Draw->Context, argv : list of string)
+{
+ sys = load Sys Sys->PATH;
+ sys->pctl(Sys->NEWPGRP, nil);
+
+ argv = tl argv;
+ if (len argv != 1) {
+ sys->print("usage: lego_dir\n");
+ raise("fail:usage");
+ }
+
+ # set up our control file
+ if (sys->bind("#s", ".", Sys->MBEFORE) == -1) {
+ sys->print("failed to bind srv device: %r\n");
+ return;
+ }
+ f2c := sys->file2chan(".", "clockface");
+ if (f2c == nil) {
+ sys->print("cannot create legolink channel: %r\n");
+ return;
+ }
+
+ legodir := hd argv;
+ if (legodir[len legodir -1] != '/')
+ legodir[len legodir] = '/';
+
+ # get the motor files
+ sys->print("opening motor files\n");
+ hm := sys->open(legodir + hmpath, Sys->OWRITE);
+ mm := sys->open(legodir +mmpath, Sys->OWRITE);
+ allmotors = sys->open(legodir + allmpath, Sys->OWRITE);
+ if (hm == nil || mm == nil || allmotors == nil) {
+ sys->print("cannot open motor files\n");
+ raise("fail:error");
+ }
+
+ # get the sensor files
+ sys->print("opening sensor files\n");
+ hb := sys->open(legodir + hbpath, Sys->ORDWR);
+ mb := sys->open(legodir + mbpath, Sys->ORDWR);
+ lightsensor = sys->open(legodir + lspath, Sys->ORDWR);
+
+ if (hb == nil || mb == nil) {
+ sys->print("cannot open sensor files\n");
+ raise("fail:error");
+ }
+
+ hourhand = ref Hand(hm, hb, array of byte "f7", array of byte "r7", array of byte "s7", 0);
+ minutehand = ref Hand(mm, mb, array of byte "f7", array of byte "r7", array of byte "s7", 0);
+
+ sys->print("setting sensor types\n");
+ setsensortypes(hourhand, minutehand, lightsensor);
+
+ reqch = chan of (string, chan of int);
+ spawn sethands();
+# reqch <-= ("reset", nil);
+ spawn srvlink(f2c);
+}
+
+srvlink(f2c : ref Sys->FileIO)
+{
+ for (;;) alt {
+ (offset, count, fid, rc) := <- f2c.read =>
+ if (rc == nil)
+ continue;
+ if (offset != 0) {
+ rc <-= (nil, nil);
+ continue;
+ }
+ rc <- = (array of byte gettime(), nil);
+
+ (offset, data, fid, wc) := <- f2c.write =>
+ if (wc == nil)
+ continue;
+ if (offset != 0) {
+ wc <-= (0, "bad offset");
+ continue;
+ }
+ spawn settime(wc, string data, len data);
+ }
+}
+
+gettime(): string
+{
+ hpos := hourhand.pos;
+ mpos := minutehand.pos;
+
+ h := 12 * hpos / NCLICKS;
+ m := 60 * mpos / NCLICKS;
+
+ time := "??:??";
+ for (hadj := -1; hadj <= 1; hadj++) {
+ hpos2 := (((h+hadj) * NCLICKS) / 12) + ((m * NCLICKS) / (12 * 60));
+ dhpos := hpos - hpos2;
+ if (dhpos >= -2 && dhpos <= 2) {
+ # allow 2 clicks of imprecision either way
+ time = sys->sprint("%.2d:%.2d", h+hadj, m);
+ break;
+ }
+ }
+ return sys->sprint("%s %d %d", time, hpos*360/NCLICKS, mpos*360/NCLICKS);
+}
+
+settime(wc: Sys->Rwrite, time: string, wn: int)
+{
+ done := chan of int;
+ reqch <-= (time, done);
+ <- done;
+ wc <-= (wn, nil);
+}
+
+str2clicks(s : string) : (int, int)
+{
+ h, m : int = 0;
+ (n, toks) := sys->tokenize(s, ":");
+ if (n > 1) {
+ h = int hd toks;
+ toks = tl toks;
+ n--;
+ }
+ if (n > 0) {
+ m = int hd toks;
+ }
+ h = ((h * NCLICKS) / 12) + ((m * NCLICKS) / (12 * 60));
+ m = (m * NCLICKS)/60;
+ return (h, m);
+}
+
+sethands()
+{
+ for (;;) {
+ (time, rc) := <- reqch;
+ if (time == "reset" || time == "reset\n") {
+ reset();
+ time = "12:00";
+ }
+ (hclk, mclk) := str2clicks(time);
+ for (i := 0; i < 6; i++) {
+ hdelta := clickdistance(hourhand.pos, hclk, NCLICKS);
+ mdelta := clickdistance(minutehand.pos, mclk, NCLICKS);
+ if (hdelta == 0 && mdelta == 0)
+ break;
+ if (hdelta != 0)
+ sethand(hourhand, hdelta);
+ if (mdelta != 0)
+ sethand(minutehand, mdelta);
+ }
+ releaseall();
+ if (rc != nil)
+ rc <- = 1;
+ }
+}
+
+clickdistance(start, stop, mod : int) : int
+{
+ if (start > stop)
+ stop += mod;
+ d := (stop - start) % mod;
+ if (d > mod/2)
+ d -= mod;
+ return d;
+}
+
+setsensortypes(h1, h2 : ref Hand, ls : ref Sys->FD)
+{
+ button := array of byte "b0";
+ light := array of byte "l0";
+
+ sys->seek(h1.sensor, big 0, Sys->SEEKSTART);
+ sys->write(h1.sensor, button, len button);
+ sys->seek(h2.sensor, big 0, Sys->SEEKSTART);
+ sys->write(h2.sensor, button, len button);
+ sys->seek(ls, big 0, Sys->SEEKSTART);
+ sys->write(ls, light, len light);
+}
+
+HOUR_ADJUST : con 1;
+MINUTE_ADJUST : con 3;
+reset()
+{
+ # run the motors until hands are well away from 12 o'clock (below threshold)
+ setsensortypes(hourhand, minutehand, lightsensor);
+ val := readsensor(lightsensor);
+ if (val > OFFTHRESH) {
+ triggered := chan of int;
+ sys->print("wait for hands clear of light sensor\n");
+ spawn lightwait(triggered, lightsensor, 0);
+ forward(minutehand);
+ reverse(hourhand);
+ val = <- triggered;
+ stopall();
+ sys->print("sensor %d\n", val);
+ }
+
+ resethand(hourhand);
+ hourhand.pos += HOUR_ADJUST;
+ resethand(minutehand);
+ minutehand.pos += MINUTE_ADJUST;
+}
+
+sethand(hand : ref Hand, delta : int)
+{
+ triggered := chan of int;
+ dir := 1;
+ if (delta < 0) {
+ dir = -1;
+ delta = -delta;
+ }
+ if (delta > MINCLICKS) {
+ spawn handwait(triggered, hand, delta - MINCLICKS);
+ if (dir > 0)
+ forward(hand);
+ else
+ reverse(hand);
+ <- triggered;
+ stop(hand);
+ hand.pos += dir * readsensor(hand.sensor);
+ } else {
+ startval := readsensor(hand.sensor);
+ if (dir > 0)
+ forward(hand);
+ else
+ reverse(hand);
+ stop(hand);
+ hand.pos += dir * (readsensor(hand.sensor) - startval);
+ }
+ if (hand.pos < 0)
+ hand.pos += NCLICKS;
+ hand.pos %= NCLICKS;
+}
+
+resethand(hand : ref Hand)
+{
+ triggered := chan of int;
+ val : int;
+
+ # run the hand until the light sensor is above threshold
+ sys->print("running hand until light sensor activated\n");
+ spawn lightwait(triggered, lightsensor, 1);
+ forward(hand);
+ val = <- triggered;
+ stop(hand);
+ sys->print("sensor %d\n", val);
+
+ startclick := readsensor(hand.sensor);
+
+ # advance until light sensor drops below threshold
+ sys->print("running hand until light sensor clear\n");
+ spawn lightwait(triggered, lightsensor, 0);
+ forward(hand);
+ val = <- triggered;
+ stop(hand);
+ sys->print("sensor %d\n", val);
+
+ stopclick := readsensor(hand.sensor);
+ nclicks := stopclick - startclick;
+ sys->print("startpos %d, endpos %d (nclicks %d)\n", startclick, stopclick, nclicks);
+
+ hand.pos = nclicks/2;
+}
+
+stop(hand : ref Hand)
+{
+ sys->seek(hand.motor, big 0, Sys->SEEKSTART);
+ sys->write(hand.motor, hand.stop, len hand.stop);
+}
+
+stopall()
+{
+ msg := array of byte "s0s0s0";
+ sys->seek(allmotors, big 0, Sys->SEEKSTART);
+ sys->write(allmotors, msg, len msg);
+}
+
+releaseall()
+{
+ msg := array of byte "F0F0F0";
+ sys->seek(allmotors, big 0, Sys->SEEKSTART);
+ sys->write(allmotors, msg, len msg);
+}
+
+forward(hand : ref Hand)
+{
+ sys->seek(hand.motor, big 0, Sys->SEEKSTART);
+ sys->write(hand.motor, hand.fwd, len hand.fwd);
+}
+
+reverse(hand : ref Hand)
+{
+ sys->seek(hand.motor, big 0, Sys->SEEKSTART);
+ sys->write(hand.motor, hand.rev, len hand.rev);
+}
+
+readsensor(fd : ref Sys->FD) : int
+{
+ buf := array [4] of byte;
+ sys->seek(fd, big 0, Sys->SEEKSTART);
+ n := sys->read(fd, buf, len buf);
+ if (n <= 0)
+ return -1;
+ return int string buf[0:n];
+}
+
+handwait(reply : chan of int, hand : ref Hand, clicks : int)
+{
+ blk := array of byte ("b" + string clicks);
+ sys->seek(hand.sensor, big 0, Sys->SEEKSTART);
+ sys->print("handwait(%s)\n", string blk);
+ if (sys->write(hand.sensor, blk, len blk) != len blk)
+ sys->print("handwait write error: %r\n");
+ reply <- = readsensor(hand.sensor);
+}
+
+lightwait(reply : chan of int, fd : ref Sys->FD, on : int)
+{
+ thresh := "";
+ if (on)
+ thresh = "l>" + string ONTHRESH;
+ else
+ thresh = "l<" + string OFFTHRESH;
+ blk := array of byte (thresh);
+ sys->print("lightwait(%s)\n", string blk);
+ sys->seek(fd, big 0, Sys->SEEKSTART);
+ sys->write(fd, blk, len blk);
+ reply <- = readsensor(fd);
+} \ No newline at end of file
diff --git a/appl/demo/lego/clockface.dis b/appl/demo/lego/clockface.dis
new file mode 100644
index 00000000..27ef856a
--- /dev/null
+++ b/appl/demo/lego/clockface.dis
Binary files differ
diff --git a/appl/demo/lego/clockface.sbl b/appl/demo/lego/clockface.sbl
new file mode 100644
index 00000000..f8e4dfb9
--- /dev/null
+++ b/appl/demo/lego/clockface.sbl
@@ -0,0 +1,998 @@
+limbo .sbl 2.1
+Clockface
+3
+clockface.b
+sys.m
+draw.m
+678
+44.1,25 0
+45.1,29 1
+11,23 1
+25,28 1
+1,29 1
+1,29 1
+47.1,15 2
+48.5,13 3
+5,18 3
+49.2,33 4
+13,32 4
+2,33 4
+2,33 4
+50.2,21 5
+54.5,39 6
+15,19 6
+21,24 6
+26,38 6
+5,39 6
+5,39 6
+5,45 6
+55.2,47 7
+13,46 7
+2,47 7
+2,47 7
+56.2,8 8
+58.1,40 9
+23,26 9
+28,39 9
+1,40 9
+1,40 9
+59.5,15 10
+60.2,52 11
+13,51 11
+2,52 11
+2,52 11
+61.2,8 12
+64.1,19 13
+65.13,24 14
+13,27 14
+5,28 14
+5,35 14
+66.10,21 15
+2,28 15
+69.1,36 16
+12,35 16
+1,36 16
+1,36 16
+70.1,47 17
+17,33 17
+35,46 17
+1,47 17
+1,47 17
+71.1,46 18
+17,32 18
+34,45 18
+1,46 18
+1,46 18
+72.1,55 19
+23,41 19
+43,54 19
+1,55 19
+1,55 19
+73.5,14 20
+18,27 20
+31,47 20
+74.2,41 21
+13,40 21
+2,41 21
+2,41 21
+75.2,21 22
+79.1,37 23
+12,36 23
+1,37 23
+1,37 23
+80.1,46 24
+17,33 24
+35,45 24
+1,46 24
+1,46 24
+81.1,46 25
+17,33 25
+35,45 25
+1,46 25
+1,46 25
+82.1,54 26
+25,41 26
+43,53 26
+1,54 26
+1,54 26
+84.5,14 27
+18,27 27
+85.2,42 28
+13,41 28
+2,42 28
+2,42 28
+86.2,21 29
+89.1,91 30
+21,23 30
+25,27 30
+29,47 30
+49,67 30
+69,87 30
+89,90 30
+1,91 30
+1,91 31
+90.1,93 32
+23,25 32
+27,29 32
+31,49 32
+51,69 32
+71,89 32
+91,92 32
+1,93 32
+1,93 33
+92.1,37 34
+12,36 34
+1,37 34
+1,37 34
+93.1,50 35
+16,24 35
+26,36 35
+38,49 35
+1,50 35
+95.1,38 36
+96.1,17 37
+1,17 37
+98.1,19 38
+15,18 38
+1,19 38
+99.0,1 39
+104.32,40 40
+32,40 40
+113.31,40 40
+31,40 40
+103.10,16 40
+10,16 40
+10,16 40
+10,16 40
+104.29,40 40
+29,40 41
+105.6,15 42
+6,15 43
+6,15 44
+106.3,11 45
+107.6,17 46
+108.11,14 47
+16,19 47
+3,20 47
+3,20 48
+3,20 49
+3,20 50
+3,20 51
+109.3,11 52
+111.25,34 53
+25,34 53
+25,34 53
+11,34 53
+11,34 54
+36,39 53
+2,40 53
+2,40 55
+2,40 56
+2,40 57
+2,40 58
+2,40 40
+113.28,40 40
+28,40 59
+28,40 60
+114.6,15 61
+6,15 62
+6,15 63
+6,15 64
+6,15 65
+115.3,11 66
+116.6,17 67
+117.11,12 68
+14,26 68
+3,27 68
+3,27 69
+3,27 70
+3,27 71
+3,27 72
+3,27 73
+118.3,11 74
+120.2,42 75
+16,18 75
+20,31 75
+33,41 75
+2,42 75
+2,42 76
+2,42 77
+2,42 78
+2,42 79
+2,42 40
+126.1,21 80
+127.1,23 81
+129.6,15 82
+1,25 82
+130.6,15 83
+1,25 83
+132.1,16 84
+133.6,16 85
+18,27 86
+134.13,21 87
+12,32 87
+11,38 87
+42,55 87
+41,68 87
+2,68 87
+135.2,23 88
+136.6,17 89
+21,31 89
+138.3,45 90
+22,33 90
+35,41 90
+43,44 90
+3,45 90
+3,45 90
+139.3,8 91
+133.29,35 92
+29,35 92
+142.8,73 93
+20,30 93
+32,36 93
+38,46 93
+38,54 93
+56,64 93
+56,72 93
+8,73 93
+8,73 93
+1,73 93
+147.1,20 94
+148.12,16 95
+18,22 95
+1,23 95
+1,23 96
+1,23 97
+149.1,8 98
+150.9,11 99
+13,16 99
+1,17 99
+1,17 100
+151.0,1 101
+155.14,15 102
+14,15 102
+156.14,35 103
+28,29 103
+31,34 103
+14,35 103
+14,35 103
+157.5,10 104
+158.10,17 105
+2,17 105
+2,17 106
+159.2,16 107
+160.2,5 108
+162.5,10 109
+163.10,17 110
+2,17 110
+2,17 111
+165.6,19 112
+5,25 112
+29,42 112
+28,55 112
+1,55 112
+166.5,18 113
+1,21 113
+167.9,10 114
+12,13 114
+1,14 114
+173.16,24 115
+174.6,21 116
+25,42 116
+175.3,10 117
+3,10 117
+176.3,17 118
+178.18,34 119
+29,33 119
+18,34 119
+18,34 119
+179.7,13 120
+15,20 121
+180.3,55 122
+27,39 122
+41,45 122
+47,54 122
+3,55 122
+3,55 122
+181.3,57 123
+27,41 123
+43,47 123
+49,56 123
+3,57 123
+3,57 123
+182.7,18 124
+22,33 124
+183.4,9 125
+184.7,18 126
+185.4,29 127
+12,20 127
+22,28 127
+4,29 127
+186.7,18 128
+187.4,31 129
+12,22 129
+24,30 129
+4,31 129
+179.22,25 130
+22,25 130
+189.2,14 131
+2,14 131
+190.6,15 132
+191.3,12 133
+3,12 134
+3,12 135
+3,12 136
+3,12 136
+197.5,17 137
+198.2,13 138
+199.6,20 139
+1,26 139
+200.9,14 140
+5,14 140
+201.2,10 141
+202.8,9 142
+1,9 142
+207.1,29 143
+208.1,28 144
+210.1,44 145
+11,20 145
+22,27 145
+29,43 145
+1,44 145
+1,44 145
+211.1,42 146
+12,21 146
+23,29 146
+31,41 146
+1,42 146
+1,42 146
+212.1,44 147
+11,20 147
+22,27 147
+29,43 147
+1,44 147
+1,44 147
+213.1,42 148
+12,21 148
+23,29 148
+31,41 148
+1,42 148
+1,42 148
+214.1,37 149
+11,13 149
+15,20 149
+22,36 149
+1,37 149
+1,37 149
+215.1,33 150
+12,14 150
+16,21 150
+23,32 150
+1,33 150
+1,33 150
+216.0,1 151
+223.1,50 152
+16,24 152
+26,36 152
+38,49 152
+1,50 152
+224.1,31 153
+19,30 153
+1,31 153
+1,31 153
+225.5,20 154
+226.2,26 155
+227.2,54 156
+13,53 156
+2,54 156
+2,54 156
+228.2,44 157
+18,27 157
+29,40 157
+42,43 157
+2,44 157
+229.2,21 158
+10,20 158
+2,21 158
+230.2,19 159
+10,18 159
+2,19 159
+231.2,20 160
+232.2,11 161
+2,11 161
+233.2,32 162
+13,26 162
+28,31 162
+2,32 162
+2,32 162
+2,32 163
+236.1,20 164
+11,19 164
+1,20 164
+237.1,28 165
+238.1,22 166
+11,21 166
+1,22 166
+239.1,32 167
+240.0,1 168
+244.1,25 169
+245.1,9 170
+246.5,14 171
+247.2,10 172
+248.2,16 173
+250.5,22 174
+251.2,52 175
+17,26 175
+28,32 175
+34,51 175
+2,52 175
+252.6,13 176
+253.3,16 177
+11,15 177
+3,16 177
+3,16 178
+255.3,16 179
+11,15 179
+3,16 179
+256.2,14 180
+257.2,12 181
+7,11 181
+2,12 181
+258.19,42 182
+30,41 182
+19,42 182
+19,42 182
+13,42 182
+1,42 182
+1,42 183
+260.2,37 184
+25,36 184
+2,37 184
+2,37 184
+261.6,13 185
+262.3,16 186
+11,15 186
+3,16 186
+3,16 187
+264.3,16 188
+11,15 188
+3,16 188
+265.2,12 189
+7,11 189
+2,12 189
+266.21,44 190
+32,43 190
+21,44 190
+21,44 190
+20,56 190
+14,56 190
+2,56 190
+268.5,17 191
+269.2,21 192
+270.1,20 193
+271.0,1 194
+275.1,25 195
+279.1,58 196
+12,57 196
+1,58 196
+1,58 196
+280.1,43 197
+17,26 197
+28,39 197
+41,42 197
+1,43 197
+281.1,14 198
+9,13 198
+1,14 198
+282.1,19 199
+283.1,11 200
+6,10 200
+1,11 200
+284.1,31 201
+12,25 201
+27,30 201
+1,31 201
+1,31 201
+286.1,38 202
+26,37 202
+1,38 202
+1,38 202
+289.1,54 203
+12,53 203
+1,54 203
+1,54 203
+290.1,43 204
+17,26 204
+28,39 204
+41,42 204
+1,43 204
+291.1,14 205
+9,13 205
+1,14 205
+292.1,19 206
+293.1,11 207
+6,10 207
+1,11 207
+294.1,31 208
+12,25 208
+27,30 208
+1,31 208
+1,31 208
+296.1,37 209
+25,36 209
+1,37 209
+1,37 209
+297.1,34 210
+298.1,84 211
+12,51 211
+53,63 211
+65,74 211
+76,83 211
+1,84 211
+1,84 211
+300.1,21 212
+301.0,1 213
+305.1,45 214
+11,21 214
+23,28 214
+30,44 214
+1,45 214
+1,45 214
+306.1,49 215
+12,22 215
+24,33 215
+35,48 215
+1,49 215
+1,49 215
+307.0,1 216
+311.1,30 217
+312.1,44 218
+11,20 218
+22,27 218
+29,43 218
+1,44 218
+1,44 218
+313.1,36 219
+12,21 219
+23,26 219
+28,35 219
+1,36 219
+1,36 219
+314.0,1 220
+318.1,30 221
+319.1,44 222
+11,20 222
+22,27 222
+29,43 222
+1,44 222
+1,44 222
+320.1,36 223
+12,21 223
+23,26 223
+28,35 223
+1,36 223
+1,36 223
+321.0,1 224
+325.1,45 225
+11,21 225
+23,28 225
+30,44 225
+1,45 225
+1,45 225
+326.1,47 226
+12,22 226
+24,32 226
+34,46 226
+1,47 226
+1,47 226
+327.0,1 227
+331.1,45 228
+11,21 228
+23,28 228
+30,44 228
+1,45 228
+1,45 228
+332.1,47 229
+12,22 229
+24,32 229
+34,46 229
+1,47 229
+1,47 229
+333.0,1 230
+337.1,25 231
+338.1,37 232
+11,13 232
+15,20 232
+22,36 232
+1,37 232
+1,37 232
+339.1,33 233
+16,18 233
+20,23 233
+25,32 233
+1,33 233
+1,33 233
+340.5,11 234
+341.9,11 235
+2,11 235
+342.19,22 236
+19,27 236
+12,27 236
+8,27 236
+8,27 237
+1,27 236
+347.29,42 238
+22,43 238
+1,43 238
+1,43 239
+348.1,46 240
+11,22 240
+24,29 240
+31,45 240
+1,46 240
+1,46 240
+349.1,41 241
+12,28 241
+30,40 241
+1,41 241
+1,41 241
+350.5,42 242
+16,27 242
+29,32 242
+34,41 242
+5,42 242
+5,42 242
+46,53 242
+5,53 242
+351.1,41 243
+12,40 243
+1,41 243
+1,41 243
+352.12,35 244
+23,34 244
+12,35 244
+12,35 244
+1,35 244
+353.0,1 245
+357.1,13 246
+358.5,7 247
+359.2,33 248
+2,33 249
+361.2,34 250
+362.1,30 251
+363.1,42 252
+12,29 252
+31,41 252
+1,42 252
+1,42 252
+364.1,37 253
+11,13 253
+15,20 253
+22,36 253
+1,37 253
+1,37 253
+365.1,29 254
+12,14 254
+16,19 254
+21,28 254
+1,29 254
+1,29 254
+366.12,26 255
+23,25 255
+12,26 255
+12,26 255
+1,26 255
+367.0,1 256
+16
+aSys->Dir 1:26.1,39.2 64
+11
+0:name:28.2,6 s
+4:uid:29.2,5 s
+8:gid:30.2,5 s
+12:muid:31.2,6 s
+16:qid:32.2,5 @1
+
+32:mode:33.2,6 i
+36:atime:34.2,7 i
+40:mtime:35.2,7 i
+48:length:36.2,8 B
+56:dtype:37.2,7 i
+60:dev:38.2,5 i
+aSys->Qid 11.1,16.2 16
+3
+0:path:13.2,6 B
+8:vers:14.2,6 i
+12:qtype:15.2,7 i
+aDraw->Chans 2:70.1,82.2 4
+1
+0:desc:72.2,6 i
+aDraw->Context 274.1,279.2 12
+3
+0:display:276.2,9 R@4
+
+4:screen:277.2,8 R@8
+
+8:wm:278.2,4 Ct8.2
+0:t0:15,21 s
+4:t1:15,21 Ct8.2
+0:t0:32,38 s
+4:t1:32,38 R@9
+
+
+
+aDraw->Display 201.1,230.2 20
+5
+0:image:203.2,7 R@5
+
+4:white:204.2,7 R@5
+
+8:black:205.2,7 R@5
+
+12:opaque:206.2,8 R@5
+
+16:transparent:207.2,13 R@5
+
+aDraw->Image 142.1,198.2 56
+8
+0:r:146.2,3 @6
+
+16:clipr:147.2,7 @6
+
+32:depth:148.2,7 i
+36:chans:149.2,7 @2
+
+40:repl:150.2,6 i
+44:display:151.2,9 R@4
+
+48:screen:152.2,8 R@8
+
+52:iname:153.2,7 s
+aDraw->Rect 116.1,139.2 16
+2
+0:min:118.2,5 @7
+
+8:max:119.2,5 @7
+
+aDraw->Point 99.1,113.2 8
+2
+0:x:101.2,3 i
+4:y:102.2,3 i
+aDraw->Screen 249.1,263.2 16
+4
+0:id:251.2,4 i
+4:image:252.2,7 R@5
+
+8:fill:253.2,6 R@5
+
+12:display:254.2,9 R@4
+
+aDraw->Wmcontext 282.1,291.2 28
+7
+0:kbd:284.2,5 Ci
+4:ptr:285.2,5 CR@10
+
+8:ctl:286.2,5 Cs
+12:wctl:287.2,6 Cs
+16:images:288.2,8 CR@5
+
+20:connfd:289.2,8 R@11
+
+24:ctxt:290.2,6 R@3
+
+aDraw->Pointer 266.1,271.2 16
+3
+0:buttons:268.2,9 i
+4:xy:269.2,4 @7
+
+12:msec:270.2,6 i
+aSys->FD 1:45.1,48.2 4
+1
+0:fd:47.2,4 i
+aSys->FileIO 65.1,69.2 8
+2
+0:read:67.2,6 Ct16.4
+0:t0:17,20 i
+4:t1:17,20 i
+8:t2:17,20 i
+12:t3:17,20 @13
+
+
+4:write:68.2,7 Ct16.4
+0:t0:18,21 i
+4:t1:18,21 Ab
+8:t2:18,21 i
+12:t3:18,21 @14
+
+
+Ct8.2
+0:t0:63.22,35 Ab
+4:t1:22,35 s
+Ct8.2
+0:t0:64.23,26 i
+4:t1:23,26 s
+aHand 0:26.0,33.1 24
+6
+0:motor:27.1,6 R@11
+
+4:sensor:28.1,7 R@11
+
+8:fwd:29.1,4 Ab
+12:rev:30.1,4 Ab
+16:stop:31.1,5 Ab
+20:pos:32.1,4 i
+19
+0:init
+1
+36:argv:42.30,34 Ls
+6
+40:legodir:64.1,8 s
+44:f2c:58.1,4 R@12
+
+48:hb:80.1,3 R@11
+
+52:hm:70.1,3 R@11
+
+56:mb:81.1,3 R@11
+
+60:mm:71.1,3 R@11
+
+n131:srvlink
+1
+32:f2c:101.8,11 R@12
+
+8
+36:offset:104.2,8 i
+40:count:10,15 i
+44:fid:17,20 i
+48:rc:22,24 @13
+
+52:offset:113.2,8 i
+56:data:10,14 Ab
+60:fid:16,19 i
+64:wc:21,23 @14
+
+n195:gettime
+0
+8
+32:hadj:133.6,10 i
+36:hpos:126.1,5 i
+40:dhpos:135.2,7 i
+44:h:129.1,2 i
+48:m:130.1,2 i
+52:mpos:127.1,5 i
+56:time:132.1,5 s
+60:hpos2:134.2,7 i
+s232:settime
+3
+32:wc:145.8,10 @14
+
+36:time:25,29 s
+40:wn:39,41 i
+1
+44:done:147.1,5 Ci
+n244:str2clicks
+1
+32:s:153.11,12 s
+4
+36:m:155.4,5 i
+40:h:1,2 i
+44:n:156.2,3 i
+48:toks:5,9 Ls
+t8.2
+0:t0:153.26,29 i
+4:t1:26,29 i
+271:sethands
+0
+7
+32:time:173.3,7 s
+36:rc:9,11 Ci
+40:hdelta:180.3,9 i
+44:mdelta:181.3,9 i
+48:i:179.7,8 i
+52:hclk:178.3,7 i
+56:mclk:9,13 i
+n318:clickdistance
+3
+32:start:195.14,19 i
+36:stop:21,25 i
+40:mod:27,30 i
+1
+44:d:199.1,2 i
+i327:setsensortypes
+3
+32:h1:205.15,17 R@15
+
+36:h2:19,21 R@15
+
+40:ls:34,36 R@11
+
+2
+44:button:207.1,7 Ab
+48:light:208.1,6 Ab
+n366:reset
+0
+2
+32:val:224.1,4 i
+36:triggered:226.2,11 Ci
+n410:sethand
+2
+32:hand:242.8,12 R@15
+
+36:delta:25,30 i
+3
+40:dir:245.1,4 i
+44:triggered:244.1,10 Ci
+48:startval:260.2,10 i
+n466:resethand
+1
+32:hand:273.10,14 R@15
+
+5
+36:triggered:275.1,10 Ci
+40:val:276.1,4 i
+44:nclicks:297.1,8 i
+48:startclick:286.1,11 i
+52:stopclick:296.1,10 i
+n527:stop
+1
+32:hand:303.5,9 R@15
+
+0
+n540:stopall
+0
+1
+32:msg:311.1,4 Ab
+n554:releaseall
+0
+1
+32:msg:318.1,4 Ab
+n568:forward
+1
+32:hand:323.8,12 R@15
+
+0
+n581:reverse
+1
+32:hand:329.8,12 R@15
+
+0
+n594:readsensor
+1
+32:fd:335.11,13 R@11
+
+2
+36:buf:337.1,4 Ab
+40:n:339.1,2 i
+i616:handwait
+3
+32:reply:345.9,14 Ci
+36:hand:30,34 R@15
+
+40:clicks:47,53 i
+1
+44:blk:347.1,4 Ab
+n649:lightwait
+3
+32:reply:355.10,15 Ci
+36:fd:31,33 R@11
+
+40:on:49,51 i
+2
+44:blk:362.1,4 Ab
+48:thresh:357.1,7 s
+n6
+60:allmotors:36.0,9 R@11
+
+116:hourhand:37.0,8 R@15
+
+132:lightsensor:35.0,11 R@11
+
+140:minutehand:38.0,10 R@15
+
+172:reqch:40.0,5 Ct8.2
+0:t0:16,22 s
+4:t1:16,22 Ci
+
+224:sys:11.0,3 mSys
+1:4.0,160.1 0
+
diff --git a/appl/demo/lego/clockreg.sh b/appl/demo/lego/clockreg.sh
new file mode 100644
index 00000000..9c0c6447
--- /dev/null
+++ b/appl/demo/lego/clockreg.sh
@@ -0,0 +1,17 @@
+#!/dis/sh.dis
+load std
+
+port=$1
+DIR=/dis/demo/lego
+pctl forkns newpgrp
+
+cd $DIR
+if { firmdl $port /dis/demo/lego/styx.srec } {
+ legolink $port
+ memfs /tmp
+ cd /tmp
+ mount -o -A /net/legolink /n/remote
+ $DIR/clockface /n/remote
+ echo reset > clockface
+ grid/register -a resource Robot -a name 'Lego Clock' {export /tmp}
+}
diff --git a/appl/demo/lego/firmdl.b b/appl/demo/lego/firmdl.b
new file mode 100644
index 00000000..1cc94e7b
--- /dev/null
+++ b/appl/demo/lego/firmdl.b
@@ -0,0 +1,294 @@
+implement RcxFirmdl;
+
+include "sys.m";
+include "draw.m";
+include "bufio.m";
+include "rcxsend.m";
+
+RcxFirmdl : module {
+ init : fn (ctxt : ref Draw->Context, argv : list of string);
+};
+
+sys : Sys;
+bufio : Bufio;
+rcx : RcxSend;
+me : int;
+
+Iobuf : import bufio;
+
+Image : adt {
+ start : int;
+ offset : int;
+ length : int;
+ data : array of byte;
+};
+
+DL_HDR : con 5; # download packet hdr size
+DL_DATA : con 16rc8; # download packet payload size
+
+init(nil : ref Draw->Context, argv : list of string)
+{
+ sys = load Sys Sys->PATH;
+ me = sys->pctl(Sys->NEWPGRP, nil);
+
+ bufio = load Bufio Bufio->PATH;
+ if (bufio == nil)
+ error(sys->sprint("cannot load bufio module: %r"));
+ rcx = load RcxSend "rcxsend.dis";
+ if (rcx == nil)
+ error(sys->sprint("cannot load rcx module: %r"));
+
+ argv = tl argv;
+ if (len argv != 2)
+ error("usage: portnum file");
+
+ portnum := int hd argv;
+ file := hd tl argv;
+
+ img := getimage(file);
+ cksum := sum(img.data[0:img.length]);
+ sys->print("length %.4x start %.4x \n", img.length, img.start);
+
+ err := rcx->init(portnum, 1);
+ if (err != nil)
+ error(err);
+
+ # delete firmware
+ sys->print("delete firmware\n");
+ reply : array of byte;
+ rmfirm := array [] of {byte 16r65, byte 1, byte 3, byte 5, byte 7, byte 11};
+ reply = rcx->send(rmfirm, len rmfirm, 1);
+ if (reply == nil)
+ error("delete firmware failed");
+ chkreply(reply, array [] of {byte 16r92}, "delete firmware");
+
+ # start download
+ sys->print("start download\n");
+ dlstart := array [] of {byte 16r75,
+ byte (img.start & 16rff),
+ byte ((img.start>>8) & 16rff),
+ byte (cksum & 16rff),
+ byte ((cksum>>8) & 16rff),
+ byte 0,
+ };
+ reply = rcx->send(dlstart, len dlstart, 2);
+ chkreply(reply,array [] of {byte 16r82, byte 0}, "start download");
+
+ # send the image
+ data := array [DL_HDR+DL_DATA+1] of byte; # hdr + data + 1 byte cksum
+ seqnum := 1;
+ step := DL_DATA;
+ for (i := 0; i < img.length; i += step) {
+ data[0] = byte 16r45;
+ if (seqnum & 1)
+ # alternate ops have bit 4 set
+ data[0] |= byte 16r08;
+ if (i + step > img.length) {
+ step = img.length - i;
+ seqnum = 0;
+ }
+ sys->print(".");
+ data[1] = byte (seqnum & 16rff);
+ data[2] = byte ((seqnum >> 8) & 16rff);
+ data[3] = byte (step & 16rff);
+ data[4] = byte ((step >> 8) & 16rff);
+ data[5:] = img.data[i:i+step];
+ data[5+step] = byte (sum(img.data[i:i+step]) & 16rff);
+ reply = rcx->send(data, DL_HDR+step+1, 2);
+ chkreply(reply, array [] of {byte 16rb2, byte 0}, "tx data");
+ seqnum++;
+ }
+
+ # unlock firmware
+ sys->print("\nunlock firmware\n");
+ ulfirm := array [] of {byte 16ra5, byte 'L', byte 'E', byte 'G', byte 'O', byte 174};
+ reply = rcx->send(ulfirm, len ulfirm, 26);
+ chkreply(reply, array [] of {byte 16r52}, "unlock firmware");
+ sys->print("result: %s\n", string reply[1:]);
+
+ # all done, tidy up
+ killgrp(me);
+}
+
+chkreply(got, expect : array of byte, err : string)
+{
+ if (got == nil || len got < len expect)
+ error(err + ": short reply");
+ # RCX sometimes sets bit 3 of 'opcode' byte to prevent
+ # headers with same opcode having exactly same value - mask out
+ got[0] &= byte 16rf7;
+
+ for (i := 0; i < len expect; i++)
+ if (got[i] != expect[i]) {
+ hexdump(got);
+ error(sys->sprint("%s: reply mismatch at %d", err, i));
+ }
+}
+
+error(msg : string)
+{
+ sys->print("%s\n", msg);
+ killgrp(me);
+ raise "fail:error" ;
+}
+
+killgrp(pid : int)
+{
+ pctl := sys->open("/prog/" + string pid + "/ctl", Sys->OWRITE);
+ if (pctl != nil) {
+ poison := array of byte "killgrp";
+ sys->write(pctl, poison, len poison);
+ }
+}
+
+sum(data : array of byte) : int
+{
+ t := 0;
+ for (i := 0; i < len data; i++)
+ t += int data[i];
+ return t;
+}
+
+hexdump(data : array of byte)
+{
+ for (i := 0; i < len data; i++)
+ sys->print("%.2x ", int data[i]);
+ sys->print("\n");
+}
+
+IMGSTART : con 16r8000;
+IMGLEN : con 16r4c00;
+getimage(path : string) : ref Image
+{
+ img := ref Image (IMGSTART, IMGSTART, 0, array [IMGLEN] of {* => byte 0});
+ iob := bufio->open(path, Sys->OREAD);
+ if (iob == nil)
+ error(sys->sprint("cannot open %s: %r", path));
+
+ lnum := 0;
+ while ((s := iob.gets('\n')) != nil) {
+ lnum++;
+ slen := len s;
+ # trim trailing space
+ while (slen > 0) {
+ ch := s[slen -1];
+ if (ch == ' ' || ch == '\r' || ch == '\n') {
+ slen--;
+ continue;
+ }
+ break;
+ }
+ # ignore blank lines
+ if (slen == 0)
+ continue;
+
+ if (slen < 10)
+ # STNNAAAACC
+ error("short S-record: line " + string lnum);
+
+ s = s[0:slen];
+ t := s[1];
+ if (s[0] != 'S' || t < '0' || t > '9')
+ error("bad S-record format: line " + string lnum);
+
+ data := hex2bytes(s[2:]);
+ if (data == nil)
+ error("bad chars in S-record: line " + string lnum);
+
+ count := int data[0];
+ cksum := int data[len data - 1];
+ if (count != len data -1)
+ error("S-record length mis-match: line " + string lnum);
+
+ if (sum(data[0:len data -1]) & 16rff != 16rff)
+ error("bad S-record checksum: line " + string lnum);
+
+ alen : int;
+ case t {
+ '0' =>
+ # addr[2] mname[10] ver rev desc[18] cksum
+ continue;
+ '1' =>
+ # 16-bit address, data
+ alen = 2;
+ '2' =>
+ # 24-bit address, data
+ alen = 3;
+ '3' =>
+ # 32-bit address, data
+ alen = 4;
+ '4' =>
+ # extension record
+ error("bad S-record type: line " + string lnum);
+ '5' =>
+ # data record count - ignore
+ continue;
+ '6' =>
+ # unused - ignore
+ continue;
+ '7' =>
+ img.start = wordval(data, 1, 4);
+ continue;
+ '8' =>
+ img.start = wordval(data, 1, 3);
+ continue;
+ '9' =>
+ img.start = wordval(data, 1, 2);
+ continue;
+ }
+ addr := wordval(data, 1, alen) - img.offset;
+ if (addr < 0 || addr > len img.data)
+ error("S-record address out of range: line " + string lnum);
+ img.data[addr:] = data[1+alen:1+count];
+ img.length = max(img.length, addr + count -(alen +1));
+ }
+ iob.close();
+ return img;
+}
+
+wordval(src : array of byte, s, l : int) : int
+{
+ r := 0;
+ for (i := 0; i < l; i++) {
+ r <<= 8;
+ r += int src[s+i];
+ }
+ return r;
+}
+
+max(a, b : int) : int
+{
+ if (a > b)
+ return a;
+ return b;
+}
+
+hex2bytes(s : string) : array of byte
+{
+ slen := len s;
+ if (slen & 1)
+ # should be even
+ return nil;
+ data := array [slen/2] of byte;
+ six := 0;
+ dix := 0;
+ while (six < slen) {
+ d1 := hexdigit(s[six++]);
+ d2 := hexdigit(s[six++]);
+ if (d1 == -1 || d2 == -1)
+ return nil;
+ data[dix++] = byte ((d1 << 4) + d2);
+ }
+ return data;
+}
+
+hexdigit(h : int) : int
+{
+ if (h >= '0' && h <= '9')
+ return h - '0';
+ if (h >= 'A' && h <= 'F')
+ return 10 + h - 'A';
+ if (h >= 'a' && h <= 'f')
+ return 10 + h - 'a';
+ return -1;
+}
diff --git a/appl/demo/lego/firmdl.dis b/appl/demo/lego/firmdl.dis
new file mode 100644
index 00000000..de04fdbb
--- /dev/null
+++ b/appl/demo/lego/firmdl.dis
Binary files differ
diff --git a/appl/demo/lego/firmdl.sbl b/appl/demo/lego/firmdl.sbl
new file mode 100644
index 00000000..2fd58677
--- /dev/null
+++ b/appl/demo/lego/firmdl.sbl
@@ -0,0 +1,819 @@
+limbo .sbl 2.1
+RcxFirmdl
+5
+firmdl.b
+sys.m
+draw.m
+bufio.m
+rcxsend.m
+587
+31.1,25 0
+32.1,34 1
+16,28 1
+30,33 1
+1,34 1
+1,34 1
+34.1,31 2
+35.5,17 3
+36.8,51 4
+20,50 4
+8,51 4
+8,51 4
+2,52 4
+2,52 4
+2,52 5
+2,52 4
+37.1,33 6
+38.5,15 7
+39.8,49 8
+20,48 8
+8,49 8
+8,49 8
+2,50 8
+2,50 8
+2,50 9
+2,50 8
+41.1,15 10
+42.5,13 11
+5,18 11
+43.2,30 12
+8,29 12
+2,30 12
+45.16,23 13
+1,23 13
+1,23 14
+46.12,19 15
+1,19 15
+1,19 16
+48.1,22 17
+17,21 17
+1,22 17
+1,22 17
+49.1,37 18
+25,35 18
+14,22 18
+14,36 18
+1,37 18
+1,37 18
+50.1,63 19
+12,39 19
+41,51 19
+53,62 19
+1,63 19
+1,63 19
+52.1,29 20
+18,25 20
+27,28 20
+1,29 20
+1,29 20
+53.5,15 21
+54.2,12 22
+8,11 22
+2,12 22
+57.1,32 23
+12,31 23
+1,32 23
+1,32 23
+59.1,76 24
+24,34 24
+24,34 24
+36,42 24
+36,42 24
+44,50 24
+44,50 24
+52,58 24
+52,58 24
+60,66 24
+60,66 24
+68,75 24
+68,75 24
+60.1,41 25
+19,25 25
+27,37 25
+39,40 25
+1,41 25
+1,41 25
+61.5,17 26
+62.2,33 27
+8,32 27
+2,33 27
+63.1,61 28
+10,15 28
+17,41 28
+30,40 28
+30,40 28
+43,60 28
+1,61 28
+66.1,31 29
+12,30 29
+1,31 29
+1,31 29
+67.1,73.2 30
+67.25,35 30
+25,35 30
+68.5,29 30
+10,29 30
+5,29 30
+69.5,34 30
+12,21 30
+11,25 30
+10,34 30
+5,34 30
+70.5,25 30
+10,25 30
+5,25 30
+71.5,30 30
+11,21 30
+10,30 30
+5,30 30
+72.5,11 30
+5,11 30
+74.1,43 31
+19,26 31
+28,39 31
+41,42 31
+1,43 31
+1,43 31
+75.1,67 32
+10,15 32
+16,48 32
+29,39 32
+29,39 32
+41,47 32
+41,47 32
+50,66 32
+1,67 32
+78.1,41 33
+79.1,12 34
+80.1,16 35
+81.6,12 36
+14,28 37
+82.2,9 38
+2,22 38
+83.6,16 39
+6,16 39
+85.3,10 40
+3,24 40
+86.6,14 41
+17,27 41
+6,27 41
+87.10,20 42
+3,24 42
+88.3,13 43
+90.2,17 44
+13,16 44
+2,17 44
+2,17 44
+91.2,9 45
+17,33 45
+2,33 45
+92.2,9 46
+18,31 46
+17,40 46
+2,40 46
+93.2,9 47
+17,31 47
+2,31 47
+94.2,9 48
+18,29 48
+17,38 48
+2,38 48
+95.24,30 49
+13,21 49
+13,31 49
+2,31 49
+2,31 50
+96.7,13 51
+2,14 51
+23,46 51
+38,44 51
+27,35 51
+27,45 51
+23,46 51
+23,46 51
+22,55 51
+2,55 51
+97.2,43 52
+20,24 52
+26,39 52
+41,42 52
+2,43 52
+2,43 52
+98.2,62 53
+11,16 53
+18,50 53
+31,41 53
+31,41 53
+43,49 53
+43,49 53
+52,61 53
+2,62 53
+99.2,10 54
+81.30,39 55
+30,39 55
+103.1,34 56
+12,33 56
+1,34 56
+1,34 56
+104.1,85 57
+24,34 57
+24,34 57
+36,44 57
+36,44 57
+46,54 57
+46,54 57
+56,64 57
+56,64 57
+66,74 57
+66,74 57
+76,84 57
+76,84 57
+105.1,42 58
+19,25 58
+27,37 58
+39,41 58
+1,42 58
+1,42 58
+106.1,61 59
+10,15 59
+17,41 59
+30,40 59
+30,40 59
+43,60 59
+1,61 59
+107.1,45 60
+12,26 60
+35,44 60
+35,40 60
+35,44 60
+28,44 60
+28,44 61
+1,45 60
+1,45 60
+110.1,12 62
+9,11 62
+1,12 62
+111.0,1 63
+115.5,15 64
+29,39 64
+19,26 64
+19,39 64
+116.2,30 65
+8,29 65
+2,30 65
+119.1,7 66
+1,21 66
+121.6,12 67
+18,28 68
+14,28 68
+122.16,25 69
+16,25 69
+6,12 69
+6,25 69
+123.3,15 70
+11,14 70
+3,15 70
+124.9,56 71
+21,47 71
+49,52 71
+54,55 71
+9,56 71
+9,56 71
+3,57 71
+3,57 71
+3,57 72
+3,57 71
+121.30,33 73
+30,33 73
+126.0,1 74
+130.1,24 75
+12,18 75
+20,23 75
+1,24 75
+1,24 75
+131.1,12 76
+9,11 76
+1,12 76
+132.1,19 77
+137.1,63 78
+30,40 78
+19,40 78
+19,49 78
+19,49 79
+51,62 78
+1,63 78
+1,63 78
+138.5,16 80
+139.2,35 81
+140.2,38 82
+13,17 82
+19,25 82
+27,37 82
+2,38 82
+2,38 82
+2,38 83
+142.0,1 84
+146.1,7 85
+147.6,12 86
+18,26 87
+14,26 87
+148.11,18 88
+7,18 88
+2,18 88
+147.28,31 89
+28,31 89
+149.8,9 90
+1,9 90
+154.6,12 91
+18,26 92
+14,26 92
+155.2,34 93
+13,20 93
+26,33 93
+22,33 93
+2,34 93
+2,34 93
+154.28,31 94
+28,31 94
+156.1,17 95
+12,16 95
+1,17 95
+1,17 95
+157.0,1 96
+163.1,74 97
+19,27 97
+29,37 97
+39,40 97
+42,73 97
+66,72 97
+66,72 97
+66,72 97
+66,72 97
+66,72 97
+66,72 97
+1,74 97
+1,74 98
+164.1,37 99
+20,24 99
+26,36 99
+1,37 99
+1,37 99
+165.5,15 100
+166.8,47 101
+20,40 101
+42,46 101
+8,47 101
+8,47 101
+2,48 101
+2,48 101
+2,48 102
+2,48 101
+168.1,10 103
+169.8,29 104
+14,17 104
+23,27 104
+8,29 104
+8,29 104
+8,29 104
+8,36 104
+8,36 105
+170.2,8 106
+171.2,15 107
+173.9,17 108
+174.11,18 109
+9,19 109
+175.7,16 110
+20,30 110
+34,44 110
+176.4,10 111
+177.4,12 112
+182.6,15 113
+6,15 114
+183.3,11 115
+185.6,15 116
+187.3,47 117
+35,46 117
+9,46 117
+9,46 118
+3,47 117
+189.2,15 119
+190.7,11 120
+191.6,10 121
+6,17 121
+21,28 121
+32,39 121
+192.3,52 122
+40,51 122
+9,51 122
+9,51 123
+3,52 122
+194.2,26 124
+20,25 124
+20,21 124
+20,25 124
+2,26 124
+2,26 124
+195.6,17 125
+196.3,55 126
+43,54 126
+9,54 126
+9,54 127
+3,55 126
+198.15,22 128
+2,22 128
+199.20,28 129
+20,32 129
+15,33 129
+2,33 129
+200.15,23 130
+15,26 130
+6,26 130
+201.3,59 131
+47,58 131
+9,58 131
+9,58 132
+3,59 131
+203.6,30 133
+17,25 133
+17,28 133
+10,14 133
+10,29 133
+6,30 133
+6,30 133
+6,47 133
+6,47 133
+204.3,55 134
+43,54 134
+9,54 134
+9,54 135
+3,55 134
+207.7,8 136
+7,8 136
+7,8 136
+7,8 136
+7,8 137
+210.3,11 138
+213.3,11 139
+3,11 136
+216.3,11 140
+3,11 136
+219.3,11 141
+3,11 136
+222.3,50 142
+38,49 142
+9,49 142
+9,49 143
+3,50 142
+3,50 136
+3,50 144
+225.3,11 145
+3,11 146
+228.3,11 147
+230.3,34 148
+23,27 148
+29,30 148
+32,33 148
+3,34 148
+3,34 148
+3,34 149
+231.3,11 150
+233.3,34 151
+23,27 151
+29,30 151
+32,33 151
+3,34 151
+3,34 151
+3,34 152
+234.3,11 153
+236.3,34 154
+23,27 154
+29,30 154
+32,33 154
+3,34 154
+3,34 154
+3,34 155
+237.3,11 156
+239.10,32 157
+18,22 157
+24,25 157
+27,31 157
+10,32 157
+10,32 157
+2,45 157
+240.6,14 158
+25,37 158
+18,37 158
+241.3,62 159
+50,61 159
+9,61 159
+9,61 160
+3,62 159
+242.32,39 161
+25,31 161
+20,24 161
+20,40 161
+2,40 161
+2,40 162
+243.31,43 163
+45,54 163
+31,54 163
+19,29 163
+15,55 163
+19,29 163
+19,29 163
+31,43 163
+45,54 163
+31,54 163
+31,54 164
+31,54 164
+245.1,12 165
+1,4 165
+1,12 165
+246.8,11 166
+1,11 166
+251.1,7 167
+252.6,12 168
+14,19 169
+253.2,9 170
+254.15,18 171
+11,19 171
+7,19 171
+2,19 171
+252.21,24 172
+21,24 172
+256.8,9 173
+1,9 173
+268.1,14 174
+269.5,13 175
+5,13 175
+271.9,12 176
+2,12 176
+272.16,22 177
+1,31 177
+273.1,9 178
+274.1,9 179
+275.8,18 180
+276.2,26 181
+19,24 181
+19,24 181
+17,25 181
+2,26 181
+2,26 181
+277.2,26 182
+19,24 182
+19,24 182
+17,25 182
+2,26 182
+2,26 182
+278.6,14 183
+18,26 183
+279.10,13 184
+3,13 184
+280.7,12 185
+7,12 185
+2,13 185
+22,31 185
+21,37 185
+2,37 185
+2,37 185
+282.8,12 186
+1,12 186
+287.5,13 187
+17,25 187
+288.9,16 188
+2,16 188
+289.5,13 189
+17,25 189
+290.9,15 190
+9,21 190
+2,21 190
+291.5,13 191
+17,25 191
+292.9,15 192
+9,21 192
+2,21 192
+293.8,10 193
+1,10 193
+14
+aSys->Dir 1:26.1,39.2 64
+11
+0:name:28.2,6 s
+4:uid:29.2,5 s
+8:gid:30.2,5 s
+12:muid:31.2,6 s
+16:qid:32.2,5 @1
+
+32:mode:33.2,6 i
+36:atime:34.2,7 i
+40:mtime:35.2,7 i
+48:length:36.2,8 B
+56:dtype:37.2,7 i
+60:dev:38.2,5 i
+aSys->Qid 11.1,16.2 16
+3
+0:path:13.2,6 B
+8:vers:14.2,6 i
+12:qtype:15.2,7 i
+aDraw->Chans 2:70.1,82.2 4
+1
+0:desc:72.2,6 i
+aDraw->Context 274.1,279.2 12
+3
+0:display:276.2,9 R@4
+
+4:screen:277.2,8 R@8
+
+8:wm:278.2,4 Ct8.2
+0:t0:15,21 s
+4:t1:15,21 Ct8.2
+0:t0:32,38 s
+4:t1:32,38 R@9
+
+
+
+aDraw->Display 201.1,230.2 20
+5
+0:image:203.2,7 R@5
+
+4:white:204.2,7 R@5
+
+8:black:205.2,7 R@5
+
+12:opaque:206.2,8 R@5
+
+16:transparent:207.2,13 R@5
+
+aDraw->Image 142.1,198.2 56
+8
+0:r:146.2,3 @6
+
+16:clipr:147.2,7 @6
+
+32:depth:148.2,7 i
+36:chans:149.2,7 @2
+
+40:repl:150.2,6 i
+44:display:151.2,9 R@4
+
+48:screen:152.2,8 R@8
+
+52:iname:153.2,7 s
+aDraw->Rect 116.1,139.2 16
+2
+0:min:118.2,5 @7
+
+8:max:119.2,5 @7
+
+aDraw->Point 99.1,113.2 8
+2
+0:x:101.2,3 i
+4:y:102.2,3 i
+aDraw->Screen 249.1,263.2 16
+4
+0:id:251.2,4 i
+4:image:252.2,7 R@5
+
+8:fill:253.2,6 R@5
+
+12:display:254.2,9 R@4
+
+aDraw->Wmcontext 282.1,291.2 28
+7
+0:kbd:284.2,5 Ci
+4:ptr:285.2,5 CR@10
+
+8:ctl:286.2,5 Cs
+12:wctl:287.2,6 Cs
+16:images:288.2,8 CR@5
+
+20:connfd:289.2,8 R@11
+
+24:ctxt:290.2,6 R@3
+
+aDraw->Pointer 266.1,271.2 16
+3
+0:buttons:268.2,9 i
+4:xy:269.2,4 @7
+
+12:msec:270.2,6 i
+aSys->FD 1:45.1,48.2 4
+1
+0:fd:47.2,4 i
+aImage 0:19.0,24.1 16
+4
+0:start:20.1,6 i
+4:offset:21.1,7 i
+8:length:22.1,7 i
+12:data:23.1,5 Ab
+aBufio->Iobuf 3:16.1,50.2 48
+9
+0:fd:41.2,4 R@11
+
+4:buffer:42.2,8 Ab
+8:index:43.2,7 i
+12:size:44.2,6 i
+16:dirty:45.2,7 i
+24:bufpos:46.2,8 B
+32:filpos:47.2,8 B
+40:lastop:48.2,8 i
+44:mode:49.2,6 i
+10
+0:init
+1
+36:argv:0:29.30,34 Ls
+13
+40:img:48.1,4 R@12
+
+44:data:78.1,5 Ab
+48:reply:58.1,6 Ab
+52:step:80.1,5 i
+56:i:81.6,7 i
+60:seqnum:79.1,7 i
+64:cksum:49.1,6 i
+68:dlstart:67.1,8 Ab
+72:err:52.1,4 s
+76:rmfirm:59.1,7 Ab
+80:ulfirm:104.1,7 Ab
+84:file:46.1,5 s
+88:portnum:45.1,8 i
+n247:chkreply
+3
+32:got:113.9,12 Ab
+36:expect:14,20 Ab
+40:err:38,41 s
+1
+48:i:121.6,7 i
+n279:error
+1
+32:msg:128.6,9 s
+0
+n288:killgrp
+1
+32:pid:135.8,11 i
+2
+36:pctl:137.1,5 R@11
+
+40:poison:139.2,8 Ab
+n306:sum
+1
+32:data:144.4,8 Ab
+2
+36:i:147.6,7 i
+40:t:146.1,2 i
+i317:hexdump
+1
+32:data:152.8,12 Ab
+1
+36:i:154.6,7 i
+n333:getimage
+1
+32:path:161.9,13 s
+12
+36:data:194.2,6 Ab
+40:img:163.1,4 R@12
+
+44:lnum:168.1,5 i
+48:s:169.9,10 s
+52:slen:171.2,6 i
+56:alen:206.2,6 i
+60:addr:239.2,6 i
+64:ch:174.3,5 i
+68:count:198.2,7 i
+72:iob:164.1,4 R@13
+
+92:cksum:199.2,7 i
+64:t:190.2,3 i
+R@12
+524:wordval
+3
+32:src:249.8,11 Ab
+36:s:29,30 i
+40:l:32,33 i
+2
+44:i:252.6,7 i
+48:r:251.1,2 i
+i536:hex2bytes
+1
+32:s:266.10,11 s
+6
+36:six:273.1,4 i
+40:slen:268.1,5 i
+44:d1:276.2,4 i
+48:d2:277.2,4 i
+52:data:272.1,5 Ab
+56:dix:274.1,4 i
+Ab571:hexdigit
+1
+32:h:285.9,10 i
+0
+i4
+136:bufio:13.0,5 mBufio
+3:1.0,57.1 0
+
+176:me:0:15.0,2 i
+184:rcx:14.0,3 mRcxSend
+4:1.0,4.1 0
+
+208:sys:0:12.0,3 mSys
+1:4.0,160.1 0
+
diff --git a/appl/demo/lego/legolink.b b/appl/demo/lego/legolink.b
new file mode 100644
index 00000000..ea29efd6
--- /dev/null
+++ b/appl/demo/lego/legolink.b
@@ -0,0 +1,601 @@
+implement LegoLink;
+
+include "sys.m";
+include "draw.m";
+include "timers.m";
+include "rcxsend.m";
+
+LegoLink : module {
+ init : fn (ctxt : ref Draw->Context, argv : list of string);
+};
+
+POLLDONT : con 0;
+POLLNOW : con 16r02;
+POLLDO : con 16r04;
+
+sys : Sys;
+timers : Timers;
+Timer : import timers;
+datain : chan of array of byte;
+errormsg : string;
+
+error(msg: string)
+{
+ sys->fprint(sys->fildes(2), "%s\n", msg);
+ raise "fail:error";
+}
+
+init(nil : ref Draw->Context, argv : list of string)
+{
+ sys = load Sys Sys->PATH;
+ sys->pctl(Sys->NEWPGRP, nil);
+
+ argv = tl argv;
+ if (len argv != 1)
+ error("usage: legolink portnum");
+
+ timers = load Timers "timers.dis";
+ if (timers == nil)
+ error(sys->sprint("cannot load timers module: %r"));
+
+ portnum := int hd argv;
+ (rdfd, wrfd, err) := serialport(portnum);
+ if (err != nil)
+ error(err);
+
+ # set up our mount file
+ if (sys->bind("#s", "/net", Sys->MBEFORE) == -1)
+ error(sys->sprint("failed to bind srv device: %r"));
+
+ f2c := sys->file2chan("/net", "legolink");
+ if (f2c == nil)
+ error(sys->sprint("cannot create legolink channel: %r"));
+
+ datain = chan of array of byte;
+ send := chan of array of byte;
+ recv := chan of array of byte;
+ timers->init(50);
+ spawn reader(rdfd, datain);
+ consume();
+ spawn protocol(wrfd, send, recv);
+ spawn srvlink(f2c, send, recv);
+}
+
+srvlink(f2c : ref Sys->FileIO, send, recv : chan of array of byte)
+{
+ me := sys->pctl(0, nil);
+ rdfid := -1;
+ wrfid := -1;
+ buffer := array [256] of byte;
+ bix := 0;
+
+ rdblk := chan of (int, int, int, Sys->Rread);
+ readreq := rdblk;
+ wrblk := chan of (int, array of byte, int, Sys->Rwrite);
+ writereq := f2c.write;
+ wrreply : Sys->Rwrite;
+ sendblk := chan of array of byte;
+ sendchan := sendblk;
+ senddata : array of byte;
+
+ for (;;) alt {
+ data := <- recv =>
+ # got some data from brick, nil for error
+ if (data == nil) {
+ # some sort of error
+ if (wrreply != nil) {
+ wrreply <- = (0, errormsg);
+ }
+ killgrp(me);
+ }
+ if (bix + len data > len buffer) {
+ newb := array [bix + len data + 256] of byte;
+ newb[0:] = buffer;
+ buffer = newb;
+ }
+ buffer[bix:] = data;
+ bix += len data;
+ readreq = f2c.read;
+
+ (offset, count, fid, rc) := <- readreq =>
+ if (rdfid == -1)
+ rdfid = fid;
+ if (fid != rdfid) {
+ if (rc != nil)
+ rc <- = (nil, "file in use");
+ continue;
+ }
+ if (rc == nil) {
+ rdfid = -1;
+ continue;
+ }
+ if (errormsg != nil) {
+ rc <- = (nil, errormsg);
+ killgrp(me);
+ }
+ # reply with what we've got
+ if (count > bix)
+ count = bix;
+ rdata := array [count] of byte;
+ rdata[0:] = buffer[0:count];
+ buffer[0:] = buffer[count:bix];
+ bix -= count;
+ if (bix == 0)
+ readreq = rdblk;
+ alt {
+ rc <- = (rdata, nil)=>
+ ;
+ * =>
+ ;
+ }
+
+ (offset, data, fid, wc) := <- writereq =>
+ if (wrfid == -1)
+ wrfid = fid;
+ if (fid != wrfid) {
+ if (wc != nil)
+ wc <- = (0, "file in use");
+ continue;
+ }
+ if (wc == nil) {
+ wrfid = -1;
+ continue;
+ }
+ if (errormsg != nil) {
+ wc <- = (0, errormsg);
+ killgrp(me);
+ }
+ senddata = data;
+ sendchan = send;
+ wrreply = wc;
+ writereq = wrblk;
+
+ sendchan <- = senddata =>
+ alt {
+ wrreply <- = (len senddata, nil) =>
+ ;
+ * =>
+ ;
+ }
+ wrreply = nil;
+ sendchan = sendblk;
+ writereq = f2c.write;
+ }
+}
+
+killgrp(pid : int)
+{
+ pctl := sys->open("/prog/" + string pid + "/ctl", Sys->OWRITE);
+ if (pctl != nil) {
+ poison := array of byte "killgrp";
+ sys->write(pctl, poison, len poison);
+ }
+ exit;
+}
+
+serialport(port : int) : (ref Sys->FD, ref Sys->FD, string)
+{
+ serport := "/dev/eia" + string port;
+ serctl := serport + "ctl";
+
+ rfd := sys->open(serport, Sys->OREAD);
+ if (rfd == nil)
+ return (nil, nil, sys->sprint("cannot read %s: %r", serport));
+ wfd := sys->open(serport, Sys->OWRITE);
+ if (wfd == nil)
+ return (nil, nil, sys->sprint("cannot write %s: %r", serport));
+ ctlfd := sys->open(serctl, Sys->OWRITE);
+ if (ctlfd == nil)
+ return (nil, nil, sys->sprint("cannot open %s: %r", serctl));
+
+ config := array [] of {
+ "b2400",
+ "l8",
+ "po",
+ "m0",
+ "s1",
+ "d1",
+ "r1",
+ };
+
+ for (i := 0; i < len config; i++) {
+ cmd := array of byte config[i];
+ if (sys->write(ctlfd, cmd, len cmd) <= 0)
+ return (nil, nil, sys->sprint("serial config (%s): %r", config[i]));
+ }
+ return (rfd, wfd, nil);
+}
+
+# reader and nbread as in rcxsend.b
+reader(fd : ref Sys->FD, out : chan of array of byte)
+{
+ # with buf size of 1 there is no need
+ # for overrun code in nbread()
+
+ buf := array [1] of byte;
+ for (;;) {
+ n := sys->read(fd, buf, len buf);
+ if (n <= 0)
+ break;
+ data := array [n] of byte;
+ data[0:] = buf[0:n];
+ out <- = data;
+ }
+ out <- = nil;
+}
+
+overrun : array of byte;
+
+nbread(ms, n : int) : array of byte
+{
+ ret := array[n] of byte;
+ tot := 0;
+ if (overrun != nil) {
+ if (n < len overrun) {
+ ret[0:] = overrun[0:n];
+ overrun = overrun[n:];
+ return ret;
+ }
+ ret[0:] = overrun;
+ tot += len overrun;
+ overrun = nil;
+ }
+ tmr := timers->new(ms, 0);
+loop:
+ while (tot < n) {
+ tmr.reset();
+ alt {
+ data := <- datain =>
+ if (data == nil)
+ break loop;
+ dlen := len data;
+ if (dlen > n - tot) {
+ dlen = n - tot;
+ overrun = data[dlen:];
+ }
+ ret[tot:] = data[0:dlen];
+ tot += dlen;
+ <- tmr.tick =>
+ # reply timeout;
+ break loop;
+ }
+ }
+ tmr.destroy();
+ if (tot == 0)
+ return nil;
+ return ret[0:tot];
+}
+
+consume()
+{
+ while (nbread(300, 1024) != nil)
+ ;
+}
+
+# fd: connection to remote client
+# send: from local to remote
+# recv: from remote to local
+protocol(fd : ref Sys->FD, send, recv : chan of array of byte)
+{
+ seqnum := 0;
+ towerdown := timers->new(1500, 0);
+ starttower := 1;
+ tmr := timers->new(250, 0);
+
+ for (;;) {
+ data : array of byte = nil;
+ # get data to send
+ alt {
+ data = <- send =>
+ ;
+ <- tmr.tick =>
+ data = nil;
+ <- towerdown.tick =>
+ starttower = 1;
+ continue;
+ }
+
+ poll := POLLNOW;
+ while (poll == POLLNOW) {
+ reply : array of byte;
+ (reply, poll, errormsg) = datasend(fd, seqnum++, data, starttower);
+ starttower = 0;
+ towerdown.reset();
+ if (errormsg != nil) {
+sys->print("protocol: send error: %s\n", errormsg);
+ tmr.destroy();
+ recv <- = nil;
+ return;
+ }
+ if (reply != nil) {
+ recv <- = reply;
+ }
+ if (poll == POLLNOW) {
+ # quick check to see if we have any more data
+ alt {
+ data = <- send =>
+ ;
+ * =>
+ data = nil;
+ }
+ }
+ }
+ if (poll == POLLDO)
+ tmr.reset();
+ else
+ tmr.cancel();
+ }
+}
+
+TX_HDR : con 3;
+DL_HDR : con 5; # 16r45 seqLSB seqMSB lenLSB lenMSB
+DL_CKSM : con 1;
+LN_HDR : con 1;
+LN_JUNK : con 2;
+LN_LEN : con 2;
+LN_RXLEN : con 2;
+LN_POLLMASK : con 16r06;
+LN_COMPMASK : con 16r08;
+
+
+# send a message (may be empty)
+# wait for the reply
+# returns (data, poll request, error)
+
+datasend(wrfd : ref Sys->FD, seqnum : int, data : array of byte, startup : int) : (array of byte, int, string)
+{
+if (startup) {
+ dummy := array [] of { byte 255, byte 0, byte 255, byte 0};
+ sys->write(wrfd, dummy, len dummy);
+ nbread(100, 100);
+}
+ seqnum = seqnum & 1;
+ docomp := 0;
+ if (data != nil) {
+ comp := rlencode(data);
+ if (len comp < len data) {
+ docomp = 1;
+ data = comp;
+ }
+ }
+
+ # construct the link-level data packet
+ # DL_HDR LN_HDR data cksum
+ # last byte of data is stored in cksum byte
+ llen := LN_HDR + len data;
+ blklen := LN_LEN + llen - 1; # llen includes cksum
+ ldata := array [DL_HDR + blklen + 1] of byte;
+
+ # DL_HDR
+ if (seqnum == 0)
+ ldata[0] = byte 16r45;
+ else
+ ldata[0] = byte 16r4d;
+ ldata[1] = byte 0; # blk number LSB
+ ldata[2] = byte 0; # blk number MSB
+ ldata[3] = byte (blklen & 16rff); # blk length LSB
+ ldata[4] = byte ((blklen >> 8) & 16rff); # blk length MSB
+
+ # LN_LEN
+ ldata[5] = byte (llen & 16rff);
+ ldata[6] = byte ((llen>>8) & 16rff);
+ # LN_HDR
+ lhval := byte 0;
+ if (seqnum == 1)
+ lhval |= byte 16r01;
+ if (docomp)
+ lhval |= byte 16r08;
+
+ ldata[7] = lhval;
+
+ # data (+cksum)
+ ldata[8:] = data;
+
+ # construct the rcx data packet
+ # TX_HDR (dn ~dn) cksum ~cksum
+ rcxlen := TX_HDR + 2*(len ldata + 1);
+ rcxdata := array [rcxlen] of byte;
+
+ rcxdata[0] = byte 16r55;
+ rcxdata[1] = byte 16rff;
+ rcxdata[2] = byte 16r00;
+ rcix := TX_HDR;
+ cksum := 0;
+ for (i := 0; i < len ldata; i++) {
+ b := ldata[i];
+ rcxdata[rcix++] = b;
+ rcxdata[rcix++] = ~b;
+ cksum += int b;
+ }
+ rcxdata[rcix++] = byte (cksum & 16rff);
+ rcxdata[rcix++] = byte (~cksum & 16rff);
+
+ # send it
+ err : string;
+ reply : array of byte;
+ for (try := 0; try < 8; try++) {
+ if (err != nil)
+ sys->print("Try %d (lasterr %s)\n", try, err);
+ err = "";
+ step := 8;
+ for (i = 0; err == nil && i < rcxlen; i += step) {
+ if (i + step > rcxlen)
+ step = rcxlen -i;
+ if (sys->write(wrfd, rcxdata[i:i+step], step) != step) {
+ return (nil, 0, "hangup");
+ }
+
+ # get the echo
+ reply = nbread(300, step);
+ if (reply == nil || len reply != step)
+ # short echo
+ err = "tower not responding";
+
+ # check the echo
+ for (ei := 0; err == nil && ei < step; ei++) {
+ if (reply[ei] != rcxdata[i+ei])
+ # echo mis-match
+ err = "serial comms error";
+ }
+ }
+ if (err != nil) {
+ consume();
+ continue;
+ }
+
+ # wait for a reply
+ replen := TX_HDR + LN_JUNK + 2*LN_RXLEN;
+ reply = nbread(300, replen);
+ if (reply == nil || len reply != replen) {
+ err = "brick not responding";
+ consume();
+ continue;
+ }
+ if (reply[0] != byte 16r55 || reply[1] != byte 16rff || reply[2] != byte 0
+ || reply[5] != ~reply[6] || reply[7] != ~reply[8]) {
+ err = "bad reply from brick";
+ consume();
+ continue;
+ }
+ # reply[3] and reply [4] are junk, ~junk
+ # put on front of msg by rcx rom
+ replen = int reply[5] + ((int reply[7]) << 8) + 1;
+ cksum = int reply[3] + int reply[5] + int reply[7];
+ reply = nbread(200, replen * 2);
+ if (reply == nil || len reply != replen * 2) {
+ err = "short reply from brick";
+ consume();
+ continue;
+ }
+ cksum += int reply[0];
+ for (i = 1; i < replen; i++) {
+ reply[i] = reply[2*i];
+ cksum += int reply[i];
+ }
+ cksum -= int reply[replen-1];
+ if (reply[replen-1] != byte (cksum & 16rff)) {
+ err = "bad checksum from brick";
+ consume();
+ continue;
+ }
+ if ((reply[0] & byte 1) != byte (seqnum & 1)) {
+ # seqnum error
+ # we have read everything, don't bother with consume()
+ err = "bad seqnum from brick";
+ continue;
+ }
+
+ # TADA! we have a valid message
+ mdata : array of byte;
+ lnhdr := int reply[0];
+ poll := lnhdr & LN_POLLMASK;
+ if (replen > 2) {
+ # more than just hdr and cksum
+ if (lnhdr & LN_COMPMASK) {
+ mdata = rldecode(reply[1:replen-1]);
+ if (mdata == nil) {
+ err = "bad brick msg compression";
+ continue;
+ }
+ } else {
+ mdata = array [replen - 2] of byte;
+ mdata[0:] = reply[1:replen-1];
+ }
+ }
+ return (mdata, poll, nil);
+ }
+ return (nil, 0, err);
+}
+
+
+rlencode(data : array of byte) : array of byte
+{
+ srcix := 0;
+ outix := 0;
+ out := array [64] of byte;
+ val := 0;
+ nextval := -1;
+ n0 := 0;
+
+ while (srcix < len data || nextval != -1) {
+ if (nextval != -1) {
+ val = nextval;
+ nextval = -1;
+ } else {
+ val = int data[srcix];
+ if (val == 16r88)
+ nextval = 0;
+ if (val == 0) {
+ n0++;
+ srcix++;
+ if (srcix < len data && n0 < 16rff + 2)
+ continue;
+ }
+ case n0 {
+ 0 =>
+ srcix++;
+ 1 =>
+ val = 0;
+ nextval = -1;
+ n0 = 0;
+ 2 =>
+ val = 0;
+ nextval = 0;
+ n0 = 0;
+ * =>
+ val = 16r88;
+ nextval = (n0-2);
+ n0 = 0;
+ }
+ }
+ if (outix >= len out) {
+ newout := array [2 * len out] of byte;
+ newout[0:] = out;
+ out = newout;
+ }
+ out[outix++] = byte val;
+ }
+ return out[0:outix];
+}
+
+rldecode(data : array of byte) : array of byte
+{
+ srcix := 0;
+ outix := 0;
+ out := array [64] of byte;
+
+ n0 := 0;
+ val := 0;
+ while (srcix < len data || n0 > 0) {
+ if (n0 > 0)
+ n0--;
+ else {
+ val = int data[srcix++];
+ if (val == 16r88) {
+ if (srcix >= len data)
+ # bad encoding
+ return nil;
+ n0 = int data[srcix++];
+ if (n0 > 0) {
+ n0 += 2;
+ val = 0;
+ continue;
+ }
+ }
+ }
+ if (outix >= len out) {
+ newout := array [2 * len out] of byte;
+ newout[0:] = out;
+ out = newout;
+ }
+ out[outix++] = byte val;
+ }
+ return out[0:outix];
+}
+
+hexdump(data : array of byte)
+{
+ for (i := 0; i < len data; i++)
+ sys->print("%.2x ", int data[i]);
+ sys->print("\n");
+}
diff --git a/appl/demo/lego/legolink.dis b/appl/demo/lego/legolink.dis
new file mode 100644
index 00000000..77f5573f
--- /dev/null
+++ b/appl/demo/lego/legolink.dis
Binary files differ
diff --git a/appl/demo/lego/legolink.sbl b/appl/demo/lego/legolink.sbl
new file mode 100644
index 00000000..11de96e7
--- /dev/null
+++ b/appl/demo/lego/legolink.sbl
@@ -0,0 +1,1298 @@
+limbo .sbl 2.1
+LegoLink
+5
+legolink.b
+sys.m
+draw.m
+timers.m
+rcxsend.m
+949
+24.13,27 0
+25,26 0
+13,27 0
+13,27 0
+1,41 0
+1,41 0
+1,41 1
+29,35 0
+37,40 0
+1,41 0
+1,41 0
+25.1,19 2
+30.1,25 3
+31.1,29 4
+11,23 4
+25,28 4
+1,29 4
+1,29 4
+33.1,15 5
+34.5,13 6
+5,18 6
+35.2,34 7
+8,33 7
+2,34 7
+37.1,34 8
+38.5,18 9
+39.8,52 10
+20,51 10
+8,52 10
+8,52 10
+2,53 10
+2,53 10
+2,53 11
+2,53 10
+41.16,23 12
+1,23 12
+1,23 13
+42.22,41 14
+33,40 14
+22,41 14
+22,41 14
+43.5,15 15
+44.2,12 16
+8,11 16
+2,12 16
+47.5,42 17
+15,19 17
+21,27 17
+29,41 17
+5,42 17
+5,42 17
+5,48 17
+48.8,52 18
+20,51 18
+8,52 18
+8,52 18
+2,53 18
+2,53 18
+2,53 19
+2,53 18
+50.1,42 20
+23,29 20
+31,41 20
+1,42 20
+1,42 20
+51.5,15 21
+52.8,57 22
+20,56 22
+8,57 22
+8,57 22
+2,58 22
+2,58 22
+2,58 23
+2,58 22
+54.1,31 24
+55.1,30 25
+56.1,30 26
+57.1,17 27
+14,16 27
+1,17 27
+58.1,27 28
+14,18 28
+20,26 28
+1,27 28
+59.1,10 29
+1,10 29
+60.1,33 30
+16,20 30
+22,26 30
+28,32 30
+1,33 30
+61.1,31 31
+15,18 31
+20,24 31
+26,30 31
+1,31 31
+62.0,1 32
+66.1,24 33
+17,18 33
+20,23 33
+1,24 33
+1,24 33
+67.1,12 34
+68.1,12 35
+69.1,30 36
+70.1,9 37
+72.1,45 38
+73.1,17 39
+74.1,56 40
+75.1,22 41
+77.1,33 42
+78.1,20 43
+82.12,16 44
+12,16 44
+100.32,39 44
+32,39 44
+132.31,39 44
+31,39 44
+153.1,9 44
+1,9 44
+81.10,16 44
+10,16 44
+10,16 44
+10,16 44
+84.6,17 45
+86.7,21 46
+87.18,19 47
+21,29 47
+4,30 47
+4,30 48
+89.3,14 49
+11,13 49
+3,14 49
+91.23,33 50
+12,20 50
+6,20 50
+6,33 50
+92.24,32 51
+18,32 51
+18,38 51
+3,47 51
+93.3,20 52
+94.3,16 53
+3,16 54
+96.2,21 55
+97.9,17 56
+2,17 56
+98.2,20 57
+2,20 58
+2,20 44
+100.29,39 44
+29,39 59
+101.6,17 60
+102.3,14 61
+103.6,18 62
+104.7,16 63
+105.13,16 64
+18,31 64
+4,32 64
+4,32 65
+4,32 66
+4,32 67
+4,32 68
+4,32 69
+106.3,11 70
+108.6,15 71
+109.3,13 72
+3,13 73
+3,13 74
+3,13 75
+110.3,11 76
+112.6,21 77
+113.12,15 78
+17,25 78
+3,26 78
+3,26 79
+3,26 80
+114.3,14 81
+11,13 81
+3,14 81
+117.6,17 82
+118.3,14 83
+119.2,32 84
+120.14,20 85
+14,29 85
+2,29 85
+2,29 86
+121.15,21 87
+15,32 87
+2,32 87
+2,32 88
+122.2,14 89
+123.6,14 90
+124.3,18 91
+126.2,4 92
+11,16 92
+18,21 92
+2,4 92
+125.2,8 92
+2,8 92
+2,8 92
+2,8 92
+2,8 93
+2,8 94
+2,8 92
+2,8 92
+2,8 95
+2,8 96
+2,8 97
+2,8 44
+132.28,39 44
+28,39 98
+28,39 99
+133.6,17 100
+134.3,14 101
+135.6,18 102
+136.7,16 103
+137.13,14 104
+16,29 104
+4,30 104
+4,30 105
+4,30 106
+4,30 107
+4,30 108
+4,30 109
+138.3,11 110
+140.6,15 111
+141.3,13 112
+3,13 113
+3,13 114
+3,13 115
+3,13 116
+142.3,11 117
+144.6,21 118
+145.12,13 119
+15,23 119
+3,24 119
+3,24 120
+146.3,14 121
+11,13 121
+3,14 121
+148.2,17 122
+149.2,17 123
+150.2,14 124
+151.2,18 125
+2,18 126
+2,18 127
+2,18 128
+2,18 129
+2,18 44
+155.2,9 130
+16,28 130
+30,33 130
+2,9 130
+154.2,8 130
+2,8 130
+2,8 130
+2,8 130
+2,8 131
+2,8 130
+2,8 130
+160.2,15 132
+161.2,20 133
+162.2,22 134
+2,22 44
+168.1,63 135
+30,40 135
+19,40 135
+19,49 135
+19,49 136
+51,62 135
+1,63 135
+1,63 135
+169.5,16 137
+170.2,35 138
+171.2,38 139
+13,17 139
+19,25 139
+27,37 139
+2,38 139
+2,38 139
+2,38 140
+173.1,5 141
+178.25,36 142
+1,36 142
+1,36 143
+179.1,26 144
+181.1,38 145
+18,25 145
+27,37 145
+1,38 145
+1,38 145
+182.5,15 146
+183.10,13 147
+15,18 147
+20,62 147
+32,52 147
+54,61 147
+20,62 147
+20,62 147
+2,63 147
+184.1,39 148
+18,25 148
+27,38 148
+1,39 148
+1,39 148
+185.5,15 149
+186.10,13 150
+15,18 150
+20,63 150
+32,53 150
+55,62 150
+20,63 150
+20,63 150
+2,64 150
+187.1,40 151
+20,26 151
+28,39 151
+1,40 151
+1,40 151
+188.5,17 152
+189.10,13 153
+15,18 153
+20,61 153
+32,52 153
+54,60 153
+20,61 153
+20,61 153
+2,62 153
+191.1,199.2 154
+192.2,9 154
+2,9 154
+193.2,6 154
+2,6 154
+194.2,6 154
+2,6 154
+195.2,6 154
+2,6 154
+196.2,6 154
+2,6 154
+197.2,6 154
+2,6 154
+198.2,6 154
+2,6 154
+201.6,12 155
+18,28 156
+14,28 156
+202.23,32 157
+2,32 157
+203.6,37 158
+17,22 158
+24,27 158
+29,36 158
+6,37 158
+6,37 158
+6,42 158
+204.11,14 159
+16,19 159
+21,69 159
+33,57 159
+59,68 159
+59,68 159
+21,69 159
+21,69 159
+3,70 159
+3,70 160
+201.30,33 161
+30,33 161
+206.9,12 162
+14,17 162
+19,22 162
+1,23 162
+215.1,25 163
+217.2,34 164
+17,19 164
+21,24 164
+26,33 164
+2,34 164
+2,34 164
+218.6,12 165
+6,12 166
+219.3,8 167
+220.2,27 168
+221.13,16 169
+13,21 169
+2,21 169
+2,21 170
+222.2,15 171
+2,15 172
+2,15 172
+224.1,13 173
+225.0,1 174
+231.1,24 175
+232.1,9 176
+233.5,19 177
+234.10,21 178
+6,21 178
+235.13,20 179
+13,25 179
+3,25 179
+3,25 180
+236.3,24 181
+3,24 181
+237.10,13 182
+3,13 182
+239.2,19 183
+240.9,20 184
+2,20 184
+241.2,15 185
+243.1,26 186
+20,22 186
+24,25 186
+1,26 186
+1,26 186
+245.8,15 187
+246.2,13 188
+2,5 188
+2,13 188
+248.14,20 189
+14,20 189
+258.6,14 189
+6,14 189
+247.2,8 189
+2,8 189
+2,8 189
+2,8 189
+249.8,19 190
+8,19 191
+250.5,10 192
+251.4,20 193
+252.15,22 194
+8,22 194
+253.5,19 195
+254.5,26 196
+15,19 196
+5,26 196
+256.16,20 197
+16,28 197
+4,28 197
+4,28 198
+257.4,15 199
+4,15 200
+4,15 189
+260.4,9 201
+263.1,14 202
+1,4 202
+1,14 202
+264.5,13 203
+265.9,12 204
+2,12 204
+266.8,11 205
+8,18 205
+1,18 205
+271.8,25 206
+15,18 206
+20,24 206
+8,25 206
+8,25 206
+8,32 206
+8,32 207
+8,32 207
+273.0,1 208
+280.1,12 209
+281.1,34 210
+26,30 210
+32,33 210
+1,34 210
+1,34 210
+282.1,16 211
+283.1,27 212
+20,23 212
+25,26 212
+1,27 212
+1,27 212
+286.25,28 213
+289.12,16 214
+12,16 214
+291.5,13 214
+5,13 214
+293.5,19 214
+5,19 214
+288.2,8 214
+2,8 214
+2,8 214
+2,8 214
+2,8 214
+292.3,13 215
+3,13 214
+294.3,17 216
+3,17 217
+295.3,11 218
+298.2,17 219
+299.9,24 220
+301.29,69 221
+38,40 221
+42,50 221
+42,50 221
+52,56 221
+58,68 221
+29,69 221
+29,69 221
+4,9 221
+11,15 221
+17,25 221
+17,25 222
+17,25 223
+302.3,17 224
+303.3,20 225
+3,12 225
+3,20 225
+304.7,22 226
+305.0,50 227
+11,39 227
+41,49 227
+0,50 227
+0,50 227
+306.4,17 228
+4,7 228
+4,17 228
+307.4,17 229
+308.4,10 230
+310.7,19 231
+311.4,19 232
+313.7,22 233
+316.14,18 234
+14,18 234
+315.4,10 234
+4,10 234
+4,10 234
+4,10 234
+4,10 234
+319.6,16 235
+6,16 234
+6,16 236
+6,16 236
+323.6,20 237
+324.3,14 238
+3,6 238
+3,14 238
+3,14 239
+326.3,15 240
+3,6 240
+3,15 240
+3,15 241
+3,15 241
+347.4,11 242
+348.1,59 243
+24,32 243
+24,32 243
+34,40 243
+34,40 243
+42,50 243
+42,50 243
+52,58 243
+52,58 243
+349.1,35 244
+12,16 244
+18,23 244
+25,34 244
+1,35 244
+1,35 244
+350.1,17 245
+8,11 245
+13,16 245
+1,17 245
+1,17 245
+1,17 246
+1,17 247
+352.1,20 248
+353.1,12 249
+354.5,16 250
+355.2,24 251
+19,23 251
+2,24 251
+2,24 251
+356.17,25 252
+6,14 252
+6,25 252
+357.3,13 253
+358.3,14 254
+3,14 255
+365.18,26 256
+1,26 256
+366.11,24 257
+1,28 257
+367.17,36 258
+1,45 258
+370.5,16 259
+371.2,10 260
+2,23 260
+2,23 261
+373.2,10 262
+2,23 262
+374.1,9 263
+1,18 263
+375.1,9 264
+1,18 264
+376.1,9 265
+17,33 265
+1,33 265
+377.1,9 266
+18,31 266
+17,40 266
+1,40 266
+380.1,9 267
+17,31 267
+1,31 267
+381.1,9 268
+18,27 268
+17,36 268
+1,36 268
+383.1,16 269
+384.5,16 270
+385.2,21 271
+386.5,11 272
+387.2,21 273
+389.1,9 274
+1,17 274
+392.1,17 275
+396.23,32 276
+22,37 276
+20,37 276
+1,37 276
+397.1,34 277
+399.1,11 278
+1,24 278
+400.1,11 279
+1,24 279
+401.1,11 280
+1,24 280
+402.1,15 281
+403.1,11 282
+404.6,12 283
+18,27 284
+14,27 284
+405.7,15 285
+2,15 285
+406.10,16 286
+10,16 286
+2,17 286
+2,21 286
+407.10,16 287
+10,16 287
+2,17 287
+2,22 287
+408.11,16 288
+2,16 288
+404.29,32 289
+29,32 289
+410.9,15 290
+9,15 290
+1,16 290
+24,39 290
+1,39 290
+411.9,15 291
+9,15 291
+1,16 291
+25,31 291
+24,40 291
+1,40 291
+416.6,14 292
+16,23 293
+417.6,16 294
+418.3,48 295
+14,37 295
+39,42 295
+44,47 295
+3,48 295
+3,48 295
+419.2,10 296
+420.2,11 297
+421.7,12 298
+14,24 299
+28,38 299
+422.7,15 300
+7,24 300
+423.4,20 301
+424.7,48 302
+18,22 302
+34,40 302
+24,31 302
+24,41 302
+43,47 302
+7,48 302
+7,48 302
+7,56 302
+425.12,15 303
+17,18 303
+20,28 303
+4,29 303
+429.3,28 304
+18,21 304
+23,27 304
+3,28 304
+3,28 304
+430.7,19 305
+23,32 305
+23,40 305
+432.4,32 306
+435.8,15 307
+17,27 308
+31,40 308
+436.29,33 309
+21,34 309
+21,34 309
+8,17 309
+8,34 309
+438.5,31 310
+435.42,46 311
+42,46 311
+421.40,49 312
+40,49 312
+441.6,16 313
+442.3,12 314
+3,12 314
+3,12 315
+443.3,11 316
+447.2,41 317
+448.2,29 318
+17,20 318
+22,28 318
+2,29 318
+2,29 318
+449.6,18 319
+22,31 319
+22,41 319
+450.3,31 320
+451.3,12 321
+3,12 321
+3,12 322
+452.3,11 323
+454.6,14 324
+6,28 324
+32,40 324
+32,54 324
+58,66 324
+58,76 324
+455.18,26 324
+17,26 324
+5,13 324
+5,26 324
+43,51 324
+42,51 324
+30,38 324
+30,51 324
+456.3,31 325
+457.3,12 326
+3,12 326
+3,12 327
+458.3,11 328
+462.15,23 329
+11,23 329
+32,40 329
+27,41 329
+26,47 329
+11,47 329
+2,51 329
+463.14,22 330
+10,22 330
+29,37 330
+25,37 330
+10,37 330
+44,52 330
+40,52 330
+2,52 330
+464.2,33 331
+17,20 331
+22,32 331
+2,33 331
+2,33 331
+465.6,18 332
+35,45 332
+22,31 332
+22,45 332
+466.3,33 333
+467.3,12 334
+3,12 334
+3,12 335
+468.3,11 336
+470.15,23 337
+11,23 337
+2,23 337
+471.7,12 338
+14,24 339
+472.3,11 340
+20,23 340
+14,24 340
+3,24 340
+473.16,24 341
+12,24 341
+3,24 341
+471.26,29 342
+26,29 342
+475.21,29 343
+15,30 343
+11,30 343
+2,30 343
+476.30,45 344
+25,45 344
+12,20 344
+6,21 344
+6,45 344
+477.3,34 345
+478.3,12 346
+3,12 346
+3,12 347
+479.3,11 348
+481.34,46 349
+29,46 349
+7,15 349
+6,25 349
+6,46 349
+484.3,32 350
+3,32 351
+485.3,11 352
+490.15,23 353
+2,23 353
+491.2,29 354
+492.6,16 355
+494.7,26 356
+7,26 356
+495.4,39 357
+29,37 357
+21,26 357
+21,38 357
+4,39 357
+4,39 357
+496.8,20 358
+497.5,38 359
+5,38 360
+498.5,13 361
+501.19,29 362
+4,38 362
+502.24,32 363
+16,21 363
+16,33 363
+4,33 363
+4,33 364
+505.10,15 365
+17,21 365
+23,26 365
+2,27 365
+416.25,30 366
+25,30 366
+507.9,12 367
+14,15 367
+17,20 367
+1,21 367
+513.1,11 368
+514.1,11 369
+515.1,26 370
+516.1,9 371
+517.1,14 372
+518.1,8 373
+520.16,24 374
+8,24 374
+28,41 374
+521.6,19 375
+522.3,16 376
+523.3,15 377
+3,15 378
+525.13,24 379
+3,24 379
+526.7,19 380
+527.4,15 381
+528.7,15 382
+529.4,8 383
+530.4,11 384
+531.16,24 385
+8,24 385
+28,42 385
+532.5,13 386
+534.8,10 387
+8,10 387
+8,10 387
+536.4,11 388
+4,11 387
+538.4,11 389
+539.4,16 390
+540.4,10 391
+4,10 387
+542.4,11 392
+543.4,15 393
+544.4,10 394
+4,10 387
+546.4,15 395
+547.4,20 396
+548.4,10 397
+4,10 387
+551.15,22 398
+6,22 398
+552.24,31 399
+20,31 399
+3,40 399
+553.3,19 400
+554.3,15 401
+3,15 402
+556.6,13 403
+6,13 403
+2,14 403
+2,25 403
+2,25 403
+558.8,11 404
+8,20 404
+1,20 404
+563.1,11 405
+564.1,11 406
+565.1,26 407
+567.1,8 408
+568.1,9 409
+569.16,24 410
+8,24 410
+28,34 410
+570.6,12 411
+571.3,7 412
+3,7 413
+573.18,25 414
+18,25 414
+13,26 414
+3,26 414
+574.7,19 415
+575.17,25 416
+8,25 416
+577.12,15 417
+5,15 417
+578.18,25 418
+18,25 418
+13,26 418
+4,26 418
+579.8,14 419
+580.5,12 420
+581.5,12 421
+582.5,13 422
+586.15,22 423
+6,22 423
+587.24,31 424
+20,31 424
+3,40 424
+588.3,19 425
+589.3,15 426
+3,15 427
+591.6,13 428
+6,13 428
+2,14 428
+2,25 428
+2,25 428
+593.8,11 429
+8,20 429
+1,20 429
+16
+aSys->Dir 1:26.1,39.2 64
+11
+0:name:28.2,6 s
+4:uid:29.2,5 s
+8:gid:30.2,5 s
+12:muid:31.2,6 s
+16:qid:32.2,5 @1
+
+32:mode:33.2,6 i
+36:atime:34.2,7 i
+40:mtime:35.2,7 i
+48:length:36.2,8 B
+56:dtype:37.2,7 i
+60:dev:38.2,5 i
+aSys->Qid 11.1,16.2 16
+3
+0:path:13.2,6 B
+8:vers:14.2,6 i
+12:qtype:15.2,7 i
+aDraw->Chans 2:70.1,82.2 4
+1
+0:desc:72.2,6 i
+aDraw->Context 274.1,279.2 12
+3
+0:display:276.2,9 R@4
+
+4:screen:277.2,8 R@8
+
+8:wm:278.2,4 Ct8.2
+0:t0:15,21 s
+4:t1:15,21 Ct8.2
+0:t0:32,38 s
+4:t1:32,38 R@9
+
+
+
+aDraw->Display 201.1,230.2 20
+5
+0:image:203.2,7 R@5
+
+4:white:204.2,7 R@5
+
+8:black:205.2,7 R@5
+
+12:opaque:206.2,8 R@5
+
+16:transparent:207.2,13 R@5
+
+aDraw->Image 142.1,198.2 56
+8
+0:r:146.2,3 @6
+
+16:clipr:147.2,7 @6
+
+32:depth:148.2,7 i
+36:chans:149.2,7 @2
+
+40:repl:150.2,6 i
+44:display:151.2,9 R@4
+
+48:screen:152.2,8 R@8
+
+52:iname:153.2,7 s
+aDraw->Rect 116.1,139.2 16
+2
+0:min:118.2,5 @7
+
+8:max:119.2,5 @7
+
+aDraw->Point 99.1,113.2 8
+2
+0:x:101.2,3 i
+4:y:102.2,3 i
+aDraw->Screen 249.1,263.2 16
+4
+0:id:251.2,4 i
+4:image:252.2,7 R@5
+
+8:fill:253.2,6 R@5
+
+12:display:254.2,9 R@4
+
+aDraw->Wmcontext 282.1,291.2 28
+7
+0:kbd:284.2,5 Ci
+4:ptr:285.2,5 CR@10
+
+8:ctl:286.2,5 Cs
+12:wctl:287.2,6 Cs
+16:images:288.2,8 CR@5
+
+20:connfd:289.2,8 R@11
+
+24:ctxt:290.2,6 R@3
+
+aDraw->Pointer 266.1,271.2 16
+3
+0:buttons:268.2,9 i
+4:xy:269.2,4 @7
+
+12:msec:270.2,6 i
+aSys->FD 1:45.1,48.2 4
+1
+0:fd:47.2,4 i
+aSys->FileIO 65.1,69.2 8
+2
+0:read:67.2,6 Ct16.4
+0:t0:17,20 i
+4:t1:17,20 i
+8:t2:17,20 i
+12:t3:17,20 @13
+
+
+4:write:68.2,7 Ct16.4
+0:t0:18,21 i
+4:t1:18,21 Ab
+8:t2:18,21 i
+12:t3:18,21 @14
+
+
+Ct8.2
+0:t0:63.22,35 Ab
+4:t1:22,35 s
+Ct8.2
+0:t0:64.23,26 i
+4:t1:23,26 s
+aTimers->Timer 3:2.1,9.2 8
+2
+0:id:3.2,4 i
+4:tick:4.2,6 Ci
+12
+0:error
+1
+32:msg:0:22.6,9 s
+0
+n12:init
+1
+36:argv:28.30,34 Ls
+7
+40:f2c:50.1,4 R@12
+
+44:recv:56.1,5 CAb
+48:send:55.1,5 CAb
+52:portnum:41.1,8 i
+56:rdfd:42.2,6 R@11
+
+60:wrfd:8,12 R@11
+
+64:err:14,17 s
+n97:srvlink
+3
+32:f2c:64.8,11 R@12
+
+36:send:31,35 CAb
+40:recv:37,41 CAb
+24
+44:bix:70.1,4 i
+48:buffer:69.1,7 Ab
+52:data:82.1,5 Ab
+56:rdfid:67.1,6 i
+60:wrfid:68.1,6 i
+64:wrreply:76.1,8 @14
+
+68:me:66.1,3 i
+72:readreq:73.1,8 Ct16.4
+0:t0:72.19,22 i
+4:t1:19,22 i
+8:t2:19,22 i
+12:t3:19,22 @13
+
+
+76:sendchan:78.1,9 CAb
+80:writereq:75.1,9 Ct16.4
+0:t0:1:68.18,21 i
+4:t1:18,21 Ab
+8:t2:18,21 i
+12:t3:18,21 @14
+
+
+84:newb:0:92.3,7 Ab
+88:rdata:119.2,7 Ab
+92:rdblk:72.1,6 Ct16.4
+0:t0:19,22 i
+4:t1:19,22 i
+8:t2:19,22 i
+12:t3:19,22 @13
+
+
+96:sendblk:77.1,8 CAb
+100:senddata:79.1,9 Ab
+104:wrblk:74.1,6 Ct16.4
+0:t0:19,22 i
+4:t1:19,22 Ab
+8:t2:19,22 i
+12:t3:19,22 @14
+
+
+120:offset:100.2,8 i
+124:count:10,15 i
+128:fid:17,20 i
+132:rc:22,24 @13
+
+136:offset:132.2,8 i
+140:data:10,14 Ab
+144:fid:16,19 i
+148:wc:21,23 @14
+
+n265:killgrp
+1
+32:pid:166.8,11 i
+2
+36:pctl:168.1,5 R@11
+
+40:poison:170.2,8 Ab
+n283:serialport
+1
+32:port:176.11,15 i
+8
+36:serport:178.1,8 s
+40:i:201.6,7 i
+44:config:191.1,7 As
+48:cmd:202.2,5 Ab
+52:ctlfd:187.1,6 R@11
+
+56:rfd:181.1,4 R@11
+
+60:serctl:179.1,7 s
+64:wfd:184.1,4 R@11
+
+t12.3
+0:t0:176.26,37 R@11
+
+4:t1:26,37 R@11
+
+8:t2:26,37 s
+372:reader
+2
+32:fd:210.7,9 R@11
+
+36:out:25,28 CAb
+3
+40:buf:215.1,4 Ab
+44:n:217.2,3 i
+48:data:220.2,6 Ab
+n392:nbread
+2
+32:ms:229.7,9 i
+36:n:11,12 i
+5
+40:tot:232.1,4 i
+44:dlen:251.4,8 i
+48:ret:231.1,4 Ab
+52:data:248.3,7 Ab
+56:tmr:243.1,4 R@15
+
+Ab453:consume
+0
+0
+n462:protocol
+3
+32:fd:278.9,11 R@11
+
+36:send:27,31 CAb
+40:recv:33,37 CAb
+7
+44:data:286.2,6 Ab
+48:poll:298.2,6 i
+52:tmr:283.1,4 R@15
+
+56:starttower:282.1,11 i
+60:reply:300.3,8 Ab
+64:towerdown:281.1,10 R@15
+
+68:seqnum:280.1,7 i
+n545:datasend
+4
+32:wrfd:345.9,13 R@11
+
+36:seqnum:29,35 i
+40:data:43,47 Ab
+44:startup:65,72 i
+22
+48:b:405.2,3 b
+49:lhval:383.1,6 b
+52:reply:415.1,6 Ab
+56:i:404.6,7 i
+60:err:414.1,4 s
+64:ldata:367.1,6 Ab
+68:rcxdata:397.1,8 Ab
+72:step:420.2,6 i
+76:cksum:403.1,6 i
+80:ei:435.8,10 i
+84:mdata:489.2,7 Ab
+88:rcix:402.1,5 i
+92:rcxlen:396.1,7 i
+96:blklen:366.1,7 i
+100:llen:365.1,5 i
+104:try:416.6,9 i
+108:comp:355.2,6 Ab
+112:docomp:353.1,7 i
+116:dummy:348.1,6 Ab
+120:lnhdr:490.2,7 i
+124:poll:491.2,6 i
+80:replen:447.2,8 i
+t12.3
+0:t0:345.83,96 Ab
+4:t1:83,96 i
+8:t2:83,96 s
+848:rlencode
+1
+32:data:511.9,13 Ab
+7
+36:nextval:517.1,8 i
+40:val:516.1,4 i
+44:n0:518.1,3 i
+48:out:515.1,4 Ab
+52:srcix:513.1,6 i
+56:outix:514.1,6 i
+60:newout:552.3,9 Ab
+Ab905:rldecode
+1
+32:data:561.9,13 Ab
+6
+36:n0:567.1,3 i
+40:out:565.1,4 Ab
+44:srcix:563.1,6 i
+48:val:568.1,4 i
+52:outix:564.1,6 i
+56:newout:587.3,9 Ab
+Ab5
+196:datain:19.0,6 CAb
+200:errormsg:20.0,8 s
+240:overrun:227.0,7 Ab
+272:sys:16.0,3 mSys
+1:4.0,160.1 0
+
+276:timers:0:17.0,6 mTimers
+3:1.0,13.1 0
+
diff --git a/appl/demo/lego/mkfile b/appl/demo/lego/mkfile
new file mode 100644
index 00000000..3ae4e898
--- /dev/null
+++ b/appl/demo/lego/mkfile
@@ -0,0 +1,36 @@
+<../../../mkconfig
+
+TARG=\
+ clockface.dis\
+ firmdl.dis\
+ legolink.dis\
+ rcxsend.dis\
+ timers.dis\
+ styx.srec\
+
+SHTARG=\
+ clockreg.sh\
+
+MODULES=\
+ rcxsend.m\
+
+SYSMODULES= \
+ bufio.m\
+ draw.m\
+ sys.m\
+ timers.m\
+
+DISBIN=$ROOT/dis/demo/lego
+
+<$ROOT/mkfiles/mkdis
+
+$DISBIN/%.srec: %.srec
+ rm -f $target && cp $stem.srec $target
+
+SHFILES=${SHTARG:%.sh=$DISBIN/%}
+install:V: $SHFILES
+%.install:V: $DISBIN/%
+%.installall:V: $DISBIN/%
+
+$DISBIN/%: %.sh
+ cp $stem.sh $target && chmod a+rx $target
diff --git a/appl/demo/lego/rcxsend.b b/appl/demo/lego/rcxsend.b
new file mode 100644
index 00000000..5896f09b
--- /dev/null
+++ b/appl/demo/lego/rcxsend.b
@@ -0,0 +1,240 @@
+implement RcxSend;
+
+include "sys.m";
+include "timers.m";
+include "rcxsend.m";
+
+sys : Sys;
+timers : Timers;
+Timer : import timers;
+datain : chan of array of byte;
+debug : int;
+rpid : int;
+wrfd : ref Sys->FD;
+
+TX_HDR : con 3;
+TX_CKSM : con 2;
+
+init(portnum, dbg : int) : string
+{
+ debug = dbg;
+ sys = load Sys Sys->PATH;
+ timers = load Timers "timers.dis";
+ if (timers == nil)
+ return sys->sprint("cannot load timer module: %r");
+
+ rdfd : ref Sys->FD;
+ err : string;
+ (rdfd, wrfd, err) = serialport(portnum);
+ if (err != nil)
+ return err;
+
+ timers->init(50);
+ pidc := chan of int;
+ datain = chan of array of byte;
+ spawn reader(pidc, rdfd, datain);
+ rpid = <- pidc;
+ consume();
+ return nil;
+}
+
+reader(pidc : chan of int, fd : ref Sys->FD, out : chan of array of byte)
+{
+ pidc <- = sys->pctl(0, nil);
+
+ # with buf size of 1 there is no need
+ # for overrun code in nbread()
+
+ buf := array [1] of byte;
+ for (;;) {
+ n := sys->read(fd, buf, len buf);
+ if (n <= 0)
+ break;
+ data := array [n] of byte;
+ data[0:] = buf[0:n];
+ out <- = data;
+ }
+ if (debug)
+ sys->print("Reader error\n");
+}
+
+send(data : array of byte, n, rlen: int) : array of byte
+{
+ # 16r55 16rff 16r00 (d[i] ~d[i])*n cksum ~cksum
+ obuf := array [TX_HDR + (2*n ) + TX_CKSM] of byte;
+ olen := 0;
+ obuf[olen++] = byte 16r55;
+ obuf[olen++] = byte 16rff;
+ obuf[olen++] = byte 16r00;
+ cksum := 0;
+ for (i := 0; i < n; i++) {
+ obuf[olen++] = data[i];
+ obuf[olen++] = ~data[i];
+ cksum += int data[i];
+ }
+ obuf[olen++] = byte (cksum & 16rff);
+ obuf[olen++] = byte (~cksum & 16rff);
+
+ needr := rlen;
+ if (rlen > 0)
+ needr = TX_HDR + (2 * rlen) + TX_CKSM;
+ for (try := 0; try < 5; try++) {
+ ok := 1;
+ err := "";
+ reply : array of byte;
+
+ step := 8;
+ for (i = 0; ok && i < olen; i += step) {
+ if (i + step > olen)
+ step = olen -i;
+ if (sys->write(wrfd, obuf[i:i+step], step) != step) {
+ if (debug)
+ sys->print("serial tx error: %r\n");
+ return nil;
+ }
+
+ # get the echo
+ reply = nbread(200, step);
+ if (reply == nil || len reply != step) {
+ err = "short echo";
+ ok = 0;
+ }
+
+ # check the echo
+ for (ei := 0; ok && ei < step; ei++) {
+ if (reply[ei] != obuf[i+ei]) {
+ err = "bad echo";
+ ok = 0;
+ }
+ }
+ }
+
+ # get the reply
+ if (ok) {
+ if (needr == 0)
+ return nil;
+ if (needr == -1) {
+ # just get what we can
+ needr = TX_HDR + TX_CKSM;
+ reply = nbread(300, 1024);
+ } else {
+ reply = nbread(200, needr);
+ }
+ if (len reply < needr) {
+ err = "short reply";
+ ok = 0;
+ }
+ }
+ # check the reply
+ if (ok && reply[0] == byte 16r55 && reply[1] == byte 16rff && reply[2] == byte 0) {
+ cksum := int reply[len reply -TX_CKSM];
+ val := reply[TX_HDR:len reply -TX_CKSM];
+ r := array [len val / 2] of byte;
+ sum := 0;
+ for (i = 0; i < len r; i++) {
+ r[i] = val[i*2];
+ sum += int r[i];
+ }
+ if (cksum == (sum & 16rff)) {
+ return r;
+ }
+ ok = 0;
+ err = "bad cksum";
+ } else if (ok) {
+ ok = 0;
+ err = "reply header error";
+ }
+ if (debug && ok == 0 && err != nil) {
+ sys->print("try %d %s: ", try, err);
+ hexdump(reply);
+ }
+ consume();
+ }
+ return nil;
+}
+
+overrun : array of byte;
+
+nbread(ms, n : int) : array of byte
+{
+ ret := array[n] of byte;
+ tot := 0;
+ if (overrun != nil) {
+ if (n < len overrun) {
+ ret[0:] = overrun[0:n];
+ overrun = overrun[n:];
+ return ret;
+ }
+ ret[0:] = overrun;
+ tot += len overrun;
+ overrun = nil;
+ }
+ tmr := timers->new(ms, 0);
+loop:
+ while (tot < n) {
+ tmr.reset();
+ alt {
+ data := <- datain =>
+ dlen := len data;
+ if (dlen > n - tot) {
+ dlen = n - tot;
+ overrun = data[dlen:];
+ }
+ ret[tot:] = data[0:dlen];
+ tot += dlen;
+ <- tmr.tick =>
+ # reply timeout;
+ break loop;
+ }
+ }
+ tmr.destroy();
+ if (tot == 0)
+ return nil;
+ return ret[0:tot];
+}
+
+consume()
+{
+ while (nbread(300, 1024) != nil)
+ ;
+}
+
+serialport(port : int) : (ref Sys->FD, ref Sys->FD, string)
+{
+ serport := "/dev/eia" + string port;
+ serctl := serport + "ctl";
+
+ rfd := sys->open(serport, Sys->OREAD);
+ if (rfd == nil)
+ return (nil, nil, sys->sprint("cannot read %s: %r", serport));
+ wfd := sys->open(serport, Sys->OWRITE);
+ if (wfd == nil)
+ return (nil, nil, sys->sprint("cannot write %s: %r", serport));
+ ctlfd := sys->open(serctl, Sys->OWRITE);
+ if (ctlfd == nil)
+ return (nil, nil, sys->sprint("cannot open %s: %r", serctl));
+
+ config := array [] of {
+ "b2400",
+ "l8",
+ "po",
+ "m0",
+ "s1",
+ "d1",
+ "r1",
+ };
+
+ for (i := 0; i < len config; i++) {
+ cmd := array of byte config[i];
+ if (sys->write(ctlfd, cmd, len cmd) <= 0)
+ return (nil, nil, sys->sprint("serial config (%s): %r", config[i]));
+ }
+ return (rfd, wfd, nil);
+}
+hexdump(data : array of byte)
+{
+ for (i := 0; i < len data; i++)
+ sys->print("%.2x ", int data[i]);
+ sys->print("\n");
+}
+
diff --git a/appl/demo/lego/rcxsend.dis b/appl/demo/lego/rcxsend.dis
new file mode 100644
index 00000000..cf718cce
--- /dev/null
+++ b/appl/demo/lego/rcxsend.dis
Binary files differ
diff --git a/appl/demo/lego/rcxsend.m b/appl/demo/lego/rcxsend.m
new file mode 100644
index 00000000..f597ea1f
--- /dev/null
+++ b/appl/demo/lego/rcxsend.m
@@ -0,0 +1,4 @@
+RcxSend : module {
+ init: fn (pnum, dbg : int) : string;
+ send : fn (data : array of byte, slen, rlen : int) : array of byte;
+}; \ No newline at end of file
diff --git a/appl/demo/lego/rcxsend.sbl b/appl/demo/lego/rcxsend.sbl
new file mode 100644
index 00000000..34d1dc97
--- /dev/null
+++ b/appl/demo/lego/rcxsend.sbl
@@ -0,0 +1,552 @@
+limbo .sbl 2.1
+RcxSend
+4
+rcxsend.b
+sys.m
+timers.m
+rcxsend.m
+423
+20.1,12 0
+21.1,25 1
+22.1,34 2
+23.5,18 3
+24.10,53 4
+22,52 4
+10,53 4
+10,53 4
+3,53 4
+28.21,40 5
+32,39 5
+21,40 5
+21,40 5
+2,6 5
+8,12 5
+14,17 5
+14,17 6
+14,17 7
+14,17 8
+29.5,15 9
+30.9,12 10
+2,12 10
+32.1,17 11
+14,16 11
+1,17 11
+33.1,20 12
+34.1,31 13
+35.1,33 14
+14,18 14
+20,24 14
+26,32 14
+1,33 14
+36.1,15 15
+37.1,10 16
+1,10 16
+38.8,11 17
+1,11 17
+43.11,28 18
+21,22 18
+24,27 18
+11,28 18
+11,28 18
+1,28 18
+48.1,25 19
+50.2,34 20
+17,19 20
+21,24 20
+26,33 20
+2,34 20
+2,34 20
+51.6,12 21
+6,12 22
+52.3,8 23
+53.2,27 24
+54.13,16 25
+13,21 25
+2,21 25
+2,21 26
+55.2,15 27
+2,15 28
+2,15 28
+57.5,10 29
+58.2,30 30
+13,29 30
+2,30 30
+2,30 30
+59.0,1 31
+64.25,31 32
+16,41 32
+1,50 32
+65.1,10 33
+66.6,12 34
+6,12 34
+1,13 34
+1,26 34
+67.6,12 35
+6,12 35
+1,13 35
+1,26 35
+68.6,12 36
+6,12 36
+1,13 36
+1,26 36
+69.1,11 37
+70.6,12 38
+14,19 39
+71.7,13 40
+7,13 40
+2,14 40
+17,24 40
+2,24 40
+72.7,13 41
+7,13 41
+2,14 41
+18,25 41
+2,25 41
+73.15,22 42
+11,22 42
+2,22 42
+70.21,24 43
+21,24 43
+75.6,12 44
+6,12 44
+1,13 44
+21,36 44
+1,36 44
+76.6,12 45
+6,12 45
+1,13 45
+22,28 45
+21,37 45
+1,37 45
+78.1,14 46
+79.5,13 47
+80.19,29 48
+2,39 48
+81.6,14 49
+16,23 50
+82.2,9 51
+83.2,11 52
+86.2,11 53
+87.7,12 54
+14,16 55
+20,28 55
+88.7,15 56
+7,22 56
+89.4,18 57
+90.7,45 58
+18,22 58
+31,37 58
+24,28 58
+24,38 58
+40,44 58
+7,45 58
+7,45 58
+7,53 58
+91.8,13 59
+92.5,40 60
+16,39 60
+5,40 60
+5,40 60
+93.11,14 61
+4,14 61
+97.3,28 62
+18,21 62
+23,27 62
+3,28 62
+3,28 62
+98.7,19 63
+23,32 63
+23,40 63
+99.4,22 64
+100.4,10 65
+104.8,15 66
+17,19 67
+23,32 67
+105.26,30 68
+21,31 68
+21,31 68
+8,17 68
+8,31 68
+106.5,21 69
+107.5,11 70
+104.34,38 71
+34,38 71
+87.30,39 72
+30,39 72
+113.6,8 73
+114.7,17 74
+115.11,14 75
+4,14 75
+116.7,18 76
+118.4,28 77
+119.4,29 78
+19,22 78
+24,28 78
+4,29 78
+4,29 78
+4,29 79
+121.4,30 80
+19,22 80
+24,29 80
+4,30 80
+4,30 80
+123.7,16 81
+7,24 81
+124.4,23 82
+125.4,10 83
+129.6,8 84
+12,20 84
+12,34 84
+38,46 84
+38,60 84
+64,72 84
+64,82 84
+130.22,31 85
+22,40 85
+16,41 85
+3,41 85
+131.23,32 86
+23,41 86
+10,15 86
+3,42 86
+132.15,22 87
+15,26 87
+3,35 87
+133.3,11 88
+134.8,13 89
+19,24 90
+15,24 90
+135.4,8 91
+15,18 91
+11,19 91
+4,19 91
+136.15,19 92
+11,19 92
+4,19 92
+134.26,29 93
+26,29 93
+138.16,29 94
+7,29 94
+139.11,12 95
+4,12 95
+141.3,9 96
+142.3,20 97
+3,20 98
+3,20 99
+3,20 100
+143.13,15 101
+144.3,9 102
+145.3,29 103
+147.6,11 104
+15,22 104
+26,36 104
+148.3,38 105
+14,27 105
+29,32 105
+34,37 105
+3,38 105
+3,38 105
+149.3,17 106
+11,16 106
+3,17 106
+151.2,11 107
+2,11 107
+2,11 108
+2,11 109
+81.25,30 110
+25,30 110
+153.8,11 111
+1,11 111
+160.1,24 112
+161.1,9 113
+162.5,19 114
+163.10,21 115
+6,21 115
+164.13,20 116
+13,25 116
+3,25 116
+3,25 117
+165.3,24 118
+3,24 118
+166.10,13 119
+3,13 119
+168.2,19 120
+169.9,20 121
+2,20 121
+170.2,15 122
+172.1,26 123
+20,22 123
+24,25 123
+1,26 123
+1,26 123
+174.8,15 124
+175.2,13 125
+2,5 125
+2,13 125
+177.14,20 126
+14,20 126
+185.6,14 126
+6,14 126
+176.2,8 126
+2,8 126
+2,8 126
+2,8 126
+178.4,20 127
+179.15,22 128
+8,22 128
+180.5,19 129
+181.5,26 130
+15,19 130
+5,26 130
+183.16,20 131
+16,28 131
+4,28 131
+4,28 132
+184.4,15 133
+4,15 134
+4,15 126
+187.4,9 135
+190.1,14 136
+1,4 136
+1,14 136
+191.5,13 137
+192.9,12 138
+2,12 138
+193.8,11 139
+8,18 139
+1,18 139
+198.8,25 140
+15,18 140
+20,24 140
+8,25 140
+8,25 140
+8,32 140
+8,32 141
+8,32 141
+200.0,1 142
+204.25,36 143
+1,36 143
+1,36 144
+205.1,26 145
+207.1,38 146
+18,25 146
+27,37 146
+1,38 146
+1,38 146
+208.5,15 147
+209.10,13 148
+15,18 148
+20,62 148
+32,52 148
+54,61 148
+20,62 148
+20,62 148
+2,63 148
+210.1,39 149
+18,25 149
+27,38 149
+1,39 149
+1,39 149
+211.5,15 150
+212.10,13 151
+15,18 151
+20,63 151
+32,53 151
+55,62 151
+20,63 151
+20,63 151
+2,64 151
+213.1,40 152
+20,26 152
+28,39 152
+1,40 152
+1,40 152
+214.5,17 153
+215.10,13 154
+15,18 154
+20,61 154
+32,52 154
+54,60 154
+20,61 154
+20,61 154
+2,62 154
+217.1,225.2 155
+218.2,9 155
+2,9 155
+219.2,6 155
+2,6 155
+220.2,6 155
+2,6 155
+221.2,6 155
+2,6 155
+222.2,6 155
+2,6 155
+223.2,6 155
+2,6 155
+224.2,6 155
+2,6 155
+227.6,12 156
+18,28 157
+14,28 157
+228.23,32 158
+2,32 158
+229.6,37 159
+17,22 159
+24,27 159
+29,36 159
+6,37 159
+6,37 159
+6,42 159
+230.11,14 160
+16,19 160
+21,69 160
+33,57 160
+59,68 160
+59,68 160
+21,69 160
+21,69 160
+3,70 160
+3,70 161
+227.30,33 162
+30,33 162
+232.9,12 163
+14,17 163
+19,22 163
+1,23 163
+236.6,12 164
+18,26 165
+14,26 165
+237.2,34 166
+13,20 166
+26,33 166
+22,33 166
+2,34 166
+2,34 166
+236.28,31 167
+28,31 167
+238.1,17 168
+12,16 168
+1,17 168
+1,17 168
+239.0,1 169
+4
+aSys->Dir 1:26.1,39.2 64
+11
+0:name:28.2,6 s
+4:uid:29.2,5 s
+8:gid:30.2,5 s
+12:muid:31.2,6 s
+16:qid:32.2,5 @1
+
+32:mode:33.2,6 i
+36:atime:34.2,7 i
+40:mtime:35.2,7 i
+48:length:36.2,8 B
+56:dtype:37.2,7 i
+60:dev:38.2,5 i
+aSys->Qid 11.1,16.2 16
+3
+0:path:13.2,6 B
+8:vers:14.2,6 i
+12:qtype:15.2,7 i
+aSys->FD 45.1,48.2 4
+1
+0:fd:47.2,4 i
+aTimers->Timer 2:2.1,9.2 8
+2
+0:id:3.2,4 i
+4:tick:4.2,6 Ci
+7
+0:init
+2
+32:portnum:0:18.5,12 i
+36:dbg:14,17 i
+3
+40:err:27.1,4 s
+44:pidc:33.1,5 Ci
+48:rdfd:26.1,5 R@2
+
+s37:reader
+3
+32:pidc:41.7,11 Ci
+36:fd:27,29 R@2
+
+40:out:45,48 CAb
+3
+44:buf:48.1,4 Ab
+48:n:50.2,3 i
+52:data:53.2,6 Ab
+n67:send
+3
+32:data:61.5,9 Ab
+36:n:27,28 i
+40:rlen:30,34 i
+15
+48:i:70.6,7 i
+52:reply:84.2,7 Ab
+56:ok:82.2,4 i
+60:olen:65.1,5 i
+64:obuf:64.1,5 Ab
+68:step:86.2,6 i
+72:err:83.2,5 s
+76:needr:78.1,6 i
+80:ei:104.8,10 i
+84:r:132.3,4 Ab
+88:cksum:69.1,6 i
+92:try:81.6,9 i
+96:sum:133.3,6 i
+100:val:131.3,6 Ab
+80:cksum:130.3,8 i
+Ab251:nbread
+2
+32:ms:158.7,9 i
+36:n:11,12 i
+5
+40:tot:161.1,4 i
+44:dlen:178.4,8 i
+48:ret:160.1,4 Ab
+52:data:177.3,7 Ab
+56:tmr:172.1,4 R@3
+
+Ab309:consume
+0
+0
+n318:serialport
+1
+32:port:202.11,15 i
+8
+36:serport:204.1,8 s
+40:i:227.6,7 i
+44:config:217.1,7 As
+48:cmd:228.2,5 Ab
+52:ctlfd:213.1,6 R@2
+
+56:rfd:207.1,4 R@2
+
+60:serctl:205.1,7 s
+64:wfd:210.1,4 R@2
+
+t12.3
+0:t0:202.26,37 R@2
+
+4:t1:26,37 R@2
+
+8:t2:26,37 s
+407:hexdump
+1
+32:data:234.8,12 Ab
+1
+36:i:236.6,7 i
+n7
+72:datain:10.0,6 CAb
+76:debug:11.0,5 i
+92:overrun:156.0,7 Ab
+108:rpid:12.0,4 i
+132:sys:7.0,3 mSys
+1:4.0,160.1 0
+
+136:timers:0:8.0,6 mTimers
+2:1.0,13.1 0
+
+148:wrfd:0:0,4 R@2
+
diff --git a/appl/demo/lego/styx.srec b/appl/demo/lego/styx.srec
new file mode 100755
index 00000000..687a50aa
--- /dev/null
+++ b/appl/demo/lego/styx.srec
@@ -0,0 +1,329 @@
+S00C0000737479782E7372656340
+S11880006DF06DF16DF26DF35E00967E6D736D726D716D7054AD
+S118801570446F20796F7520627974652C207768656E20492057
+S10B802A6B6E6F636B3F0000F5
+S11880326DF60D761B870D621B8279014000790029F25E00965F
+S1188047AC6B039A0A6F62FFFE1D23470819226B829A084012E9
+S118805C6B039A08790200091D234E060B036B839A086F61FF76
+S1188071FE6B819A0A6B039A08790200097900FFFF1D234F02CC
+S11880860D100B876D7654706DF60D760D02790330026DF3790F
+S118809B01301F79001FF25E0096BC0B87790027C85E0096D480
+S11880B06D7654706DF60D766DF40D047901300679001B625EB4
+S11880C50096DE0D405E00808E5E0080320D0046F86D746D7656
+S11880DA54706DF60D766DF40D041900684B473C0D1147380B7A
+S11880EF040CBA8AD0AA09422E0CB8F00088D090FF1B01684BC7
+S118810447200D11471C0B040CBA8AD0AA0942120D0209220901
+S118811922092009000CBAF200092040D66D746D7654706DF617
+S118812E0D761B871B876DF46DF56FE0FFFE0D146FE0FFFC0DEA
+S1188143444C16FA2D688A6F62FFFE0D230B036FE3FFFC170CE8
+S118815817040B040D444610FA306F63FFFC68BA0B036FE3FFC5
+S118816DFC404C790527101D454F407901000A0D505E0096EA0C
+S11881820D051D454EF0402E0D510D405E0096EA0C8A8A306F7C
+S118819763FFFC68BA0B036FE3FFFC0D510D405E0096FC0D0448
+S11881AC7901000A0D505E0096EA0D050D5546CE6F62FFFC6F38
+S11881C163FFFE19326FE2FFFC6F60FFFC6D756D740B870B87FD
+S11881D66D7654706DF60D761B876DF46DF50D040D156FE2FF1B
+S11881EBFE7900000A5E00972269846F8500026F62FFFE6F8241
+S118820000046F6200046F82000619226F8200086A0AA40A8AB5
+S1188215016A8AA40A6D756D740B876D7654706DF60D765E006D
+S118822A979C6A0AA40A8AFF6A8AA40A6D7654706DF60D7669C5
+S118823F00790198885E008FD6790000016D7654706DF60D76C2
+S11882541B871B876DF46DF50D056FE1FFFE6FE2FFFC40266990
+S1188269546F61FFFC0D406F62FFFE5D200D00470E6F4200082A
+S118827E69D20D405E0082244006790500080945695246D66DFD
+S1188293756D740B870B876D7654706DF60D761B871B876DF426
+S11882A86DF56FE0FFFE6FE1FFFC19557904A3DC6F62FFFC6F1F
+S11882BD61FFFE0D405E0082508C0E94000B05790200021D25D0
+S11882D24FE46D756D740B870B876D7654706DF60D7679030070
+S11882E70C19376DF46DF56FE2FFFE6F6400040D1147045A0077
+S11882FC83FE6E080002F00088F990FF6FE0FFFC6F65FFFC094E
+S11883115509550955190509557902A3D009520D256F62FFFE7D
+S118832646045A0083FE684BF300790200621D23470C79020088
+S118833B6C1D23470A5A0083FE79020060400219226FE2FFF8B1
+S11883500B046F63FFFE1B030D3346045A0083FE684AAA3E46D3
+S118836504FA014006AA3C460C18AA6EEAFFFB0B041B034006FB
+S118837AFA016EEAFFFB0D3346045A0083FE7901823A0D50881D
+S118838F0C900019226FE3FFF45E0082506F62FFFC8A00921091
+S11883A46FE2FFF66F61FFF6790019C45E0096DEFA0168DA6EE2
+S11883B96AFFF96EDA00016F63FFF40D310D405E0080DC6FD0B7
+S11883CE000A19226FD200026FD200046EDA0006FA016EDA0038
+S11883E3086E6AFFFB6EDA00096F61FFF6790019465E0096DEE7
+S11883F86F60FFFE40047900FFFF6D756D747903000C09376DED
+S118840D7654706DF60D767903000619376DF46DF56FE0FFFE55
+S11884226FE1FFFC0D256F6400085E0090340D031D45443219C6
+S1188437546F6000041D0443046F6400046F62000609526FE243
+S118844C00060D300B800B000D426F6100066FE3FFFA5E0097D9
+S1188461AE6F63FFFA4002194468BC0D420C2A18226EBA0001DE
+S118847618AA6EBA00020B840B046DF419226DF26F62FFFC6F2D
+S118848B61FFFEF80F5E0090480B870B876D756D7479030006D4
+S11884A009376D7654706DF60D767903000C19376DF46DF56FEC
+S11884B5E0FFF66FE1FFF40D257904FFF809646F6100060D4060
+S11884CA5E00812C6DF06DF46F6200046DF20D526F61FFF46F0B
+S11884DF60FFF65E0084108F0697006D756D747903000C093786
+S11884F46D7654706DF60D766E0A0009471019116F0300046FFB
+S118850902000A1D234514400E19116F0300046F02000A1D230B
+S118851E4404790100010D106D7654706DF60D761B876DF46D67
+S1188533F56FE1FFFE0D256E0A0002F2008AF992FF0D240944BD
+S118854809440944192409447902A3D009420D246E4A00084686
+S118855D067900FFFF404E0D405E0084F80D0047206F420004AA
+S11885726DF26F6200066DF26F6200040D516F60FFFE5E00847A
+S1188587A60B870B8740226F6200066DF26F6200040D516F6077
+S118859CFFFE5E0081DA6F42000C6F8200086FC0000C0B871974
+S11885B1006D756D740B876D7654706DF60D761B876DF46DF56A
+S11885C67903A400683A4D045A008686EA7F68BA19440D4509E0
+S11885DB5509550955194509557902A3D009520D256E5A00086F
+S11885F00D430B036FE3FFFE0CAA46045A0086768C0094100D32
+S1188605520D41790014C05E0096AC0D520D41790014C05E0077
+S118861A96AC0D520D41790014C05E0096AC0D520D4179001431
+S118862FC05E0096AC0D505E0084F80D00473840306F54000CD0
+S11886446F4200086FD2000C6F41000269406F5200046DF26F29
+S11886594200066DF26F4200045E0084A60D405E0082240B8741
+S118866E0B876F52000C46CA6F64FFFE790200021D244E045A4A
+S11886830085D86D756D740B876D7654706DF60D766DF46DF5DC
+S11886980D050D246F600004680BF300790200661D2347244E73
+S11886AD127902002D1D234750790200461D23472440327902CA
+S11886C200721D23470E0B021D23470E4022790200014010794F
+S11886D7020002400A7902000340047902000469926E0A000187
+S11886EC8AD0AA074304190040146E0A0001F2008AD092FF69F7
+S1188701C2FA0168DA790000016D756D746D7654706DF60D7696
+S11887167903001A19376DF46DF56FE2FFEE0D1147045A008818
+S118872B1A6EE9FFF26EE9FFF16EE9FFF06E0A0002AA054704D2
+S11887405A0087CC790200066F60FFEE1D2047045A00881A7939
+S118875504FFF409647905FFFA09657902FFF009626FE2FFECB1
+S118876A6F6300046DF30D420D516F60FFEC5E0086900B870D46
+S118877F0046045A00881A0D611B811B817900FFF109606F6252
+S118879400040B826DF21B826FE200047902FFF609625E00862B
+S11887A9900B870D00476A0D611B817900FFF209606F63000424
+S11887BE0B830B836DF37902FFF809624044790200026F63FF77
+S11887D3EE1D2346426E0B0002F3001B837900FFF409606FE0A7
+S11887E8FFEA0D3209227905FFFA09650D5109217904FFF00943
+S11887FD640D4009306F6300046DF36F63FFEA09230D325E00BF
+S118881286900B870D0046067900FFFF405019337904FFF40980
+S1188827647900FFF009606FE0FFE86F60FFE86C0A6FE0FFE86B
+S118883C0CAA471E0D318900912069426DF2695279001A4E6F7B
+S1188851E3FFE65E0096BC0B876F63FFE60B840B850B037902A5
+S118886600021D234FC66F60FFEE6D756D747903001A09376DE0
+S118887B7654706DF60D760D036B00A408400269000D00470896
+S11888906F0200021D3246F26D7654706DF60D761B876DF46DD8
+S11888A5F50D056FE1FFFE7900000E5E0097220D0446087900F0
+S11888BA02135E0080B418AA6ECA00046FC500026B02A4086948
+S11888CFC20D4088059000790200086F61FFFE5E0097AE6B8482
+S11888E4A4080D406D756D740B876D7654706DF60D766F03002E
+S11888F9026F1200021D23470419004004790000016D765470D8
+S118890E6DF60D766DF40D04790088F20D415E00829E7903A419
+S118892308401269301D40460A690269B25E00979C400E0D0326
+S1188938693246EA790002325E0080B46D746D7654706DF60D24
+S118894D766DF46DF50D040D156F4200044608790002395E0090
+S118896280B46F440004401C6940790198DC5E0097D20D004703
+S11889770A0D5546040D40400C1B058C0A9400694246E0190064
+S118898C6D756D746D7654706DF60D761B876DF46DF50D056F9C
+S11889A1E1FFFE6E5A000446226E5A0005AA0943087900024B1A
+S11889B65E0080B46E5A0005F20009226F229A0C6F220004461A
+S11889CB067900FFFF403E0D20690247360D0469406F61FFFEFC
+S11889E05E0097D20D00461E6E4A00026EDA00056F4200041872
+S11889F5BB0D224702FB806EDB000879000001400A8C0A94007C
+S1188A0A694246CC19006D756D740B876D7654706DF60D761B80
+S1188A1F876DF46DF56FE0FFFE0D157902007419110D505E00B2
+S1188A3498086F62FFFE69210D505E00981E0D50881C900079B6
+S1188A490400050D427901995E5E0097AE0D50883890000D42AC
+S1188A5E7901995E5E0097AE6F63FFFE6E3A00026EDA00546F67
+S1188A73320004FBB60D224702FB6D6EDB005CFA016EDA005DDE
+S1188A886F63FFFE6F32000418BB0D224702FB806EDB005F6D86
+S1188A9D756D740B876D7654706DF60D766DF46DF50D040D1555
+S1188AB26E4A000447067900FFFF40266E4A0005AA0943087991
+S1188AC700026B5E0080B46E4A0005F20009226F209A0C0D512A
+S1188ADC5E008A1A790000016D756D746D7654706DF60D766E47
+S1188AF10A000446107369460C6E0A0008470A89FFA901420491
+S1188B061900400AFA016E8A0004790000016D7654706DF60D6B
+S1188B1B767903000A19376DF46DF56FE0FFFE6FE1FFFC6FE24A
+S1188B30FFFA6E0A0005AA094308790002875E0080B46F60FF56
+S1188B45FE6E0A0005F20009226F229A0C6FE2FFF86E0A000880
+S1188B5AEA8046045A008C3A6E0A00044720790100746F60008E
+S1188B6F045E0098320D004610790100746F60FFFA5E00983280
+S1188B840D0047087900FFFF5A008C6C790100746F6000045E94
+S1188B990098446FE00004790100746F60FFFA5E0098446FE055
+S1188BAEFFFA5E0090346FE0FFF66F64FFF60B840B041955403B
+S1188BC30C0D415E008A1A8C7494000B056F6200041D2544122C
+S1188BD86F61FFFA09516F60FFF85E00894A0D0046DA0D5209D5
+S1188BED22092209221952092209220925095509556F63FFF685
+S1188C0268BD0D520C2A10021E226EBA000118AA6EBA00020B2D
+S1188C17850B056DF519226DF26F63FFFE6F3200026F61FFFC76
+S1188C2CF80F5E00904819000B870B8740326F60FFF86F03000B
+S1188C410647246F6200046DF26F60FFFA6DF06F60FFFE6F0213
+S1188C5600026F61FFFC6F60FFF85D300B870B8740047900FF05
+S1188C6BFF6D756D747903000A09376D7654706DF60D761B8739
+S1188C806DF46DF50D046FE1FFFE0D256E4A0008EA8046066EA4
+S1188C954A000446067900FFFF403C6E4A0005AA094308790005
+S1188CAA02B35E0080B46E4A0005F20009226F209A0C6F0200EA
+S1188CBF0847166F6200046DF26F0300080D526F61FFFE5D30D0
+S1188CD40B8740047900FFFF6D756D740B876D7654706DF60DCE
+S1188CE9761B876DF46DF56F63000446087900FFFF5A008DD243
+S1188CFE0D25194419116F6300040D5209326FE2FFFE40386806
+S1188D135BAB8846186F6200041B821D214CD4688B0B0018AACB
+S1188D28688A0B000B8140180CBB46040B0440106F6200041BF1
+S1188D3D021D214CB4688B0B000B010B0519336F62FFFE1D2567
+S1188D52450479030001685A46040D3347B2790200011D2447F9
+S1188D67124E060D4447584038790200021D24471A402E6F62C7
+S1188D7C00041B021D214D045A008CF618AA688A0B000B014047
+S1188D91346F6200041B821D214D045A008CF618AA688A0B00F9
+S1188DA640186F6200041B821D214D045A008CF6FA88688A0B00
+S1188DBB000CCA8AFE688A0B000B8119440D3346045A008D12D8
+S1188DD00D106D756D740B876D7654706DF60D761B876DF46D1B
+S1188DE5F50D040D2519226FE2FFFE0D55475E681AAA8847149E
+S1188DFA68CA0B010B046F62FFFE0B026FE2FFFE1B0540E20B9D
+S1188E0F016818F0000D00461468CA0B046F62FFFE0B026FE205
+S1188E24FFFE0B011B8540C40D030B836F62FFFE09326FE2FF91
+S1188E39FE0D321B030B011B854FAC188868C80B040D321B03E2
+S1188E4E4EF6409E6F60FFFE6D756D740B876D7654706DF60DB1
+S1188E63766DF46DF56A0CA40E47045A008F0079059F586B027F
+S1188E78A4106DF20D527901009379009EC35E008CE66B80A429
+S1188E8D060B870D004C206B02A4100D5179009EC35E0097AEBF
+S1188EA26B02A4106B82A40679029EC268AC0D23400879039E7E
+S1188EB7C2FA0868BA6A0AA40A47047D3070206838F0006A0A0E
+S1188ECCA40F4602C80168B86B00A4060D020B026B82A4066A77
+S1188EE10BA4076A8B9EC00C2A10021E226A8A9EC10B800B00FE
+S1188EF66B80A406FA016A8AA40E6D756D746D7654706DF60D53
+S1188F0B766DF46DF55E008E606B02A4106B82A40C79059EC02E
+S1188F206B04A406471A6DF46DF51922790117767900343E5E70
+S1188F350098560B870B870C8846E66D756D746D7654706DF684
+S1188F4A0D766B02A4106B03A40C1D32430E79009F580D3109F5
+S1188F5F0119325E0097AE6B02A40C6B03A41019230D326B8263
+S1188F74A41018AA6A8AA40E6D7654706DF60D766DF46DF50D6B
+S1188F89246F6500046B03A41079029F5809320D2368B86EB98D
+S1188F9E00010C1918116EB900020D44470E0B830B030D520D94
+S1188FB3410D305E0097AE6B02A4100B820B0209526B82A410CD
+S1188FC818AA6A8AA40E6D756D746D7654706DF60D766DF46D0A
+S1188FDDF50D156B04A41079029F5809420D24FA0368CA6EC8EE
+S1188FF200010C0818006EC800020D505E009874790200401D62
+S1189007204F020D200B840B040D020D510D405E0097AE6B024A
+S118901CA4108A4392006B82A41018AA6A8AA40E6D756D746DEF
+S11890317654706DF60D766B00A41079029F5D09020D206D7655
+S118904654706DF60D766DF46DF56F6400046B03A41079059F8E
+S118905B5809350D5368B86EB900010C1918116EB900026EBA1F
+S118907000030C2A18226EBA00040D4447108B0593006F6200AC
+S1189085060D410D305E0097AE6B02A4108A0592006F60000687
+S118909A09026B82A41018AA6A8AA40E6D756D746D7654706DD2
+S11890AFF60D7669021D12470419004004790000016D765470CC
+S11890C46DF60D760D01790090AE5E00829E6D7654706DF60D53
+S11890D9767903000E19376DF46DF50D050D14790000021D049C
+S11890EE4E08790003935E0080B46C5A6EEAFFFD6E5B00010C82
+S1189103B318BB685AF20014AB14236FE3FFFA1B841B040B858A
+S11891186E6BFFFDF3000D33470A790200041D23470E40446DE0
+S118912DF319226F61FFFAF801402E790200021D244708790045
+S1189142039D5E0080B46E5800010C801888685AF20014A8146B
+S1189157205E0090C419226DF26F61FFFAF8055E008F800B87CE
+S118916C5A009496790200011D244E08790003A45E0080B46E33
+S11891815800010C801888685AF20014A814206FE0FFF81B84C7
+S11891960B855E00887E6FE0FFF46E6BFFFDF3008BFA93FF7932
+S11891AB0200161D2343045A00948E09336F3299DA592079024C
+S11891C000381D244708790003AA5E0080B46F63FFF447087989
+S11891D50199635A0094567901988E6F60FFF85E00889C6FE009
+S11891EAFFF4790200086DF2880590006DF06F62FFF86F61FF86
+S11891FFFAF81D5A0094840D444708790003B65E0080B46F62A1
+S1189214FFF446087901996E5A0094566F60FFF45E00890E6E16
+S11892296BFFFDAB1446087901997A5A00945619226DF26DF2EE
+S118923E6F62FFF86F61FFFAF8135A009484790200021D244704
+S118925308790003C45E0080B46E5C00010CC418CC685AF200F5
+S118926814AC14240D405E00887E6F62FFF446045A0092186EC4
+S118927D2A00044708790199875A0094560D0047045A0091D466
+S11892926F61FFF4890591000D405E00889C19226DF26DF26FAA
+S11892A762FFF86F61FFFAF8075A0094847902001C1D244708F4
+S11892BC790003D35E0080B40D516F60FFF45E0089940D0046CA
+S11892D108790199935A009456790200086DF26F63FFF48B055B
+S11892E693006DF36F62FFF86F61FFFAF8095A0094840D4447E0
+S11892FB08790003DA5E0080B47904A3580D416F60FFF45E0084
+S11893108AA60D004608790199A05A009456790200746DF26D07
+S1189325F46F62FFF86F61FFFAF8175A009484790200211D244C
+S118933A4708790003E25E0080B4790199AB5A0094567902005E
+S118934F011D244708790003E65E0080B468596F60FFF45E009F
+S11893648AEC0D004608790199B85A009456790200086DF26FBF
+S118937960FFF4880590006DF06F62FFF86F61FFFAF80B5A0020
+S118938E94847902000A1D244708790003ED5E0080B46E5A00D6
+S11893A3010CA218AA6859F1006E5B00090CB318BB6E5800085C
+S11893B8F000148B14036DF3149A14126F61FFFA6F60FFF45ED9
+S11893CD008B180B870D004D045A009496790199C35A00945656
+S11893E27902000A1D244E08790003F45E0080B46E5A00010C7F
+S11893F7A218AA6FE2FFF6685AF2006F60FFF614A814206FE0FC
+S118940CFFF66E5B00090CB318BB6E5A0008F20014AB14238DA9
+S11894210B95008CF594FF1D434710790003F96FE3FFF25E00B1
+S118943680B46F63FFF26DF50D326F61FFF66F60FFF45E008C14
+S118944B7A0B870D004C0E790199CE6F60FFFA5E008FD64036B3
+S11894606EE8FFFE0C0810001E006EE8FFFF790200026DF20D21
+S1189475621B826DF26F62FFF86F61FFFAF8115E0090480B871E
+S118948A0B874008790004045E0080B46D756D747903000E0986
+S118949F376D7654706DF60D766DF46DF50D04684BF3007902FB
+S11894B400451D23470C7902004D1D2347045A009548790200C2
+S11894C9051D214708790004125E0080B479039A28683DF500FF
+S11894DE6A0A9A290CA218AA14AD14250D5209326E4B00036E10
+S11894F3AB000118BB6A0AA40F4602FB016A8BA40F5E008F4899
+S1189508790200011D254F326A0A9A2AEA08471E79019A2B79C4
+S118951D049AC00D521B020D405E008DDC0D050D510D405E002C
+S118953290D6400C79009A2B0D511B015E0090D65E008F0840BD
+S1189547087900042C5E0080B46D756D746D7654706DF60D7678
+S118955C7903005219376DF45E00970E7900FFB0096079020068
+S11895714019115E0098087902A4007901FFB6096179003B9A73
+S11895865E0096AC790029645E0096D4790014985E0096D479F8
+S118959B0200016DF26DF27902FFB609627901FFB4096179004B
+S11895B030D05E0098560B870B87790230026DF2192279013041
+S11895C51F79001FF25E0096BC0B877901300779001B625E009D
+S11895DA96DE790027C85E0096D419446DF479029A2879011748
+S11895EF717900327C5E0096BC0B876A8CA40F6B84A4066B8458
+S1189604A4106A8CA40E405C19227901FFAF0961790034265E57
+S11896190096AC6E6AFFAFF2000CAA473E18AA6EEAFFAE790201
+S118962EFFAE09626DF2790200107901FFF00961790033B05E94
+S11896430096BC0B876E69FFAEF1006B029A200B026B829A20DA
+S11896581B017900FFF009605E0094A45E0085BC5E0080320DBA
+S114966D00469C19006D747903005209376D76547057
+S118967E6DF60D7679029A207903A4121D32470A188868A80B2B
+S1189693021D3246F85E009558FA016A8AFFCC6B0200005D2040
+S10796A86D76547013
+S11396AC6DF66DF20D165D000D600B876D765470C2
+S11896BC6DF66F7300046DF36DF20D165D000D600B870B876D0F
+S10696D176547058
+S10D96D46DF65D000D606D765470B4
+S10F96DE6DF60D165D000D606D76547085
+S11596EA6DF56DF60D060D155F520D606D766D755470C9
+S11596FC6DF56DF60D060D155F500D606D766D755470B9
+S118970E6DF60D767903A4127902EF00193269B26D7654706D46
+S1189723F60D766DF46DF50D040B04ECFE0B841D04455C79001D
+S1189738A4120D01404C69024D4209217902EEFF1D2142144068
+S118974D0E690209326982691209211D51420469134CEE6903E9
+S11897621D4345220D428A0692001D23450A0D02094219436908
+S1189777A369846902C28069820B804010E27F09210D107905B0
+S118978CEEFF1D5043AC19006D756D746D7654706DF60D766FA3
+S11097A102FFFEE27F6F82FFFE6D765470C2
+S11897AE6DF60D766DF40D140D010D0309231D31470A6C4A6833
+S11297C38A0B001D3046F60D106D746D765470D0
+S11897D26DF60D76401C680B681A1CAB430679000001401E1C43
+S11897E7AB44067900FFFF40140B000B01680A46E0681A19005F
+S10F97FC0CAA47047900FFFF6D7654703E
+S11898086DF60D760D0309231D3047066CB91D3046FA6D7654A2
+S104981D70D6
+S117981E6DF60D760D036C1A68BA0B030CAA46F66D765470ED
+S11598326DF56DF60D060D155F4C0D606D766D75547085
+S11598446DF56DF60D060D155F4E0D606D766D75547071
+S11898566DF66F7300066DF36F7300066DF36DF20D165D000D1A
+S10C986B608F0697006D765470BD
+S11798746DF60D76193340020B036C0A46FA0D306D765470C0
+S1189888726573657400000000800000000098DC000099120005
+S118989D00000098DA020000000000871298D803000000000032
+S11898B2871298D6040000000000871298D20500000000008703
+S11898C712000000000000000000003031320032003100300050
+S11898DC2E2E000098DC000099120000000098DA0700000085FA
+S11898F12A82E098D808000000852A82E098D609000000852A23
+S118990682E00000000000000000000098DC0000994800000091
+S118991B0099410100989600000000993A060098E000000000D9
+S11899300000000000000000000073656E736F72006D6F746FC5
+S1189945720000995C00009912000000000000000000000000F7
+S118995A00002F006C65676F0066696420696E20757365006E19
+S118996F6F2073756368206669640063616E27742072656D6FAA
+S118998476650063616E277420636C6F6E65006E6F20737563A9
+S118999968206E616D650063616E277420737461740063616EB1
+S11899AE2774206372656174650063616E2774206F70656E00D2
+S11899C363616E277420726561640063616E277420777269744F
+S11899D86500924C948E92B4948E934C948E9334948E93909408
+S11899ED8E93E2948E9206948E9206948E92F8948E948E948ED8
+S1099A02948E948E91BEC7
+S1189A080000FFFF9948991C98A098AA98B498BE992698EA98BC
+S1069A1DF498FEB8
+S90380007C
diff --git a/appl/demo/lego/timers.b b/appl/demo/lego/timers.b
new file mode 100644
index 00000000..67e08dec
--- /dev/null
+++ b/appl/demo/lego/timers.b
@@ -0,0 +1,263 @@
+# Chris Locke. June 2000
+
+# TODO: for auto-repeat timers don't set up a new sender
+# if there is already a pending sender for that timer.
+
+implement Timers;
+
+include "sys.m";
+include "timers.m";
+
+RealTimer : adt {
+ t : ref Timer;
+ nticks : int;
+ rep : int;
+ nexttick: big;
+ tick : chan of int;
+ sender : int;
+};
+
+Sender : adt {
+ tid : int;
+ idle : int; # set by sender() when done, reset by main when about to assign work
+ ctl : chan of chan of int;
+};
+
+sys : Sys;
+acquire : chan of int;
+timers := array [4] of ref RealTimer;
+senders := array [4] of ref Sender;
+curtick := big 0;
+tickres : int;
+
+init(res : int)
+{
+ sys = load Sys Sys->PATH;
+ acquire = chan of int;
+ tickres = res;
+ spawn main();
+}
+
+new(ms, rep : int) : ref Timer
+{
+ acquire <- = 1;
+ t := do_new(ms, rep);
+ <- acquire;
+ return t;
+}
+
+Timer.destroy(t : self ref Timer)
+{
+ acquire <- = 1;
+ do_destroy(t);
+ <- acquire;
+}
+
+Timer.reset(t : self ref Timer)
+{
+ acquire <- = 1;
+ do_reset(t);
+ <- acquire;
+}
+
+Timer.cancel(t : self ref Timer)
+{
+ acquire <- = 1;
+ do_cancel(t);
+ <- acquire;
+}
+
+# only call under lock
+#
+realtimer(t : ref Timer) : ref RealTimer
+{
+ if (t.id < 0 || t.id >= len timers)
+ return nil;
+ if (timers[t.id] == nil)
+ return nil;
+ if (timers[t.id].t != t)
+ return nil;
+ return timers[t.id];
+}
+
+
+# called under lock
+#
+do_destroy(t : ref Timer)
+{
+ rt := realtimer(t);
+ if (rt == nil)
+ return;
+ clearsender(rt, t.id);
+ timers[t.id] = nil;
+}
+
+# called under lock
+#
+do_reset(t : ref Timer)
+{
+ rt := realtimer(t);
+ if (rt == nil)
+ return;
+ clearsender(rt, t.id);
+ rt.nexttick = curtick + big (rt.nticks);
+ startclk = 1;
+}
+
+# called under lock
+#
+do_cancel(t : ref Timer)
+{
+ rt := realtimer(t);
+ if (rt == nil)
+ return;
+ clearsender(rt, t.id);
+ rt.nexttick = big 0;
+}
+
+# only call under lock
+#
+clearsender(rt : ref RealTimer, tid : int)
+{
+ # check to see if there is a sender trying to deliver tick
+ if (rt.sender != -1) {
+ sender := senders[rt.sender];
+ rt.sender = -1;
+ if (sender.tid == tid && !sender.idle) {
+ # receive the tick to clear the busy state
+ alt {
+ <- rt.tick =>
+ ;
+ * =>
+ ;
+ }
+ }
+ }
+}
+
+# called under lock
+do_new(ms, rep : int) : ref Timer
+{
+ # find free slot
+ for (i := 0; i < len timers; i++)
+ if (timers[i] == nil)
+ break;
+ if (i == len timers) {
+ # grow the array
+ newtimers := array [len timers * 2] of ref RealTimer;
+ newtimers[0:] = timers;
+ timers = newtimers;
+ }
+ tick := chan of int;
+ t := ref Timer(i, tick);
+ nticks := ms / tickres;
+ if (nticks == 0)
+ nticks = 1;
+ rt := ref RealTimer(t, nticks, rep, big 0, tick, -1);
+ timers[i] = rt;
+ return t;
+}
+
+startclk : int;
+stopclk : int;
+
+main()
+{
+ clktick := chan of int;
+ clkctl := chan of int;
+ clkstopped := 1;
+ spawn ticker(tickres, clkctl, clktick);
+
+ for (;;) alt {
+ <- acquire =>
+ # Locking
+ acquire <- = 1;
+
+ if (clkstopped && startclk) {
+ clkstopped = 0;
+ startclk = 0;
+ clkctl <- = 1;
+ }
+
+ t := <- clktick =>
+ if (t == 0) {
+ stopclk = 0;
+ if (startclk) {
+ startclk = 0;
+ clkctl <- = 1;
+ } else {
+ clkstopped = 1;
+ continue;
+ }
+ }
+ curtick++;
+ npend := 0;
+ for (i := 0; i < len timers; i++) {
+ rt := timers[i];
+ if (rt == nil)
+ continue;
+ if (rt.nexttick == big 0)
+ continue;
+ if (rt.nexttick > curtick) {
+ npend++;
+ continue;
+ }
+ # Timeout - arrange to send the tick
+ if (rt.rep) {
+ rt.nexttick = curtick + big rt.nticks;
+ npend++;
+ } else
+ rt.nexttick = big 0;
+ si := getsender();
+ s := senders[si];
+ s.tid = i;
+ s.idle = 0;
+ rt.sender = si;
+ s.ctl <- = rt.tick;
+
+ }
+ if (!npend)
+ stopclk = 1;
+ }
+}
+
+getsender() : int
+{
+ for (i := 0; i < len senders; i++) {
+ s := senders[i];
+ if (s == nil || s.idle == 1)
+ break;
+ }
+ if (i == len senders) {
+ newsenders := array [len senders * 2] of ref Sender;
+ newsenders[0:] = senders;
+ senders = newsenders;
+ }
+ if (senders[i] == nil) {
+ s := ref Sender (-1, 1, chan of chan of int);
+ spawn sender(s);
+ senders[i] = s;
+ }
+ return i;
+}
+
+sender(me : ref Sender)
+{
+ for (;;) {
+ tickch := <- me.ctl;
+ tickch <- = 1;
+ me.idle = 1;
+ }
+}
+
+ticker(ms : int, start, tick : chan of int)
+{
+ for (;;) {
+ <- start;
+ while (!stopclk) {
+ sys->sleep(ms);
+ tick <- = 1;
+ }
+ tick <- = 0;
+ }
+}
diff --git a/appl/demo/lego/timers.dis b/appl/demo/lego/timers.dis
new file mode 100644
index 00000000..f5b2613e
--- /dev/null
+++ b/appl/demo/lego/timers.dis
Binary files differ
diff --git a/appl/demo/lego/timers.m b/appl/demo/lego/timers.m
new file mode 100644
index 00000000..55c97b5f
--- /dev/null
+++ b/appl/demo/lego/timers.m
@@ -0,0 +1,15 @@
+Timers : module{
+ Timer : adt {
+ id : int;
+ tick : chan of int;
+
+ reset : fn (t : self ref Timer);
+ cancel : fn (t : self ref Timer);
+ destroy : fn (t : self ref Timer);
+ };
+
+ init : fn (res : int);
+ new : fn(ms, rep : int) : ref Timer;
+};
+
+
diff --git a/appl/demo/lego/timers.sbl b/appl/demo/lego/timers.sbl
new file mode 100644
index 00000000..59751a86
--- /dev/null
+++ b/appl/demo/lego/timers.sbl
@@ -0,0 +1,441 @@
+limbo .sbl 2.1
+Timers
+3
+timers.b
+sys.m
+timers.m
+269
+35.1,25 0
+36.1,22 1
+37.1,14 2
+38.1,13 3
+1,13 3
+39.0,1 4
+43.1,15 5
+44.1,21 6
+13,15 6
+17,20 6
+1,21 6
+1,21 6
+45.1,11 7
+46.8,9 8
+1,9 8
+51.1,15 9
+52.1,14 10
+12,13 10
+1,14 10
+53.1,11 11
+54.0,1 12
+58.1,15 13
+59.1,12 14
+10,11 14
+1,12 14
+60.1,11 15
+61.0,1 16
+65.1,15 17
+66.1,13 18
+11,12 18
+1,13 18
+67.1,11 19
+68.0,1 20
+74.5,13 21
+25,35 21
+17,21 21
+17,35 21
+75.9,12 22
+2,12 22
+76.5,17 23
+5,24 23
+77.9,12 24
+2,12 24
+78.5,17 25
+5,17 25
+5,24 25
+5,24 26
+79.9,12 27
+2,12 27
+80.8,20 28
+8,20 28
+1,20 28
+88.1,19 29
+17,18 29
+1,19 29
+1,19 29
+89.5,14 30
+90.2,8 31
+91.1,22 32
+13,15 32
+17,21 32
+1,22 32
+92.1,13 33
+1,19 33
+93.0,1 34
+99.1,19 35
+17,18 35
+1,19 35
+1,19 35
+100.5,14 36
+101.2,8 37
+102.1,22 38
+13,15 38
+17,21 38
+1,22 38
+103.25,40 39
+1,40 39
+104.1,13 40
+105.0,1 41
+111.1,19 42
+17,18 42
+1,19 42
+1,19 42
+112.5,14 43
+113.2,8 44
+114.1,22 45
+13,15 45
+17,21 45
+1,22 45
+115.1,20 46
+116.0,1 47
+123.5,20 48
+124.12,30 49
+2,30 49
+125.2,16 50
+126.6,23 51
+28,39 51
+129.7,14 52
+7,14 52
+128.3,9 52
+3,9 52
+3,9 52
+3,9 52
+3,9 52
+3,9 52
+3,9 53
+136.0,1 54
+142.6,12 55
+18,28 56
+14,28 56
+143.6,15 57
+6,22 57
+144.3,8 58
+142.30,33 59
+30,33 59
+145.10,20 60
+5,20 60
+147.22,32 61
+22,36 61
+2,54 61
+148.2,24 62
+149.2,20 63
+2,20 64
+151.1,20 65
+152.1,24 66
+16,17 66
+19,23 66
+1,24 66
+1,24 67
+153.1,23 68
+154.5,16 69
+155.2,12 70
+156.1,53 71
+21,22 71
+24,30 71
+32,35 71
+37,42 71
+44,48 71
+50,52 71
+1,53 71
+1,53 72
+157.1,10 73
+1,15 73
+158.8,9 74
+1,9 74
+166.1,23 75
+167.1,22 76
+168.1,16 77
+169.1,39 78
+14,21 78
+23,29 78
+31,38 78
+1,39 78
+172.4,11 79
+4,11 79
+182.9,16 79
+9,16 79
+171.10,16 79
+10,16 79
+10,16 79
+10,16 79
+174.2,16 80
+176.6,16 81
+20,28 81
+177.3,17 82
+178.3,15 83
+179.3,16 84
+3,16 79
+183.6,12 85
+184.3,14 86
+185.7,15 87
+186.4,16 88
+187.4,17 89
+4,17 90
+189.4,18 91
+190.4,12 92
+193.2,11 93
+194.2,12 94
+195.7,13 95
+19,29 96
+15,29 96
+196.9,18 97
+3,18 97
+197.7,16 98
+7,16 99
+7,16 100
+198.4,12 101
+199.7,27 102
+7,27 103
+7,27 104
+200.4,12 105
+201.7,28 106
+202.4,11 107
+4,11 108
+4,11 109
+203.4,12 110
+206.7,13 111
+207.28,41 112
+4,41 112
+208.4,11 113
+4,11 114
+210.4,23 115
+211.3,20 116
+3,20 116
+3,20 116
+212.8,19 117
+3,19 117
+213.3,12 118
+214.3,13 119
+215.3,17 120
+216.3,21 121
+3,21 122
+3,21 123
+195.31,34 124
+31,34 124
+219.7,12 125
+220.3,14 126
+3,14 79
+226.6,12 127
+18,29 128
+14,29 128
+227.7,17 129
+2,17 129
+228.6,14 130
+18,29 130
+18,29 131
+229.3,8 132
+3,8 133
+226.31,34 134
+31,34 134
+231.10,21 135
+5,21 135
+232.23,34 136
+23,38 136
+2,53 136
+233.2,26 137
+234.2,22 138
+2,22 139
+236.5,15 140
+5,22 140
+237.2,46 141
+19,21 141
+23,24 141
+26,45 141
+2,46 141
+2,46 142
+238.2,17 143
+15,16 143
+2,17 143
+239.2,12 144
+2,16 144
+2,16 145
+241.8,9 146
+1,9 146
+247.2,21 147
+248.2,15 148
+249.2,13 149
+2,13 150
+2,13 150
+256.2,10 151
+257.10,17 152
+258.3,17 153
+14,16 153
+3,17 153
+3,17 153
+259.3,14 154
+3,14 154
+261.2,13 155
+2,13 155
+5
+aSys->Dir 1:26.1,39.2 64
+11
+0:name:28.2,6 s
+4:uid:29.2,5 s
+8:gid:30.2,5 s
+12:muid:31.2,6 s
+16:qid:32.2,5 @1
+
+32:mode:33.2,6 i
+36:atime:34.2,7 i
+40:mtime:35.2,7 i
+48:length:36.2,8 B
+56:dtype:37.2,7 i
+60:dev:38.2,5 i
+aSys->Qid 11.1,16.2 16
+3
+0:path:13.2,6 B
+8:vers:14.2,6 i
+12:qtype:15.2,7 i
+aRealTimer 0:11.0,18.1 32
+6
+0:t:12.1,2 R@3
+
+4:nticks:13.1,7 i
+8:rep:14.1,4 i
+16:nexttick:15.1,9 B
+24:tick:16.1,5 Ci
+28:sender:17.1,7 i
+aTimer 2:2.1,9.2 8
+2
+0:id:3.2,4 i
+4:tick:4.2,6 Ci
+aSender 0:20.0,24.1 12
+3
+0:tid:21.1,4 i
+4:idle:22.1,5 i
+8:ctl:23.1,4 CCi
+15
+0:init
+1
+32:res:33.5,8 i
+0
+n6:new
+2
+32:ms:41.4,6 i
+36:rep:8,11 i
+1
+40:t:44.1,2 R@3
+
+R@3
+15:Timer.destroy
+1
+32:t:49.14,15 R@3
+
+0
+n21:Timer.reset
+1
+32:t:56.12,13 R@3
+
+0
+n27:Timer.cancel
+1
+32:t:63.13,14 R@3
+
+0
+n33:realtimer
+1
+32:t:72.10,11 R@3
+
+0
+R@2
+52:do_destroy
+1
+32:t:86.11,12 R@3
+
+1
+36:rt:88.1,3 R@2
+
+n65:do_reset
+1
+32:t:97.9,10 R@3
+
+1
+36:rt:99.1,3 R@2
+
+n79:do_cancel
+1
+32:t:109.10,11 R@3
+
+1
+36:rt:111.1,3 R@2
+
+n91:clearsender
+2
+32:rt:120.12,14 R@2
+
+36:tid:32,35 i
+1
+40:sender:124.2,8 R@4
+
+n107:do_new
+2
+32:ms:139.7,9 i
+36:rep:11,14 i
+6
+40:i:142.6,7 i
+44:nticks:153.1,7 i
+48:newtimers:147.2,11 AR@2
+
+52:t:152.1,2 R@3
+
+56:tick:151.1,5 Ci
+60:rt:156.1,3 R@2
+
+R@3
+145:main
+0
+9
+32:rt:196.3,5 R@2
+
+36:i:195.7,8 i
+40:clkctl:167.1,7 Ci
+44:clkstopped:168.1,11 i
+48:npend:194.2,7 i
+52:s:212.3,4 R@4
+
+56:clktick:166.1,8 Ci
+60:si:211.3,5 i
+64:t:182.1,2 i
+n218:getsender
+0
+4
+32:i:226.6,7 i
+36:newsenders:232.2,12 AR@4
+
+40:s:227.2,3 R@4
+
+44:s:237.2,3 R@4
+
+i254:sender
+1
+32:me:244.7,9 R@4
+
+1
+36:tickch:247.2,8 Ci
+n259:ticker
+3
+32:ms:253.7,9 i
+36:start:17,22 Ci
+40:tick:24,28 Ci
+0
+n8
+48:acquire:27.0,7 Ci
+56:curtick:30.0,7 B
+68:senders:29.0,7 AR@4
+
+72:startclk:161.0,8 i
+76:stopclk:162.0,7 i
+80:sys:26.0,3 mSys
+1:4.0,160.1 0
+
+84:tickres:0:31.0,7 i
+88:timers:28.0,6 AR@2
+
diff --git a/appl/demo/mkfile b/appl/demo/mkfile
new file mode 100644
index 00000000..dfd15746
--- /dev/null
+++ b/appl/demo/mkfile
@@ -0,0 +1,14 @@
+<../../mkconfig
+
+DIRS=\
+ camera\
+ chat\
+ cpupool\
+ lego\
+ ns\
+ odbc\
+ spree\
+ whiteboard\
+
+
+<$ROOT/mkfiles/mksubdirs
diff --git a/appl/demo/ns/mkfile b/appl/demo/ns/mkfile
new file mode 100644
index 00000000..c701e498
--- /dev/null
+++ b/appl/demo/ns/mkfile
@@ -0,0 +1,27 @@
+<../../../mkconfig
+
+TARG=\
+ ns.dis\
+
+SHTARG=\
+ runns.sh\
+
+MODULES=\
+
+SYSMODULES= \
+ arg.m\
+ draw.m\
+ sh.m\
+ sys.m\
+
+DISBIN=$ROOT/dis/demo/ns
+
+<$ROOT/mkfiles/mkdis
+
+SHFILES=${SHTARG:%.sh=$DISBIN/%}
+install:V: $SHFILES
+%.install:V: $DISBIN/%
+%.installall:V: $DISBIN/%
+
+$DISBIN/%: %.sh
+ cp $stem.sh $target && chmod a+rx $target
diff --git a/appl/demo/ns/ns.b b/appl/demo/ns/ns.b
new file mode 100644
index 00000000..266a07ff
--- /dev/null
+++ b/appl/demo/ns/ns.b
@@ -0,0 +1,124 @@
+implement Ns;
+
+#
+# Copyright © 2003 Vita Nuova Holdings Limited. All rights reserved.
+#
+
+include "sys.m";
+ sys: Sys;
+include "draw.m";
+include "arg.m";
+include "sh.m";
+ sh: Sh;
+
+ns : list of string;
+
+Ns: module {
+ init: fn(nil: ref Draw->Context, argv: list of string);
+};
+
+init(nil: ref Draw->Context, argv: list of string)
+{
+ sys = load Sys Sys->PATH;
+ if (sys == nil)
+ badmod(Sys->PATH);
+ sh = load Sh Sh->PATH;
+ if (sh == nil)
+ badmod(Sh->PATH);
+ # sys->pctl(sys->FORKNS, nil);
+ sys->unmount(nil, "/n/remote");
+ arg := load Arg Arg->PATH;
+ if (arg == nil)
+ badmod(Arg->PATH);
+
+ arg->init(argv);
+ arg->setusage("ns [-v] [-r relpath] paths...");
+ verbose := 0;
+ relpath := "";
+ while ((opt := arg->opt()) != 0) {
+ case opt {
+ 'v' =>
+ verbose = 1;
+ 'r' =>
+ relpath = arg->earg();
+ if (relpath == nil)
+ arg->usage();
+ if (relpath[len relpath - 1] != '/')
+ relpath[len relpath] = '/';
+ * =>
+ arg->usage();
+ }
+ }
+
+ ns = arg->argv();
+ arg = nil;
+ if (ns == nil) {
+ sys->fprint(fdout(), "error no namespace selected\n");
+ exit;
+ }
+ spawn buildns(relpath, verbose);
+}
+
+fdout(): ref sys->FD
+{
+ return sys->fildes(1);
+}
+
+buildns(relpath: string, verbose: int)
+{
+ # sys->pctl(sys->FORKNS, nil);
+ if (sh->run(nil, "memfs"::"/n/remote"::nil) != nil) {
+ sys->fprint(fdout(), "error MemFS mount failed\n");
+ exit;
+ }
+ for (tmpl := ns; tmpl != nil; tmpl = tl tmpl) {
+ nspath := hd tmpl;
+ if (nspath[len nspath - 1] != '/')
+ nspath[len nspath] = '/';
+
+ bindpath := nspath;
+ if (bindpath[:len relpath] == relpath) {
+ bindpath = "/n/remote/"+bindpath[len relpath:];
+ if (createdir(bindpath) != -1) {
+ if (sys->bind(nspath, bindpath, sys->MBEFORE | sys->MCREATE) == -1) {
+ if (sys->bind(nspath, bindpath, sys->MBEFORE) == -1)
+ sys->fprint(fdout(), "error bind failed %s: %r\n",bindpath);
+ else if (verbose)
+ sys->fprint(fdout(), "data nspath %s\n", nspath);
+ }
+ else if (verbose)
+ sys->fprint(fdout(), "data nspath %s\n", nspath);
+ }
+ else
+ sys->fprint(fdout(), "error create failed %s\n",bindpath);
+ }
+ }
+ spawn exportns();
+}
+
+exportns()
+{
+ sys->export(sys->fildes(0), "/n/remote", sys->EXPWAIT);
+}
+
+createdir(path: string): int
+{
+ (nil, lst) := sys->tokenize(path, "/");
+ npath := "";
+ for (; lst != nil; lst = tl lst) {
+ (n, nil) := sys->stat(npath + "/" + hd lst);
+ if (n == -1) {
+ fd := sys->create(npath + "/" + hd lst, sys->OREAD, 8r777 | sys->DMDIR);
+ if (fd == nil)
+ return -1;
+ }
+ npath += "/" + hd lst;
+ }
+ return 0;
+}
+
+badmod(path: string)
+{
+ sys->fprint(fdout(), "error Ns: failed to load: %s\n",path);
+ exit;
+}
diff --git a/appl/demo/ns/ns.dis b/appl/demo/ns/ns.dis
new file mode 100644
index 00000000..48a9a1f5
--- /dev/null
+++ b/appl/demo/ns/ns.dis
Binary files differ
diff --git a/appl/demo/ns/ns.sbl b/appl/demo/ns/ns.sbl
new file mode 100644
index 00000000..52233184
--- /dev/null
+++ b/appl/demo/ns/ns.sbl
@@ -0,0 +1,420 @@
+limbo .sbl 2.1
+Ns
+5
+ns.b
+sys.m
+draw.m
+arg.m
+sh.m
+263
+22.1,25 0
+23.5,15 1
+24.2,19 2
+9,18 2
+2,19 2
+25.1,22 3
+26.5,14 4
+27.2,18 5
+9,17 5
+2,18 5
+29.1,31 6
+14,17 6
+19,30 6
+1,31 6
+1,31 6
+30.1,26 7
+31.5,15 8
+32.2,19 9
+9,18 9
+2,19 9
+34.1,16 10
+11,15 10
+1,16 10
+35.1,47 11
+15,46 11
+1,47 11
+36.1,13 12
+37.1,14 13
+38.8,27 14
+8,27 14
+8,27 14
+8,27 14
+8,32 14
+39.7,10 15
+7,10 15
+7,10 15
+7,10 15
+41.3,14 16
+3,14 15
+43.3,24 17
+3,24 17
+3,24 17
+44.7,21 18
+45.4,16 19
+4,16 19
+46.15,26 20
+15,30 20
+7,31 20
+7,38 20
+47.12,23 21
+4,30 21
+4,30 15
+49.3,15 22
+3,15 22
+3,15 15
+53.1,17 23
+1,17 23
+1,17 23
+54.1,10 24
+55.5,14 25
+56.14,21 26
+14,21 26
+14,21 26
+14,21 26
+2,55 26
+2,55 26
+2,55 27
+23,54 26
+2,55 26
+2,55 26
+57.2,6 28
+59.1,32 29
+15,22 29
+24,31 29
+1,32 29
+60.0,1 30
+70.5,44 31
+13,16 31
+40,43 31
+27,43 31
+18,43 31
+18,43 31
+18,43 32
+5,44 31
+5,44 31
+5,51 31
+5,51 33
+71.14,21 34
+14,21 34
+14,21 34
+14,21 34
+2,52 34
+2,52 34
+2,52 35
+23,51 34
+2,52 34
+2,52 34
+72.2,6 36
+74.6,16 37
+18,29 38
+75.2,19 39
+76.13,23 40
+13,27 40
+6,28 40
+6,35 40
+77.10,20 41
+3,27 41
+79.2,20 42
+80.16,27 43
+6,14 43
+6,28 43
+6,39 43
+6,39 44
+81.27,49 45
+36,47 45
+27,35 45
+27,49 45
+3,49 45
+3,49 46
+82.7,26 47
+17,25 47
+7,26 47
+7,26 47
+7,32 47
+83.8,64 48
+18,24 48
+26,34 48
+36,63 48
+8,64 48
+8,64 48
+8,70 48
+84.9,50 49
+19,25 49
+27,35 49
+37,49 49
+9,50 49
+9,50 49
+9,56 49
+85.18,25 50
+18,25 50
+18,25 50
+18,25 50
+6,65 50
+6,65 50
+6,65 51
+27,55 50
+56,64 50
+6,65 50
+6,65 50
+6,65 52
+86.14,21 53
+87.18,25 54
+18,25 54
+18,25 54
+18,25 54
+6,54 54
+6,54 54
+6,54 55
+27,45 54
+47,53 54
+6,54 54
+6,54 54
+6,54 56
+89.13,20 57
+90.17,24 58
+17,24 58
+17,24 58
+17,24 58
+5,53 58
+5,53 58
+5,53 59
+26,44 58
+46,52 58
+5,53 58
+5,53 58
+5,53 60
+93.16,23 61
+16,23 61
+16,23 61
+16,23 61
+4,61 61
+4,61 61
+4,61 62
+25,51 61
+52,60 61
+4,61 61
+4,61 61
+4,61 63
+4,61 64
+74.31,45 65
+31,45 65
+96.1,17 66
+1,17 66
+97.0,1 67
+101.13,27 68
+25,26 68
+13,27 68
+13,27 68
+1,55 68
+1,55 68
+1,55 69
+29,40 68
+42,54 68
+1,55 68
+1,55 68
+102.0,1 70
+106.15,39 71
+29,33 71
+35,38 71
+15,39 71
+15,39 71
+7,10 71
+7,10 72
+107.1,12 73
+108.8,18 74
+109.14,45 75
+24,35 75
+38,44 75
+24,44 75
+24,44 76
+24,44 77
+14,45 75
+14,45 75
+3,4 75
+3,4 78
+3,4 79
+3,4 80
+3,4 81
+110.6,13 82
+111.3,74 83
+21,32 83
+35,41 83
+21,41 83
+21,41 84
+21,41 85
+43,53 83
+55,73 83
+3,74 83
+3,74 83
+112.7,16 86
+113.11,13 87
+4,13 87
+4,13 88
+115.17,23 89
+11,23 89
+2,23 89
+2,23 90
+108.20,32 91
+20,32 91
+117.8,9 92
+1,9 92
+122.13,20 93
+13,20 93
+13,20 93
+13,20 93
+1,60 93
+1,60 93
+1,60 94
+22,54 93
+55,59 93
+1,60 93
+1,60 93
+123.1,5 95
+12
+aSys->Dir 1:26.1,39.2 64
+11
+0:name:28.2,6 s
+4:uid:29.2,5 s
+8:gid:30.2,5 s
+12:muid:31.2,6 s
+16:qid:32.2,5 @1
+
+32:mode:33.2,6 i
+36:atime:34.2,7 i
+40:mtime:35.2,7 i
+48:length:36.2,8 B
+56:dtype:37.2,7 i
+60:dev:38.2,5 i
+aSys->Qid 11.1,16.2 16
+3
+0:path:13.2,6 B
+8:vers:14.2,6 i
+12:qtype:15.2,7 i
+aDraw->Chans 2:70.1,82.2 4
+1
+0:desc:72.2,6 i
+aDraw->Context 274.1,279.2 12
+3
+0:display:276.2,9 R@4
+
+4:screen:277.2,8 R@8
+
+8:wm:278.2,4 Ct8.2
+0:t0:15,21 s
+4:t1:15,21 Ct8.2
+0:t0:32,38 s
+4:t1:32,38 R@9
+
+
+
+aDraw->Display 201.1,230.2 20
+5
+0:image:203.2,7 R@5
+
+4:white:204.2,7 R@5
+
+8:black:205.2,7 R@5
+
+12:opaque:206.2,8 R@5
+
+16:transparent:207.2,13 R@5
+
+aDraw->Image 142.1,198.2 56
+8
+0:r:146.2,3 @6
+
+16:clipr:147.2,7 @6
+
+32:depth:148.2,7 i
+36:chans:149.2,7 @2
+
+40:repl:150.2,6 i
+44:display:151.2,9 R@4
+
+48:screen:152.2,8 R@8
+
+52:iname:153.2,7 s
+aDraw->Rect 116.1,139.2 16
+2
+0:min:118.2,5 @7
+
+8:max:119.2,5 @7
+
+aDraw->Point 99.1,113.2 8
+2
+0:x:101.2,3 i
+4:y:102.2,3 i
+aDraw->Screen 249.1,263.2 16
+4
+0:id:251.2,4 i
+4:image:252.2,7 R@5
+
+8:fill:253.2,6 R@5
+
+12:display:254.2,9 R@4
+
+aDraw->Wmcontext 282.1,291.2 28
+7
+0:kbd:284.2,5 Ci
+4:ptr:285.2,5 CR@10
+
+8:ctl:286.2,5 Cs
+12:wctl:287.2,6 Cs
+16:images:288.2,8 CR@5
+
+20:connfd:289.2,8 R@11
+
+24:ctxt:290.2,6 R@3
+
+aDraw->Pointer 266.1,271.2 16
+3
+0:buttons:268.2,9 i
+4:xy:269.2,4 @7
+
+12:msec:270.2,6 i
+aSys->FD 1:45.1,48.2 4
+1
+0:fd:47.2,4 i
+5
+0:init
+1
+36:argv:0:20.29,33 Ls
+4
+40:arg:30.1,4 mArg
+3:1.0,14.1 0
+
+44:relpath:0:37.1,8 s
+48:verbose:36.1,8 i
+52:opt:38.9,12 i
+n76:buildns
+2
+32:relpath:67.8,15 s
+36:verbose:25,32 i
+3
+40:nspath:75.2,8 s
+44:bindpath:79.2,10 s
+48:tmpl:74.6,10 Ls
+n194:exportns
+0
+0
+n206:createdir
+1
+32:path:104.10,14 s
+4
+36:lst:106.7,10 Ls
+40:npath:107.1,6 s
+44:fd:111.3,5 R@11
+
+48:n:109.3,4 i
+i251:badmod
+1
+32:path:120.7,11 s
+0
+n3
+88:ns:14.0,2 Ls
+96:sh:12.1,3 mSh
+4:8.0,95.1 0
+
+100:sys:0:8.1,4 mSys
+1:4.0,160.1 0
+
diff --git a/appl/demo/ns/runns.sh b/appl/demo/ns/runns.sh
new file mode 100755
index 00000000..6394c468
--- /dev/null
+++ b/appl/demo/ns/runns.sh
@@ -0,0 +1,7 @@
+#!/dis/sh
+load std
+if {~ $#* 0} {
+ echo usage: runns path0 path1 ... pathn
+ raise usage
+}
+grid/register -a resource Namespace 'grid/srv/ns '^$"* | grid/srv/monitor 1 'Namespace'
diff --git a/appl/demo/odbc/mkfile b/appl/demo/odbc/mkfile
new file mode 100644
index 00000000..f883c58e
--- /dev/null
+++ b/appl/demo/odbc/mkfile
@@ -0,0 +1,31 @@
+<../../../mkconfig
+
+TARG=\
+ odbcmnt.dis\
+
+SHTARG=\
+ runodbc.sh\
+
+MODULES=\
+
+SYSMODULES= \
+ arg.m\
+ convcs.m\
+ daytime.m\
+ draw.m\
+ string.m\
+ styx.m\
+ styxservers.m\
+ sys.m\
+
+DISBIN=$ROOT/dis/demo/odbc
+
+<$ROOT/mkfiles/mkdis
+
+SHFILES=${SHTARG:%.sh=$DISBIN/%}
+install:V: $SHFILES
+%.install:V: $DISBIN/%
+%.installall:V: $DISBIN/%
+
+$DISBIN/%: %.sh
+ cp $stem.sh $target && chmod a+rx $target
diff --git a/appl/demo/odbc/odbcmnt.b b/appl/demo/odbc/odbcmnt.b
new file mode 100644
index 00000000..3cadc55f
--- /dev/null
+++ b/appl/demo/odbc/odbcmnt.b
@@ -0,0 +1,428 @@
+implement Odbcmnt;
+
+#
+# Copyright © 2003 Vita Nuova Holdings Limited. All rights reserved.
+#
+
+include "sys.m";
+ sys: Sys;
+ stderr: ref Sys->FD;
+include "draw.m";
+include "arg.m";
+include "string.m";
+ str: String;
+include "daytime.m";
+ daytime: Daytime;
+include "convcs.m";
+ convcs : Convcs;
+include "styx.m";
+ styx: Styx;
+ Tmsg, Rmsg: import styx;
+include "styxservers.m";
+ styxservers: Styxservers;
+ Styxserver, Navigator: import styxservers;
+ nametree: Nametree;
+ Tree: import nametree;
+
+Column: adt {
+ name: string;
+ ctype: string;
+ size: int;
+};
+
+Qroot: con iota;
+WINCHARSET := "windows-1252"; # BUG: odbc.c should do the conversion!
+
+Odbcmnt: module
+{
+ init: fn(ctxt: ref Draw->Context, argv: list of string);
+};
+
+init(nil: ref Draw->Context, argv: list of string)
+{
+ sys = load Sys Sys->PATH;
+ stderr = sys->fildes(2);
+
+ arg := load Arg Arg->PATH;
+ if(arg == nil)
+ notloaded(Arg->PATH);
+ daytime = load Daytime Daytime->PATH;
+ if (daytime == nil)
+ notloaded(Daytime->PATH);
+ str = load String String->PATH;
+ if(str == nil)
+ notloaded(String->PATH);
+ convcs = load Convcs Convcs->PATH;
+ if(convcs == nil)
+ notloaded(Convcs->PATH);
+ cserr := convcs->init(nil);
+ if (cserr != nil)
+ err("convcs init failed " + cserr);
+ styx = load Styx Styx->PATH;
+ if(styx == nil)
+ notloaded(Styx->PATH);
+ styx->init();
+ styxservers = load Styxservers Styxservers->PATH;
+ if(styxservers == nil)
+ notloaded(Styxservers->PATH);
+ styxservers->init(styx);
+ nametree = load Nametree Nametree->PATH;
+ if(nametree == nil)
+ notloaded(Nametree->PATH);
+ nametree->init();
+ addr := "127.0.0.1";
+ arg->init(argv);
+ stype := "ODBC";
+ while((o := arg->opt()) != 0)
+ case o {
+ 'a' =>
+ addr = arg->earg();
+ * =>
+ usage();
+ }
+
+ argv = arg->argv();
+ arg = nil;
+ sys->pctl(Sys->FORKNS | sys->NEWPGRP, nil);
+ dbdir := do_mount(netmkaddr(addr, "tcp", "6700"));
+ (cfd, cdir) := do_clone(dbdir);
+ sources := find_sources(cdir);
+ sys->print("Found %d sources\n", len sources);
+ spawn serveloop(dbdir, sources, sys->fildes(0));
+}
+
+netmkaddr(addr, net, svc: string): string
+{
+ if(net == nil)
+ net = "net";
+ (n, l) := sys->tokenize(addr, "!");
+ if(n <= 1){
+ if(svc== nil)
+ return sys->sprint("%s!%s", net, addr);
+ return sys->sprint("%s!%s!%s", net, addr, svc);
+ }
+ if(svc == nil || n > 2)
+ return addr;
+ return sys->sprint("%s!%s", addr, svc);
+}
+
+split1(s, delim: string): (string, string)
+{
+ (l, r) := str->splitl(s, delim);
+ return (l, str->drop(r, delim));
+}
+
+notloaded(s: string)
+{
+ err(sys->sprint("failed to load %s: %r", s));
+}
+
+usage()
+{
+ sys->fprint(stderr, "Usage: odbcmnt [ -a address ]\n");
+ raise "fail:usage";
+}
+
+do_mount(addr: string): string
+{
+ (ok, c) := sys->dial(addr, nil);
+ remdir := "/n/remote";
+ if (ok < 0)
+ err(sys->sprint("failed to dial odbc server on %s: %r", addr));
+ if (sys->mount(c.dfd, nil, remdir, 0, nil) < 0)
+ err(sys->sprint("failed to mount odbc server on %s: %r", addr));
+ dbdir := remdir + "/db";
+ return dbdir;
+}
+
+
+do_clone(dbdir: string): (ref Sys->FD, string)
+{
+ newfile := dbdir + "/new";
+ cfd := sys->open(newfile, Sys->OREAD);
+ if (cfd == nil)
+ err(sys->sprint("failed to open %s: %r", newfile));
+ cname := read_fd(cfd);
+ if (cname == nil)
+ err("failed to find clone directory name");
+ return(cfd, dbdir + "/" + cname);
+}
+
+dir(name: string, perm: int, length: int, qid: int): Sys->Dir
+{
+ uid := read_file("/dev/user");
+ d := sys->zerodir;
+ d.name = name;
+ d.uid = uid;
+ d.gid = uid;
+ d.qid.path = big qid;
+ if (perm & Sys->DMDIR)
+ d.qid.qtype = Sys->QTDIR;
+ else {
+ d.qid.qtype = Sys->QTFILE;
+ d.length = big length;
+ }
+ d.mode = perm;
+ d.atime = d.mtime = daytime->now();
+ return d;
+}
+
+newconv(dbdir, source: string): (ref Sys->FD, ref Sys->FD, ref Sys->FD, ref Sys->FD, string)
+{
+ err := "";
+ (clonefd, cdir) := do_clone(dbdir);
+ ctlf := cdir + "/ctl";
+ ctlfd := sys->open(ctlf, Sys->ORDWR);
+ if (ctlfd == nil)
+ err = sys->sprint("Failed to open %s: %r", ctlf);
+ cmdf := cdir + "/cmd";
+ cmdfd := sys->open(cmdf, Sys->ORDWR);
+ if (cmdfd == nil)
+ err = sys->sprint("Failed to open %s: %r", cmdf);
+ dataf := cdir + "/data";
+ datafd := sys->open(dataf, Sys->ORDWR);
+ if (datafd == nil)
+ err = sys->sprint("Failed to open %s: %r", dataf);
+ if (write_fd(ctlfd, "connect " + source) < 0)
+ err = sys->sprint("failed to connect to %s: %r", source);
+ return (clonefd, ctlfd, cmdfd, datafd, err);
+}
+
+SRCDIR: con 1;
+SQL: con 2;
+TABLE: con 3;
+TABLEDIR: con 4;
+COLUMN: con 5;
+
+gettype(fid: big): int
+{
+ return int fid & 7;
+}
+
+SrcFD: adt {
+ clonefd, ctlfd, cmdfd, datafd: ref sys->FD;
+};
+
+serveloop(dbdir: string, sources: list of string, confd: ref sys->FD)
+{
+ srcqid := 0;
+ sqlqid := 0;
+ tableqid := 0;
+ colqid := 0;
+ tabledirqid := 0;
+ (bs, cserr) := convcs->getbtos(WINCHARSET);
+ if (bs == nil)
+ err("getbtos error: " + cserr);
+ (tree, treeop) := nametree->start();
+ tree.create(big Qroot, dir(".",8r555 | sys->DMDIR,0,Qroot));
+ contents: list of string;
+ srcfds := array[len sources] of SrcFD;
+ i := 0;
+ for (sl := sources; sl!=nil; sl=tl sl) {
+ (srcname, srcdriver) := split1(hd sl, ":");
+ # Don't do anything with 'srvdriver' - could make a driver
+ # file to read - but does anyone care about it?
+ (clonefd, ctlfd, cmdfd, datafd, e) := newconv(dbdir, srcname);
+ if (e != nil)
+ sys->fprint(sys->fildes(2), "Odbcmnt: %s\n",e);
+ else {
+ srcfds[i] = (clonefd, ctlfd, cmdfd, datafd);
+ sys->print("%s\n",srcname);
+ Qsrc := SRCDIR + (srcqid++<<3);
+ tree.create(big Qroot, dir(srcname,8r555 | sys->DMDIR,0,Qsrc));
+ Qtabledir := TABLEDIR + (tabledirqid++<<3);
+ tree.create(big Qsrc, dir("tables",8r555 | sys->DMDIR,0,Qtabledir));
+ Qsql := SQL + (sqlqid++<<3);
+ tree.create(big Qsrc, dir("sql",8r666,0, Qsql));
+
+ tables := find_tables(srcfds[i].cmdfd, srcfds[i].datafd);
+ if (tables == nil)
+ err(sys->sprint("failed to find tables: %r"));
+ if (write_fd(srcfds[i].ctlfd, "headings") < 0)
+ err(sys->sprint("failed to write to ctl file: %r"));
+ sys->print("\tBuilding tree...");
+ for (tlist:=tables; tlist!=nil; tlist=tl tlist) {
+ table := hd tlist;
+ Qtable := TABLE + (tableqid++<<3);
+ tree.create(big Qtabledir, dir(table,8r555 | sys->DMDIR,0,Qtable));
+ columns := find_columns(srcfds[i].cmdfd, srcfds[i].datafd, table);
+ for (clist:=columns; clist!=nil; clist=tl clist) {
+ column := hd clist;
+ Qcol := COLUMN + (colqid<<3);
+ tree.create(big Qtable, dir(column.name,8r555,0,Qcol));
+ data := sys->sprint("%s %d\n", column.ctype, column.size);
+ contents = data :: contents;
+ colqid++;
+ }
+ }
+ sys->print("done\n");
+ }
+ i++;
+ }
+ colcontent := array[colqid] of string;
+ for (i = colqid - 1; i >= 0; i--) {
+ colcontent[i] = hd contents;
+ contents = tl contents;
+ }
+ (tchan, srv) := Styxserver.new(confd, Navigator.new(treeop), big Qroot);
+ sys->pctl(Sys->FORKNS|Sys->FORKFD, nil);
+ gm: ref Tmsg;
+ buf := array[Sys->ATOMICIO] of byte;
+ serverloop: for (;;) {
+ gm = <-tchan;
+ if (gm == nil)
+ break serverloop;
+ pick m := gm {
+ Readerror =>
+ sys->fprint(sys->fildes(2), "odbcmnt: fatal read error: %s\n", m.error);
+ break serverloop;
+ Read =>
+ c := srv.getfid(m.fid);
+ if(c.qtype & Sys->QTDIR){
+ srv.read(m); # does readdir
+ break;
+ }
+ case gettype(c.path) {
+ SQL =>
+ srcno := int c.path >> 3;
+ sys->seek(srcfds[srcno].datafd, m.offset, Sys->SEEKSTART);
+ n := sys->read(srcfds[srcno].datafd, buf, len buf);
+ if (n >= 0) {
+ (state, s, err) := bs->btos(nil, buf[:n], -1);
+ r := ref Rmsg.Read(gm.tag, array of byte s);
+ srv.reply(r);
+ } else
+ srv.reply(ref Rmsg.Error(gm.tag, sys->sprint("%r")));
+ break;
+ COLUMN =>
+ srv.reply(styxservers->readstr(m, colcontent[int c.path>>3]));
+ * =>
+ srv.default(gm);
+ }
+ Write =>
+ c := srv.getfid(m.fid);
+ case gettype(c.path) {
+ SQL =>
+ srcno := int c.path >> 3;
+ n := sys->write(srcfds[srcno].cmdfd, m.data, len m.data);
+ if (n == len m.data)
+ srv.reply(ref Rmsg.Write(m.tag, n));
+ else
+ srv.reply(ref Rmsg.Error(gm.tag, sys->sprint("%r")));
+ break;
+ * =>
+ srv.default(gm);
+ }
+
+ * =>
+ srv.default(gm);
+ }
+ }
+ tree.quit();
+}
+
+find_tables(cmdfd, datafd: ref Sys->FD): list of string
+{
+ tlist: list of string;
+ if (write_fd(cmdfd, "tables") < 0)
+ err(sys->sprint("failed to write to cmd file: %r"));
+ while((rec := read_fd(datafd)) != nil) {
+ fields := atokenize(rec, "|");
+ if (len fields < 4)
+ err("bad table name");
+ tname := fields[2];
+ tlist = tname :: tlist;
+ }
+ return tlist;
+}
+
+
+find_columns(cmdfd, datafd: ref Sys->FD, table: string): list of Column
+{
+ clist: list of Column;
+ if (write_fd(cmdfd, "columns " + table) < 0)
+ err(sys->sprint("failed to write to cmd file: %r"));
+ while((rec := read_fd(datafd)) != nil) {
+ fields := atokenize(rec, "|");
+ if (len fields < 3)
+ err("bad column name");
+ cname :=fields[3];
+ ctype := "";
+ if (len fields > 5)
+ ctype = fields[5];
+ csize := 0;
+ if (len fields > 6)
+ csize = int fields[6];
+ clist = (fields[3], ctype, csize) :: clist;
+ }
+ return clist;
+}
+
+atokenize(s: string, delim: string): array of string
+{
+ if (s == nil)
+ return nil;
+ dl := len delim;
+ r: list of string;
+ l: string;
+ for (;;) {
+ (l, s) = str->splitstrl(s, delim);
+ r = l :: r;
+ if (s == nil || s == delim)
+ break;
+ s = s[dl:];
+ }
+ a := array[len r] of string;
+ for (i:=len r-1; i>=0; i--) {
+ a[i] = hd r;
+ r = tl r;
+ }
+ return a;
+}
+
+find_sources(cdir: string): list of string
+{
+ sfile := cdir+"/sources";
+ fd := sys->open(sfile, Sys->OREAD);
+ if (fd == nil)
+ err(sys->sprint("failed to open %s: %r", sfile));
+ s := read_fd(fd);
+ (n, lines) := sys->tokenize(s, "\n");
+ return lines;
+}
+
+err(s: string)
+{
+ sys->fprint(stderr, "odbcgw: %s\n", s);
+ raise "fail:error";
+}
+
+read_fd(fd: ref Sys->FD): string
+{
+ MAX : con Sys->ATOMICIO;
+ buf := array[MAX] of byte;
+# sys->seek(fd, big 0, Sys->SEEKSTART);
+ size := sys->read(fd, buf, MAX);
+ if (size <= 0) {
+# if (size < 0)
+# sys->fprint(stderr, "read_fd error: %r\n");
+ return nil;
+ }
+ return string buf[0:size];
+}
+
+read_file(f: string): string
+{
+ fd := sys->open(f, Sys->OREAD);
+ if (fd == nil)
+ return nil;
+ return read_fd(fd);
+}
+
+write_fd(fd: ref Sys->FD, s: string): int
+{
+ a := array of byte s;
+ if (sys->write(fd, a, len a) != len a)
+ return -1;
+ return 0;
+} \ No newline at end of file
diff --git a/appl/demo/odbc/odbcmnt.dis b/appl/demo/odbc/odbcmnt.dis
new file mode 100644
index 00000000..dec2e403
--- /dev/null
+++ b/appl/demo/odbc/odbcmnt.dis
Binary files differ
diff --git a/appl/demo/odbc/odbcmnt.sbl b/appl/demo/odbc/odbcmnt.sbl
new file mode 100644
index 00000000..c85bb9d2
--- /dev/null
+++ b/appl/demo/odbc/odbcmnt.sbl
@@ -0,0 +1,1602 @@
+limbo .sbl 2.1
+Odbcmnt
+9
+odbcmnt.b
+sys.m
+draw.m
+arg.m
+string.m
+daytime.m
+convcs.m
+styx.m
+styxservers.m
+1010
+43.1,25 0
+44.1,24 1
+22,23 1
+1,24 1
+1,24 1
+46.1,26 2
+47.4,14 3
+48.2,22 4
+12,21 4
+2,22 4
+49.1,37 5
+50.5,19 6
+51.2,26 7
+12,25 7
+2,26 7
+52.1,31 8
+53.4,14 9
+54.2,25 10
+12,24 10
+2,25 10
+55.1,34 11
+56.4,17 12
+57.2,25 13
+12,24 13
+2,25 13
+58.1,27 14
+23,26 14
+1,27 14
+1,27 14
+59.5,17 15
+60.2,36 16
+6,35 16
+2,36 16
+61.1,28 17
+62.4,15 18
+63.2,23 19
+12,22 19
+2,23 19
+64.1,13 20
+1,13 20
+65.1,49 21
+66.4,22 22
+67.2,30 23
+12,29 23
+2,30 23
+68.1,24 24
+19,23 24
+1,24 24
+69.1,40 25
+70.4,19 26
+71.2,27 27
+12,26 27
+2,27 27
+72.1,17 28
+1,17 28
+73.1,20 29
+74.1,16 30
+11,15 30
+1,16 30
+75.1,16 31
+76.7,24 32
+7,24 32
+7,24 32
+7,24 32
+7,29 32
+77.7,8 33
+79.3,21 34
+3,21 34
+3,21 34
+3,21 33
+81.3,10 35
+3,10 35
+3,10 33
+84.1,19 36
+1,19 36
+1,19 36
+85.1,10 37
+86.1,43 38
+11,37 38
+39,42 38
+1,43 38
+1,43 38
+87.19,49 39
+29,33 39
+35,40 39
+42,48 39
+19,49 39
+19,49 39
+1,50 39
+1,50 39
+1,50 40
+1,50 39
+1,50 39
+88.16,31 41
+25,30 41
+16,31 41
+16,31 41
+89.1,30 42
+25,29 42
+1,30 42
+1,30 42
+90.1,46 43
+12,32 43
+34,45 43
+1,46 43
+1,46 43
+91.33,47 44
+45,46 44
+33,47 44
+33,47 44
+1,48 44
+17,22 44
+24,31 44
+24,31 44
+24,31 45
+1,48 44
+92.0,1 46
+96.4,14 47
+97.2,13 48
+98.11,35 49
+25,29 49
+31,34 49
+11,35 49
+11,35 49
+99.4,10 50
+100.5,14 51
+101.10,41 52
+22,29 52
+31,34 52
+36,40 52
+10,41 52
+10,41 52
+3,41 52
+102.9,48 53
+21,31 53
+33,36 53
+38,42 53
+44,47 53
+9,48 53
+9,48 53
+2,48 53
+104.4,14 54
+18,23 54
+105.9,13 55
+2,13 55
+106.8,39 56
+20,27 56
+29,33 56
+35,38 56
+8,39 56
+8,39 56
+1,39 56
+111.11,32 57
+23,24 57
+26,31 57
+11,32 57
+11,32 57
+112.9,10 58
+12,31 58
+22,23 58
+25,30 58
+12,31 58
+12,31 58
+1,32 58
+117.5,44 59
+17,40 59
+42,43 59
+5,44 59
+5,44 59
+1,45 59
+1,45 59
+1,45 60
+1,45 59
+118.0,1 61
+122.1,55 62
+13,19 62
+21,54 62
+1,55 62
+1,55 62
+123.1,19 63
+128.12,32 64
+22,26 64
+28,31 64
+12,32 64
+12,32 64
+129.1,22 65
+130.5,11 66
+131.6,63 67
+18,56 67
+58,62 67
+6,63 67
+6,63 67
+2,64 67
+2,64 67
+2,64 68
+2,64 67
+132.5,43 69
+16,21 69
+23,26 69
+28,34 69
+36,37 69
+39,42 69
+5,43 69
+5,43 69
+5,47 69
+133.6,64 70
+18,57 70
+59,63 70
+6,64 70
+6,64 70
+2,65 70
+2,65 70
+2,65 71
+2,65 70
+134.1,24 72
+135.8,13 73
+1,13 73
+141.1,26 74
+142.1,38 75
+18,25 75
+27,37 75
+1,38 75
+1,38 75
+143.5,15 76
+144.6,52 77
+18,42 77
+44,51 77
+6,52 77
+6,52 77
+2,53 77
+2,53 77
+2,53 78
+2,53 77
+145.1,22 79
+18,21 79
+1,22 79
+1,22 79
+146.5,17 80
+147.2,44 81
+6,43 81
+2,44 81
+148.8,11 82
+13,24 82
+13,32 82
+13,32 83
+1,33 82
+153.1,30 84
+18,29 84
+1,30 84
+1,30 84
+1:41.18,21 85
+23,26 85
+28,31 85
+33,36 85
+39,44 85
+46,47 85
+49,50 85
+53,54 85
+56,57 85
+59,60 85
+62,67 85
+69,70 85
+72,73 85
+0:155.1,14 86
+156.1,12 87
+157.1,12 88
+158.1,21 89
+159.5,22 90
+5,22 90
+160.2,26 91
+2,26 92
+162.2,27 93
+163.2,23 94
+165.1,14 95
+166.11,35 96
+11,35 96
+11,35 96
+1,35 96
+167.8,9 97
+1,9 97
+172.1,10 98
+173.20,35 99
+29,34 99
+20,35 99
+20,35 99
+174.1,22 100
+175.1,37 101
+20,24 101
+26,36 101
+1,37 101
+1,37 101
+176.5,17 102
+177.2,50 103
+20,43 103
+45,49 103
+2,50 103
+2,50 103
+178.1,22 104
+179.1,37 105
+20,24 105
+26,36 105
+1,37 105
+1,37 105
+180.5,17 106
+181.2,50 107
+20,43 107
+45,49 107
+2,50 107
+2,50 107
+182.1,24 108
+183.1,39 109
+21,26 109
+28,38 109
+1,39 109
+1,39 109
+184.5,18 110
+185.2,51 111
+20,43 111
+45,50 111
+2,51 111
+2,51 111
+186.5,41 112
+14,19 112
+21,40 112
+5,41 112
+5,41 112
+5,45 112
+187.2,58 113
+20,49 113
+51,57 113
+2,58 113
+2,58 113
+188.9,16 114
+18,23 114
+25,30 114
+32,38 114
+40,43 114
+1,44 114
+208.1,12 115
+209.1,12 116
+210.1,14 117
+211.1,12 118
+212.1,17 119
+213.16,43 120
+32,42 120
+16,43 120
+16,43 120
+214.5,14 121
+215.2,32 122
+6,31 122
+2,32 122
+216.19,36 123
+19,36 123
+19,36 123
+217.24,59 124
+28,31 124
+32,50 124
+51,52 124
+53,58 124
+24,59 124
+24,59 124
+1,60 124
+1,5 124
+13,22 124
+13,22 124
+13,22 125
+13,22 126
+13,22 127
+13,22 128
+1,60 124
+1,60 124
+1,60 129
+219.17,28 130
+1,38 130
+220.1,7 131
+221.6,19 132
+21,28 133
+222.26,44 134
+33,38 134
+40,43 134
+26,44 134
+26,44 134
+225.40,63 135
+48,53 135
+55,62 135
+40,63 135
+40,63 135
+3,10 135
+12,17 135
+19,24 135
+26,32 135
+34,35 135
+34,35 136
+34,35 137
+34,35 138
+34,35 139
+34,35 140
+226.6,14 141
+227.15,29 142
+27,28 142
+15,29 142
+15,29 142
+3,49 142
+3,49 142
+3,49 143
+31,46 142
+47,48 142
+3,49 142
+3,49 142
+3,49 144
+229.3,12 145
+3,46 145
+230.3,29 146
+14,20 146
+21,28 146
+3,29 146
+3,29 146
+231.21,29 147
+21,29 147
+20,33 147
+3,33 147
+232.26,64 148
+30,37 148
+38,56 148
+57,58 148
+59,63 148
+26,64 148
+26,64 148
+3,65 148
+3,7 148
+15,24 148
+15,24 148
+15,24 149
+15,24 150
+15,24 151
+15,24 152
+3,65 148
+3,65 148
+3,65 153
+233.28,41 154
+28,41 154
+27,45 154
+3,45 154
+234.25,69 155
+29,37 155
+38,56 155
+57,58 155
+59,68 155
+25,69 155
+25,69 155
+3,70 155
+3,7 155
+15,23 155
+15,23 155
+15,23 156
+15,23 157
+15,23 158
+15,23 159
+3,70 155
+3,70 155
+3,70 160
+235.18,26 161
+18,26 161
+17,30 161
+3,30 161
+236.25,49 162
+29,34 162
+35,40 162
+41,42 162
+44,48 162
+25,49 162
+25,49 162
+3,50 162
+3,7 162
+15,23 162
+15,23 162
+15,23 163
+15,23 164
+15,23 165
+15,23 166
+3,50 162
+3,50 162
+3,50 167
+238.3,59 168
+25,34 168
+25,40 168
+42,51 168
+42,58 168
+3,59 168
+3,59 168
+239.7,20 169
+240.8,48 170
+20,47 170
+8,48 170
+8,48 170
+4,49 170
+4,49 170
+4,49 171
+4,49 170
+241.7,44 172
+16,25 172
+16,31 172
+33,43 172
+7,44 172
+7,44 172
+7,48 172
+242.8,54 173
+20,53 173
+8,54 173
+8,54 173
+4,55 173
+4,55 173
+4,55 174
+4,55 173
+243.3,35 175
+14,34 175
+3,35 175
+3,35 175
+244.8,21 176
+23,33 177
+245.4,21 178
+246.23,33 179
+23,33 179
+22,37 179
+4,37 179
+247.31,69 180
+35,40 180
+41,59 180
+60,61 180
+62,68 180
+31,69 180
+31,69 180
+4,70 180
+4,8 180
+16,29 180
+16,29 180
+16,29 181
+16,29 182
+16,29 183
+16,29 184
+4,70 180
+4,70 180
+4,70 185
+248.4,69 186
+28,37 186
+28,43 186
+45,54 186
+45,61 186
+63,68 186
+4,69 186
+4,69 186
+249.9,23 187
+25,35 188
+250.5,23 189
+251.22,33 190
+5,33 190
+252.29,58 191
+33,44 191
+45,50 191
+51,52 191
+53,57 191
+29,58 191
+29,58 191
+5,59 191
+5,9 191
+17,27 191
+17,27 191
+17,27 192
+17,27 193
+17,27 194
+17,27 195
+5,59 191
+5,59 191
+5,59 196
+253.5,62 197
+25,34 197
+36,48 197
+50,61 197
+5,62 197
+5,62 197
+254.5,32 198
+255.5,13 199
+5,13 200
+5,13 201
+5,13 202
+249.37,51 203
+37,51 203
+37,51 204
+37,51 205
+37,51 206
+244.35,49 207
+35,49 207
+258.3,23 208
+14,22 208
+3,23 208
+3,23 208
+3,23 209
+3,23 210
+260.2,5 211
+2,5 212
+2,5 213
+2,5 214
+2,5 215
+2,5 216
+2,5 217
+2,5 218
+2,5 219
+221.30,38 220
+30,38 220
+262.1,38 221
+263.6,20 222
+22,28 223
+264.2,15 224
+2,29 224
+265.2,24 225
+263.30,33 226
+30,33 226
+267.39,60 227
+53,59 227
+39,60 227
+39,60 227
+17,72 227
+32,37 227
+32,37 227
+32,37 228
+62,71 227
+17,72 227
+17,72 227
+268.1,40 229
+11,34 229
+36,39 229
+1,40 229
+1,40 229
+270.1,36 230
+272.2,14 231
+273.6,15 232
+274.3,8 233
+275.7,14 234
+7,14 234
+277.15,29 235
+27,28 235
+15,29 235
+15,29 235
+3,74 235
+3,74 235
+3,74 236
+31,64 235
+66,73 235
+3,74 235
+3,74 235
+278.3,8 237
+280.3,25 238
+8,11 238
+19,24 238
+3,25 238
+3,25 238
+281.6,26 239
+6,26 239
+282.4,15 240
+4,7 240
+13,14 240
+4,15 240
+4,15 240
+4,15 241
+4,15 242
+283.4,9 243
+285.8,23 244
+8,23 244
+8,23 244
+8,23 244
+8,23 244
+8,23 244
+287.14,24 245
+5,29 245
+288.5,62 246
+15,28 246
+15,35 246
+37,45 246
+47,61 246
+5,62 246
+5,62 246
+289.5,55 247
+20,33 247
+20,40 247
+42,45 247
+47,54 247
+5,55 247
+5,55 247
+290.9,15 248
+291.25,51 249
+34,37 249
+39,42 249
+39,46 249
+48,50 249
+25,51 249
+25,51 249
+292.6,49 250
+15,49 250
+25,31 250
+33,48 250
+6,49 250
+6,49 251
+293.6,18 252
+6,9 252
+16,17 252
+6,18 252
+6,18 252
+6,18 253
+6,18 254
+6,18 255
+6,18 256
+6,18 257
+295.16,57 258
+20,57 258
+31,37 258
+39,56 258
+51,55 258
+39,56 258
+39,56 258
+6,58 258
+6,9 258
+6,9 258
+6,9 259
+6,58 258
+6,58 258
+296.5,10 260
+298.14,64 261
+35,36 261
+49,59 261
+49,62 261
+38,63 261
+38,63 261
+14,64 261
+14,64 261
+4,65 261
+4,7 261
+4,7 261
+4,7 262
+4,65 261
+4,65 261
+4,65 244
+300.5,20 263
+5,8 263
+17,19 263
+5,20 263
+5,20 244
+5,20 264
+5,20 234
+303.3,25 265
+8,11 265
+19,24 265
+3,25 265
+3,25 265
+304.8,23 266
+8,23 266
+8,23 266
+306.14,24 267
+5,29 267
+307.5,61 268
+21,34 268
+21,40 268
+42,48 268
+50,60 268
+5,61 268
+5,61 268
+308.14,24 269
+9,24 269
+309.6,41 270
+6,9 270
+16,40 270
+20,40 270
+31,36 270
+38,39 270
+16,40 270
+16,40 271
+6,41 270
+6,41 270
+6,41 272
+311.16,57 273
+20,57 273
+31,37 273
+39,56 273
+51,55 273
+39,56 273
+39,56 273
+6,58 273
+6,9 273
+6,9 273
+6,9 274
+6,58 273
+6,58 273
+312.5,10 275
+314.5,20 276
+5,8 276
+17,19 276
+5,20 276
+5,20 266
+5,20 277
+5,20 234
+318.3,18 278
+3,6 278
+15,17 278
+3,18 278
+3,18 234
+321.1,12 279
+1,5 279
+1,12 279
+322.0,1 280
+327.5,30 281
+14,19 281
+21,29 281
+5,30 281
+5,30 281
+5,34 281
+328.6,52 282
+18,51 282
+6,52 282
+6,52 282
+2,53 282
+2,53 282
+2,53 283
+2,53 282
+329.7,31 284
+23,29 284
+7,31 284
+7,31 284
+7,31 284
+7,38 284
+7,38 285
+330.2,31 286
+22,25 286
+27,30 286
+2,31 286
+2,31 286
+331.6,16 287
+6,20 287
+332.3,24 288
+7,23 288
+3,24 288
+333.11,20 289
+2,20 289
+334.2,24 290
+2,24 291
+2,24 292
+2,24 292
+336.8,13 293
+1,13 293
+343.5,40 294
+14,19 294
+21,39 294
+5,40 294
+5,40 294
+5,44 294
+344.6,52 295
+18,51 295
+6,52 295
+6,52 295
+2,53 295
+2,53 295
+2,53 296
+2,53 295
+345.7,31 297
+23,29 297
+7,31 297
+7,31 297
+7,31 297
+7,38 297
+7,38 298
+346.2,31 299
+22,25 299
+27,30 299
+2,31 299
+2,31 299
+347.6,16 300
+6,20 300
+348.3,25 301
+7,24 301
+3,25 301
+349.10,19 302
+2,19 302
+350.2,13 303
+351.6,16 304
+6,20 304
+352.11,20 305
+3,20 305
+353.2,12 306
+354.6,16 307
+6,20 307
+355.15,24 308
+3,24 308
+356.11,20 309
+11,20 309
+22,27 309
+29,34 309
+2,44 309
+2,44 310
+2,44 311
+2,44 312
+2,44 313
+2,44 314
+2,44 314
+358.8,13 315
+1,13 315
+363.5,13 316
+364.9,12 317
+2,12 317
+365.1,16 318
+369.11,35 319
+26,27 319
+29,34 319
+11,35 319
+11,35 319
+3,4 319
+6,7 319
+6,7 320
+6,7 321
+370.2,12 322
+371.6,14 323
+18,28 323
+372.3,8 324
+373.2,12 325
+2,12 325
+2,12 325
+375.12,17 326
+1,28 326
+376.9,14 327
+6,16 327
+18,22 328
+377.2,6 329
+2,13 329
+378.2,10 330
+376.24,27 331
+24,27 331
+380.8,9 332
+1,9 332
+385.1,25 333
+386.1,35 334
+17,22 334
+24,34 334
+1,35 334
+1,35 334
+387.5,14 335
+388.6,50 336
+18,42 336
+44,49 336
+6,50 336
+6,50 336
+2,51 336
+2,51 336
+2,51 337
+2,51 336
+389.1,17 338
+14,16 338
+1,17 338
+1,17 338
+390.15,37 339
+29,30 339
+32,36 339
+15,37 339
+15,37 339
+391.8,13 340
+1,13 340
+396.1,39 341
+13,19 341
+21,35 341
+37,38 341
+1,39 341
+1,39 341
+397.1,19 342
+403.1,26 343
+405.1,32 344
+19,21 344
+23,26 344
+28,31 344
+1,32 344
+1,32 344
+406.5,14 345
+409.9,12 346
+2,12 346
+411.15,18 347
+15,26 347
+8,26 347
+8,26 348
+1,26 347
+416.1,31 349
+17,18 349
+20,30 349
+1,31 349
+1,31 349
+417.5,14 350
+418.9,12 351
+2,12 351
+419.8,19 352
+16,18 352
+8,19 352
+8,19 352
+1,19 352
+424.1,21 353
+425.5,29 354
+16,18 354
+20,21 354
+23,28 354
+5,29 354
+5,29 354
+33,38 354
+5,38 354
+426.9,11 355
+2,11 355
+427.8,9 356
+1,9 356
+23
+aSys->Dir 1:26.1,39.2 64
+11
+0:name:28.2,6 s
+4:uid:29.2,5 s
+8:gid:30.2,5 s
+12:muid:31.2,6 s
+16:qid:32.2,5 @1
+
+32:mode:33.2,6 i
+36:atime:34.2,7 i
+40:mtime:35.2,7 i
+48:length:36.2,8 B
+56:dtype:37.2,7 i
+60:dev:38.2,5 i
+aSys->Qid 11.1,16.2 16
+3
+0:path:13.2,6 B
+8:vers:14.2,6 i
+12:qtype:15.2,7 i
+aDraw->Chans 2:70.1,82.2 4
+1
+0:desc:72.2,6 i
+aDraw->Context 274.1,279.2 12
+3
+0:display:276.2,9 R@4
+
+4:screen:277.2,8 R@8
+
+8:wm:278.2,4 Ct8.2
+0:t0:15,21 s
+4:t1:15,21 Ct8.2
+0:t0:32,38 s
+4:t1:32,38 R@9
+
+
+
+aDraw->Display 201.1,230.2 20
+5
+0:image:203.2,7 R@5
+
+4:white:204.2,7 R@5
+
+8:black:205.2,7 R@5
+
+12:opaque:206.2,8 R@5
+
+16:transparent:207.2,13 R@5
+
+aDraw->Image 142.1,198.2 56
+8
+0:r:146.2,3 @6
+
+16:clipr:147.2,7 @6
+
+32:depth:148.2,7 i
+36:chans:149.2,7 @2
+
+40:repl:150.2,6 i
+44:display:151.2,9 R@4
+
+48:screen:152.2,8 R@8
+
+52:iname:153.2,7 s
+aDraw->Rect 116.1,139.2 16
+2
+0:min:118.2,5 @7
+
+8:max:119.2,5 @7
+
+aDraw->Point 99.1,113.2 8
+2
+0:x:101.2,3 i
+4:y:102.2,3 i
+aDraw->Screen 249.1,263.2 16
+4
+0:id:251.2,4 i
+4:image:252.2,7 R@5
+
+8:fill:253.2,6 R@5
+
+12:display:254.2,9 R@4
+
+aDraw->Wmcontext 282.1,291.2 28
+7
+0:kbd:284.2,5 Ci
+4:ptr:285.2,5 CR@10
+
+8:ctl:286.2,5 Cs
+12:wctl:287.2,6 Cs
+16:images:288.2,8 CR@5
+
+20:connfd:289.2,8 R@11
+
+24:ctxt:290.2,6 R@3
+
+aDraw->Pointer 266.1,271.2 16
+3
+0:buttons:268.2,9 i
+4:xy:269.2,4 @7
+
+12:msec:270.2,6 i
+aSys->FD 1:45.1,48.2 4
+1
+0:fd:47.2,4 i
+aColumn 0:27.0,31.1 12
+3
+0:name:28.1,5 s
+4:ctype:29.1,6 s
+8:size:30.1,5 i
+aSys->Connection 1:52.1,57.2 12
+3
+0:dfd:54.2,5 R@11
+
+4:cfd:55.2,5 R@11
+
+8:dir:56.2,5 s
+aNametree->Tree 8:112.1,121.2 8
+2
+0:c:113.2,3 CR@15
+
+4:reply:114.2,7 Cs
+pNametree->Treeop 122.1,132.2 0
+2
+4:reply:123.2,7 Cs
+8:q:124.2,3 B
+4
+Create:126.2,8 80
+1
+16:d:128.3,4 @0
+
+Wstat:127.2,7
+Remove:129.2,8 16
+0
+Getpath:130.2,9 16
+0
+pStyxservers->Navop 31.1,42.2 0
+2
+4:reply:32.2,7 Ct8.2
+0:t0:18,30 R@0
+
+4:t1:18,30 s
+
+8:path:33.2,6 B
+3
+Stat:35.2,6 16
+0
+Walk:36.2,6 24
+1
+16:name:37.3,7 s
+Readdir:38.2,9 24
+2
+16:offset:39.3,9 i
+20:count:40.3,8 i
+aSrcFD 0:202.0,204.1 16
+4
+0:clonefd:203.1,8 R@11
+
+4:ctlfd:10,15 R@11
+
+8:cmdfd:17,22 R@11
+
+12:datafd:24,30 R@11
+
+aStyxservers->Styxserver 8:44.1,82.2 32
+7
+0:fd:45.2,4 R@11
+
+4:fids:46.2,6 ALR@19
+
+8:fidlock:47.2,9 Ci
+12:t:48.2,3 R@20
+
+16:rootpath:49.2,10 B
+24:msize:50.2,7 i
+28:replychan:51.2,11 CR@21
+
+aStyxservers->Fid 5.1,19.2 48
+9
+0:fid:6.2,5 i
+8:path:7.2,6 B
+16:qtype:8.2,7 i
+20:isopen:9.2,8 i
+24:mode:10.2,6 i
+28:doffset:11.2,9 t8.2
+0:t0:12,15 i
+4:t1:12,15 i
+
+36:uname:12.2,7 s
+40:param:13.2,7 s
+44:data:14.2,6 Ab
+aStyxservers->Navigator 21.1,29.2 8
+2
+0:c:22.2,3 CR@16
+
+4:reply:23.2,7 Ct8.2
+0:t0:18,30 R@0
+
+4:t1:18,30 s
+
+pStyx->Rmsg 7:125.1,163.2 0
+1
+4:tag:126.2,5 i
+15
+Readerror:128.2,11 12
+1
+8:error:129.3,8 s
+Version:130.2,9 16
+2
+8:msize:131.3,8 i
+12:version:132.3,10 s
+Auth:133.2,6 24
+1
+8:aqid:134.3,7 @1
+
+Attach:135.2,8 24
+1
+8:qid:136.3,6 @1
+
+Flush:137.2,7 8
+0
+Error:138.2,7 12
+1
+8:ename:139.3,8 s
+Clunk:140.2,7 8
+0
+Remove:141.2,8
+Wstat:142.2,7
+Walk:143.2,6 12
+1
+8:qids:144.3,7 A@1
+
+Create:145.2,8 32
+2
+8:qid:147.3,6 @1
+
+24:iounit:148.3,9 i
+Open:146.2,6
+Read:149.2,6 12
+1
+8:data:150.3,7 Ab
+Write:151.2,7 12
+1
+8:count:152.3,8 i
+Stat:153.2,6 72
+1
+8:stat:154.3,7 @0
+
+pStyx->Tmsg 75.1,123.2 0
+1
+4:tag:76.2,5 i
+14
+Readerror:78.2,11 12
+1
+8:error:79.3,8 s
+Version:80.2,9 16
+2
+8:msize:81.3,8 i
+12:version:82.3,10 s
+Auth:83.2,6 20
+3
+8:afid:84.3,7 i
+12:uname:85.3,8 s
+16:aname:10,15 s
+Attach:86.2,8 24
+4
+8:fid:87.3,6 i
+12:afid:8,12 i
+16:uname:88.3,8 s
+20:aname:10,15 s
+Flush:89.2,7 12
+1
+8:oldtag:90.3,9 i
+Walk:91.2,6 20
+3
+8:fid:92.3,6 i
+12:newfid:8,14 i
+16:names:93.3,8 As
+Open:94.2,6 16
+2
+8:fid:95.3,6 i
+12:mode:8,12 i
+Create:96.2,8 24
+4
+8:fid:97.3,6 i
+12:name:98.3,7 s
+16:perm:99.3,7 i
+20:mode:9,13 i
+Read:100.2,6 32
+3
+8:fid:101.3,6 i
+16:offset:102.3,9 B
+24:count:103.3,8 i
+Write:104.2,7 32
+3
+8:fid:105.3,6 i
+16:offset:106.3,9 B
+24:data:107.3,7 Ab
+Clunk:108.2,7 12
+1
+8:fid:111.3,6 i
+Stat:109.2,6
+Remove:110.2,8
+Wstat:112.2,7 80
+2
+8:fid:113.3,6 i
+16:stat:114.3,7 @0
+
+18
+0:init
+1
+36:argv:0:41.29,33 Ls
+9
+40:arg:46.1,4 mArg
+3:1.0,14.1 0
+
+44:addr:0:73.1,5 s
+48:cserr:58.1,6 s
+52:dbdir:87.1,6 s
+56:sources:89.1,8 Ls
+60:o:76.8,9 i
+76:cfd:88.2,5 R@11
+
+80:cdir:7,11 s
+84:stype:75.1,6 s
+n117:netmkaddr
+3
+32:addr:94.10,14 s
+36:net:16,19 s
+40:svc:21,24 s
+2
+44:n:98.2,3 i
+48:l:5,6 Ls
+s152:split1
+2
+32:s:109.7,8 s
+36:delim:10,15 s
+2
+40:l:111.2,3 s
+44:r:5,6 s
+t8.2
+0:t0:109.27,33 s
+4:t1:27,33 s
+164:notloaded
+1
+32:s:115.10,11 s
+0
+n174:usage
+0
+0
+n180:do_mount
+1
+32:addr:126.9,13 s
+4
+36:remdir:129.1,7 s
+40:dbdir:134.1,6 s
+44:ok:128.2,4 i
+48:c:6,7 @13
+
+s217:do_clone
+1
+32:dbdir:139.9,14 s
+3
+36:cfd:142.1,4 R@11
+
+40:cname:145.1,6 s
+44:newfile:141.1,8 s
+t8.2
+0:t0:139.26,37 R@11
+
+4:t1:26,37 s
+246:dir
+4
+32:name:151.4,8 s
+36:perm:18,22 i
+40:length:29,35 i
+44:qid:42,45 i
+2
+48:uid:153.1,4 s
+56:d:154.1,2 @0
+
+@0
+280:newconv
+2
+32:dbdir:170.8,13 s
+36:source:15,21 s
+9
+40:err:172.1,4 s
+44:ctlfd:175.1,6 R@11
+
+48:cmdf:178.1,5 s
+52:cmdfd:179.1,6 R@11
+
+56:ctlf:174.1,5 s
+60:dataf:182.1,6 s
+64:datafd:183.1,7 R@11
+
+68:clonefd:173.2,9 R@11
+
+72:cdir:11,15 s
+t20.5
+0:t0:170.33,44 R@11
+
+4:t1:33,44 R@11
+
+8:t2:33,44 R@11
+
+12:t3:33,44 R@11
+
+16:t4:33,44 s
+338:serveloop
+3
+32:dbdir:206.10,15 s
+36:sources:25,32 Ls
+40:confd:50,55 R@11
+
+48
+44:i:220.1,2 i
+48:m:275.7,8 R@22
+
+52:srcfds:219.1,7 A@17
+
+56:gm:269.1,3 R@22
+
+60:tree:216.2,6 R@14
+
+64:treeop:8,14 CR@16
+
+68:c:280.3,4 R@19
+
+72:clist:249.9,14 L@12
+
+76:colqid:211.1,7 i
+80:contents:218.1,9 Ls
+84:sl:221.6,8 Ls
+88:tlist:244.8,13 Ls
+92:Qsrc:231.3,7 i
+96:buf:270.1,4 Ab
+100:srcname:222.3,10 s
+104:srcdriver:12,21 s
+108:Qtable:246.4,10 i
+112:Qtabledir:233.3,12 i
+116:bs:213.2,4 mBtos
+6:4.0,7.1 0
+
+120:cserr:0:213.6,11 s
+124:c:303.3,4 R@19
+
+128:colcontent:262.1,11 As
+132:table:245.4,9 s
+136:tables:238.3,9 Ls
+140:Qcol:251.5,9 i
+144:Qsql:235.3,7 i
+148:clonefd:225.3,10 R@11
+
+152:ctlfd:12,17 R@11
+
+156:cmdfd:19,24 R@11
+
+160:datafd:26,32 R@11
+
+164:e:34,35 s
+168:columns:248.4,11 L@12
+
+172:data:253.5,9 s
+176:r:292.6,7 R@21
+
+180:sqlqid:209.1,7 i
+184:srcqid:208.1,7 i
+188:tabledirqid:212.1,12 i
+192:tableqid:210.1,9 i
+196:tchan:267.2,7 CR@22
+
+200:srv:9,12 R@18
+
+224:state:291.7,12 s
+228:s:14,15 s
+232:err:17,20 i
+304:column:250.5,11 @12
+
+108:n:289.5,6 i
+108:n:307.5,6 i
+140:srcno:287.5,10 i
+140:srcno:306.5,10 i
+n808:find_tables
+2
+32:cmdfd:324.12,17 R@11
+
+36:datafd:19,25 R@11
+
+4
+40:fields:330.2,8 As
+44:tlist:326.1,6 Ls
+48:rec:329.8,11 s
+52:tname:333.2,7 s
+Ls847:find_columns
+3
+32:cmdfd:340.13,18 R@11
+
+36:datafd:20,26 R@11
+
+40:table:41,46 s
+6
+44:fields:346.2,8 As
+48:clist:342.1,6 L@12
+
+52:csize:353.2,7 i
+56:ctype:350.2,7 s
+60:rec:345.8,11 s
+76:cname:349.2,7 s
+L@12
+903:atokenize
+2
+32:s:361.10,11 s
+36:delim:21,26 s
+5
+40:r:366.1,2 Ls
+44:i:376.6,7 i
+48:a:375.1,2 As
+52:dl:365.1,3 i
+56:l:367.1,2 s
+As935:find_sources
+1
+32:cdir:383.13,17 s
+5
+36:fd:386.1,3 R@11
+
+40:sfile:385.1,6 s
+44:s:389.1,2 s
+60:n:390.2,3 i
+64:lines:5,10 Ls
+Ls962:err
+1
+32:s:394.4,5 s
+0
+n969:read_fd
+1
+32:fd:400.8,10 R@11
+
+2
+36:buf:403.1,4 Ab
+40:size:405.1,5 i
+s984:read_file
+1
+32:f:414.10,11 s
+1
+36:fd:416.1,3 R@11
+
+s997:write_fd
+2
+32:fd:422.9,11 R@11
+
+36:s:26,27 s
+1
+40:a:424.1,2 Ab
+i8
+280:convcs:17.1,7 mConvcs
+6:14.0,29.1 0
+
+288:daytime:0:15.1,8 mDaytime
+5:1.0,53.1 0
+
+348:nametree:0:24.1,9 mNametree
+8:110.0,135.1 0
+
+372:stderr:0:9.1,7 R@11
+
+376:str:13.1,4 mString
+4:1.0,39.1 0
+
+380:styx:0:19.1,5 mStyx
+7:1.0,182.1 0
+
+384:styxservers:0:22.1,12 mStyxservers
+8:1.0,108.1 0
+
+388:sys:0:8.1,4 mSys
+1:4.0,160.1 0
+
diff --git a/appl/demo/odbc/runodbc.sh b/appl/demo/odbc/runodbc.sh
new file mode 100755
index 00000000..d7e6365d
--- /dev/null
+++ b/appl/demo/odbc/runodbc.sh
@@ -0,0 +1,17 @@
+#!/dis/sh
+
+mount -A {auxi/odbcmnt -a tcp!200.1.1.113} /mnt/odbc
+
+fn splitrun {
+ if {! ~ $#* 0} {
+ (hd tl) = $*
+ echo Registering $hd
+ grid/register -a resource ODBC -a name $hd '{export /mnt/odbc/'^$hd^'}'
+ splitrun $tl
+ }
+}
+
+cd /mnt/odbc
+sources=`{ls}
+splitrun $sources
+
diff --git a/appl/demo/spree/mkfile b/appl/demo/spree/mkfile
new file mode 100644
index 00000000..2574d339
--- /dev/null
+++ b/appl/demo/spree/mkfile
@@ -0,0 +1,23 @@
+<../../../mkconfig
+
+TARG=\
+
+SHTARG=\
+ spreeclient.sh\
+
+MODULES=\
+
+SYSMODULES= \
+
+DISBIN=$ROOT/dis/demo/spree
+
+<$ROOT/mkfiles/mkdis
+
+SHFILES=${SHTARG:%.sh=$DISBIN/%}
+all:V: $SHTARG
+install:V: $SHFILES
+%.install:V: $DISBIN/%
+%.installall:V: $DISBIN/%
+
+$DISBIN/%: %.sh
+ cp $stem.sh $target && chmod a+rx $target
diff --git a/appl/demo/spree/spreeclient.sh b/appl/demo/spree/spreeclient.sh
new file mode 100755
index 00000000..0dd9aa17
--- /dev/null
+++ b/appl/demo/spree/spreeclient.sh
@@ -0,0 +1,44 @@
+#!/dis/sh
+load std
+autoload=std
+ndb/cs
+
+fn ck {
+ or {$*} {
+ echo spreeclient: exiting >[1=2]
+ raise error
+ }
+}
+user="{cat /dev/user}
+
+fn notice {
+ or {~ $#* 1} {
+ echo usage: notice arg >[1=2]
+ raise usage
+ }
+ t := $*
+ run /lib/sh/win
+ tkwin Notice {
+ x text .t -yscrollcommand {.s set}
+ x scrollbar .s -orient vertical -command {.t yview}
+ x pack .s -side left -fill y
+ x pack .t -side top -fill both -expand 1
+ x .t insert 1.0 ${tkquote $t}
+ tk onscreen $wid
+ chan c; {} ${recv c}
+ }
+}
+
+ck mount -A 'tcp!$registry!registry' /mnt/registry
+ck /dis/grid/remotelogon wm/wm {
+ k = /usr/$user/keyring/default
+ addrs=`{ndb/regquery resource spree auth.signer `{getpk -s $k}}
+ if{~ $#addrs 0} {
+ notice 'No spree servers found'
+ }
+ if {mount ${hd $addrs} /n/remote} {
+ spree/joinsession 0
+ } {
+ notice 'Cannot access spree server'
+ }
+}
diff --git a/appl/demo/whiteboard/mkfile b/appl/demo/whiteboard/mkfile
new file mode 100644
index 00000000..020e8d21
--- /dev/null
+++ b/appl/demo/whiteboard/mkfile
@@ -0,0 +1,28 @@
+<../../../mkconfig
+
+TARG=\
+ wbsrv.dis\
+ whiteboard.dis\
+
+SHTARG=\
+ runwb.sh\
+
+MODULES=\
+
+SYSMODULES= \
+ draw.m\
+ sys.m\
+ tk.m\
+ tkclient.m\
+
+DISBIN=$ROOT/dis/demo/whiteboard
+
+<$ROOT/mkfiles/mkdis
+
+SHFILES=${SHTARG:%.sh=$DISBIN/%}
+install:V: $SHFILES
+%.install:V: $DISBIN/%
+%.installall:V: $DISBIN/%
+
+$DISBIN/%: %.sh
+ cp $stem.sh $target && chmod a+rx $target
diff --git a/appl/demo/whiteboard/runwb.sh b/appl/demo/whiteboard/runwb.sh
new file mode 100755
index 00000000..f64a6382
--- /dev/null
+++ b/appl/demo/whiteboard/runwb.sh
@@ -0,0 +1,7 @@
+#!/dis/sh.dis
+load std
+pctl forkns
+memfs /tmp
+cp /dis/wm/whiteboard.dis /tmp
+/dis/auxi/wbsrv /tmp $2
+grid/register -a resource Whiteboard -a size 600x400 -a name $1 {export /tmp}
diff --git a/appl/demo/whiteboard/wbsrv.b b/appl/demo/whiteboard/wbsrv.b
new file mode 100644
index 00000000..9bec955b
--- /dev/null
+++ b/appl/demo/whiteboard/wbsrv.b
@@ -0,0 +1,268 @@
+implement Wbserve;
+
+include "sys.m";
+ sys: Sys;
+
+include "draw.m";
+ draw: Draw;
+ Chans, Display, Image, Rect, Point : import draw;
+
+Wbserve : module {
+ init : fn (ctxt : ref Draw->Context, args : list of string);
+};
+
+WBW : con 600;
+WBH : con 400;
+
+savefile := "";
+
+init(nil: ref Draw->Context, args: list of string)
+{
+ sys = load Sys Sys->PATH;
+ draw = load Draw Draw->PATH;
+ if (draw == nil)
+ badmod(Draw->PATH);
+
+ if (args == nil || tl args == nil)
+ error("usage: wbsrv mntpt [savefile]");
+ args = tl args;
+ mntpt := hd args;
+ args = tl args;
+
+ display := Display.allocate(nil);
+ if (display == nil)
+ error(sys->sprint("cannot allocate display: %r"));
+
+ bg: ref Draw->Image;
+ if (args != nil) {
+ savefile = hd args;
+ bg = display.open(savefile);
+ }
+ r := Rect(Point(0,0), Point(WBW, WBH));
+ wb := display.newimage(r, Draw->CMAP8, 0, Draw->White);
+ if (wb == nil)
+ error(sys->sprint("cannot allocate whiteboard image: %r"));
+ if (bg != nil) {
+ wb.draw(bg.r, bg, nil, Point(0,0));
+ bg = nil;
+ }
+
+ nextmsg = ref Msg (nil, nil);
+
+ sys->bind("#s", mntpt, Sys->MBEFORE);
+
+ bit := sys->file2chan(mntpt, "wb.bit");
+ strokes := sys->file2chan(mntpt, "strokes");
+
+ spawn srv(wb, bit, strokes);
+ if (savefile != nil)
+ spawn saveit(display, wb);
+}
+
+srv(wb: ref Image, bit, strokes: ref Sys->FileIO)
+{
+ nwbbytes := draw->bytesperline(wb.r, wb.depth) * wb.r.dy();
+ bithdr := sys->aprint("%11s %11d %11d %11d %11d ", wb.chans.text(), 0, 0, WBW, WBH);
+
+ for (;;) alt {
+ (offset, count, fid, r) := <-bit.read =>
+ if (r == nil) {
+ closeclient(fid);
+ continue;
+ }
+ c := getclient(fid);
+ if (c == nil) {
+ # new client
+ c = newclient(fid);
+ data := array [len bithdr + nwbbytes] of byte;
+ data[0:] = bithdr;
+ wb.readpixels(wb.r, data[len bithdr:]);
+ c.bitdata = data;
+ }
+ if (offset >= len c.bitdata) {
+ rreply(r, (nil, nil));
+ continue;
+ }
+ rreply(r, (c.bitdata[offset:], nil));
+
+ (offset, data, fid, w) := <-bit.write =>
+ if (w != nil)
+ wreply(w, (0, "permission denied"));
+
+ (offset, count, fid, r) := <-strokes.read =>
+ if (r == nil) {
+ closeclient(fid);
+ continue;
+ }
+ c := getclient(fid);
+ if (c == nil) {
+ c = newclient(fid);
+ c.nextmsg = nextmsg;
+ }
+ d := c.nextmsg.data;
+ if (d == nil) {
+ c.pending = r;
+ c.pendlen = count;
+ continue;
+ }
+ c.nextmsg = c.nextmsg.next;
+ rreply(r, (d, nil));
+
+ (offset, data, fid, w) := <-strokes.write =>
+ if (w == nil) {
+ closeclient(fid);
+ continue;
+ }
+ err := drawstrokes(wb, data);
+ if (err != nil) {
+ wreply(w, (0, err));
+ continue;
+ }
+ wreply(w, (len data, nil));
+ writeclients(data);
+ }
+}
+
+rreply(rc: chan of (array of byte, string), reply: (array of byte, string))
+{
+ alt {
+ rc <-= reply =>;
+ * =>;
+ }
+}
+
+wreply(wc: chan of (int, string), reply: (int, string))
+{
+ alt {
+ wc <-= reply=>;
+ * =>;
+ }
+}
+
+export(fd : ref Sys->FD, done : chan of int)
+{
+ sys->export(fd, "/", Sys->EXPWAIT);
+ done <-= 1;
+}
+
+Msg : adt {
+ data : array of byte;
+ next : cyclic ref Msg;
+};
+
+Client : adt {
+ fid : int;
+ bitdata : array of byte; # bit file client
+ nextmsg : ref Msg; # strokes file client
+ pending : Sys->Rread;
+ pendlen : int;
+};
+
+nextmsg : ref Msg;
+clients : list of ref Client;
+
+newclient(fid : int) : ref Client
+{
+ c := ref Client(fid, nil, nil, nil, 0);
+ clients = c :: clients;
+ return c;
+}
+
+getclient(fid : int) : ref Client
+{
+ for(cl := clients; cl != nil; cl = tl cl)
+ if((c := hd cl).fid == fid)
+ return c;
+ return nil;
+}
+
+closeclient(fid : int)
+{
+ nl: list of ref Client;
+ for(cl := clients; cl != nil; cl = tl cl)
+ if((hd cl).fid != fid)
+ nl = hd cl :: nl;
+ clients = nl;
+}
+
+writeclients(data : array of byte)
+{
+ nm := ref Msg(nil, nil);
+ nextmsg.data = data;
+ nextmsg.next = nm;
+
+ for(cl := clients; cl != nil; cl = tl cl){
+ if ((c := hd cl).pending != nil) {
+ n := c.pendlen;
+ if (n > len data)
+ n = len data;
+ alt{
+ c.pending <-= (data[0:n], nil) => ;
+ * => ;
+ }
+ c.pending = nil;
+ c.nextmsg = nm;
+ }
+ }
+ nextmsg = nm;
+}
+
+# data: colour width p0 p1 pn*
+
+pencol: int;
+pen: ref Image;
+
+drawstrokes(wb: ref Image, data : array of byte) : string
+{
+ (n, toks) := sys->tokenize(string data, " ");
+ if (n < 6 || n & 1)
+ return "bad data";
+
+ colour, width, x, y : int;
+ (colour, toks) = (int hd toks, tl toks);
+ (width, toks) = (int hd toks, tl toks);
+ (x, toks) = (int hd toks, tl toks);
+ (y, toks) = (int hd toks, tl toks);
+ if (pen == nil || colour != pencol) {
+ pencol = colour;
+ pen = wb.display.newimage(Rect(Point(0,0), Point(1,1)), Draw->CMAP8, 1, pencol);
+ }
+ p0 := Point(x, y);
+ while (toks != nil) {
+ (x, toks) = (int hd toks, tl toks);
+ (y, toks) = (int hd toks, tl toks);
+ p1 := Point(x, y);
+ # could use poly() instead of line()
+ wb.line(p0, p1, Draw->Enddisc, Draw->Enddisc, width, pen, pen.r.min);
+ p0 = p1;
+ }
+ return nil;
+}
+
+error(e: string)
+{
+ sys->fprint(stderr(), "wbsrv: %s\n", e);
+ raise "fail:error";
+}
+
+stderr(): ref Sys->FD
+{
+ return sys->fildes(2);
+}
+
+badmod(path: string)
+{
+ sys->fprint(stderr(), "wbsrv: cannot load %s: %r\n", path);
+ exit;
+}
+
+saveit(display: ref Display, img: ref Image)
+{
+ for (;;) {
+ sys->sleep(300000);
+ fd := sys->open(savefile, sys->OWRITE);
+ if (fd == nil)
+ exit;
+ display.writeimage(fd, img);
+ }
+} \ No newline at end of file
diff --git a/appl/demo/whiteboard/wbsrv.dis b/appl/demo/whiteboard/wbsrv.dis
new file mode 100644
index 00000000..12d09e5e
--- /dev/null
+++ b/appl/demo/whiteboard/wbsrv.dis
Binary files differ
diff --git a/appl/demo/whiteboard/wbsrv.sbl b/appl/demo/whiteboard/wbsrv.sbl
new file mode 100644
index 00000000..6a09ad7a
--- /dev/null
+++ b/appl/demo/whiteboard/wbsrv.sbl
@@ -0,0 +1,818 @@
+limbo .sbl 2.1
+Wbserve
+3
+wbsrv.b
+sys.m
+draw.m
+510
+21.1,25 0
+22.1,28 1
+23.5,16 2
+24.2,20 3
+9,19 3
+2,20 3
+26.5,16 4
+20,27 4
+20,34 4
+20,34 5
+27.2,40 6
+8,39 6
+2,40 6
+28.1,15 7
+29.1,17 8
+30.1,15 9
+32.1,33 10
+29,32 10
+1,33 10
+1,33 10
+33.5,19 11
+34.8,50 12
+20,49 12
+8,50 12
+8,50 12
+2,51 12
+2,51 12
+2,51 13
+2,51 12
+37.5,16 14
+38.2,20 15
+39.2,29 16
+7,14 16
+20,28 16
+2,29 16
+2,29 16
+41.17,18 17
+19,20 17
+29,32 17
+34,37 17
+42.1,55 18
+7,14 18
+24,25 18
+2:90.18,31 18
+0:42.40,41 18
+43,54 18
+1,55 18
+1,55 18
+43.5,14 19
+44.8,59 20
+20,58 20
+8,59 20
+8,59 20
+2,60 20
+2,60 20
+2,60 21
+2,60 20
+45.5,14 22
+46.2,36 23
+2,4 23
+10,14 23
+16,18 23
+20,23 23
+31,32 23
+33,34 23
+2,36 23
+47.2,10 24
+50.1,29 25
+20,23 25
+25,28 25
+1,29 25
+1,29 26
+52.1,37 27
+11,15 27
+17,22 27
+24,36 27
+1,37 27
+1,37 27
+54.1,39 28
+23,28 28
+30,38 28
+1,39 28
+1,39 28
+55.1,44 29
+27,32 29
+34,43 29
+1,44 29
+1,44 29
+57.1,28 30
+11,13 30
+15,18 30
+20,27 30
+1,28 30
+58.5,20 31
+59.2,27 32
+15,22 32
+24,26 32
+2,27 32
+60.0,1 33
+64.13,47 34
+32,36 34
+38,46 34
+13,47 34
+13,47 34
+50,59 34
+50,54 34
+50,59 34
+50,59 34
+1,59 34
+65.52,67 35
+52,60 35
+52,67 35
+52,67 35
+1,84 35
+23,50 35
+23,50 35
+23,50 36
+69,70 35
+72,73 35
+75,78 35
+80,83 35
+1,84 35
+1,84 35
+68.30,38 37
+30,38 37
+88.29,38 37
+29,38 37
+92.30,42 37
+30,42 37
+111.29,42 37
+29,42 37
+67.10,16 37
+10,16 37
+10,16 37
+10,16 37
+68.28,38 37
+28,38 38
+69.6,14 39
+70.3,19 40
+15,18 40
+3,19 40
+3,19 41
+3,19 42
+3,19 43
+71.3,11 44
+73.2,21 45
+17,20 45
+2,21 45
+2,21 45
+74.6,14 46
+76.3,21 47
+17,20 47
+3,21 47
+3,21 47
+77.18,28 48
+18,39 48
+3,48 48
+78.3,20 49
+79.3,41 50
+3,5 50
+17,21 50
+23,40 50
+28,38 50
+23,27 50
+23,40 50
+3,41 50
+3,41 50
+80.3,19 51
+3,19 52
+82.16,29 53
+6,29 53
+83.3,24 54
+10,11 54
+14,17 54
+19,22 54
+3,24 54
+3,24 55
+3,24 56
+3,24 57
+84.3,11 58
+86.2,38 59
+9,10 59
+13,31 59
+13,22 59
+13,31 59
+33,36 59
+2,38 59
+2,38 60
+2,38 61
+2,38 62
+2,38 37
+88.27,38 37
+27,38 63
+27,38 64
+89.6,14 65
+90.3,38 66
+10,11 66
+14,15 66
+17,36 66
+3,38 66
+3,38 67
+3,38 68
+3,38 69
+3,38 70
+3,38 37
+92.28,42 37
+28,42 71
+93.6,14 72
+94.3,19 73
+15,18 73
+3,19 73
+3,19 74
+3,19 75
+3,19 76
+3,19 77
+95.3,11 78
+97.2,21 79
+17,20 79
+2,21 79
+2,21 79
+98.6,14 80
+99.3,21 81
+17,20 81
+3,21 81
+3,21 81
+100.3,22 82
+102.7,16 83
+2,21 83
+2,21 84
+103.6,14 85
+104.3,16 86
+105.3,20 87
+3,20 88
+3,20 89
+3,20 90
+3,20 91
+106.3,11 92
+108.14,23 93
+2,28 93
+2,28 94
+109.2,21 95
+9,10 95
+13,14 95
+16,19 95
+2,21 95
+2,21 96
+2,21 97
+2,21 98
+2,21 99
+2,21 37
+111.27,42 37
+27,42 100
+27,42 101
+112.6,14 102
+113.3,19 103
+15,18 103
+3,19 103
+3,19 104
+3,19 105
+3,19 106
+3,19 107
+3,19 108
+114.3,11 109
+116.2,30 110
+21,23 110
+25,29 110
+2,30 110
+2,30 110
+117.6,16 111
+118.3,22 112
+10,11 112
+14,15 112
+17,20 112
+3,22 112
+3,22 113
+3,22 114
+3,22 115
+3,22 116
+3,22 117
+119.3,11 118
+121.2,28 119
+9,10 119
+13,21 119
+23,26 119
+2,28 119
+122.2,20 120
+15,19 120
+2,20 120
+2,20 121
+2,20 122
+2,20 123
+2,20 124
+2,20 125
+2,20 37
+129.1,3 126
+1,3 126
+128.1,7 126
+1,7 126
+1,7 126
+1,7 126
+132.0,1 127
+0,1 127
+137.1,3 128
+1,3 128
+136.1,7 128
+1,7 128
+1,7 128
+1,7 128
+140.0,1 129
+0,1 129
+166.1,39 130
+17,20 130
+22,25 130
+27,30 130
+32,35 130
+37,38 130
+1,39 130
+1,39 131
+167.1,23 132
+168.8,9 133
+1,9 133
+173.5,18 134
+20,29 135
+174.5,17 136
+5,17 136
+5,28 136
+5,28 137
+175.10,11 138
+3,11 138
+173.31,41 139
+31,41 139
+176.8,11 140
+1,11 140
+182.5,18 141
+20,29 142
+183.5,12 143
+5,23 143
+5,23 144
+184.8,13 145
+3,19 145
+3,19 146
+182.31,41 147
+31,41 147
+185.1,13 148
+186.0,1 149
+190.1,24 150
+15,18 150
+20,23 150
+1,24 150
+1,24 151
+191.1,20 152
+192.1,18 153
+194.5,18 154
+20,29 155
+195.6,18 156
+6,18 156
+6,33 156
+6,33 157
+196.3,17 158
+197.11,19 159
+7,19 159
+198.4,16 160
+200.3,12 161
+18,22 161
+18,27 161
+29,32 161
+3,12 161
+199.3,9 161
+3,9 161
+3,9 161
+3,9 161
+3,9 162
+3,9 163
+3,9 161
+3,9 161
+203.3,18 164
+204.3,17 165
+3,17 166
+194.31,41 167
+31,41 167
+207.1,13 168
+208.0,1 169
+217.14,45 170
+28,39 170
+41,44 170
+14,45 170
+14,45 170
+218.5,10 171
+14,19 171
+14,19 171
+219.9,19 172
+2,19 172
+222.23,30 173
+19,30 173
+19,30 174
+32,39 173
+2,8 173
+10,14 173
+10,14 175
+223.22,29 176
+18,29 176
+18,29 177
+31,38 176
+2,7 176
+9,13 176
+9,13 178
+224.18,25 179
+14,25 179
+14,25 180
+27,34 179
+2,3 179
+5,9 179
+5,9 181
+225.18,25 182
+14,25 182
+14,25 183
+27,34 182
+2,3 182
+5,9 182
+5,9 184
+226.5,15 185
+19,35 185
+227.2,17 186
+228.2,81 187
+8,18 187
+39,40 187
+41,42 187
+51,52 187
+53,54 187
+2:90.18,31 187
+0:228.71,72 187
+74,80 187
+2,81 187
+2,81 187
+230.13,14 188
+16,17 188
+231.8,19 189
+232.19,26 190
+15,26 190
+15,26 191
+28,35 190
+3,4 190
+6,10 190
+6,10 192
+233.19,26 193
+15,26 193
+15,26 194
+28,35 193
+3,4 193
+6,10 193
+6,10 195
+234.14,15 196
+17,18 196
+236.2,70 197
+2,4 197
+10,12 197
+14,16 197
+18,31 197
+33,46 197
+48,53 197
+55,58 197
+60,69 197
+2,70 197
+237.2,9 198
+2,9 198
+239.8,11 199
+1,11 199
+244.13,21 200
+13,21 200
+13,21 200
+13,21 200
+1,40 200
+1,40 200
+1,40 201
+23,36 200
+38,39 200
+1,40 200
+1,40 200
+245.1,19 202
+255.13,21 203
+13,21 203
+13,21 203
+13,21 203
+1,59 203
+1,59 203
+1,59 204
+23,52 203
+54,58 203
+1,59 203
+1,59 203
+256.1,5 205
+262.2,20 206
+13,19 206
+2,20 206
+2,20 206
+263.2,40 207
+18,26 207
+28,39 207
+2,40 207
+2,40 207
+264.6,15 208
+265.3,7 209
+266.2,29 210
+2,9 210
+21,23 210
+25,28 210
+2,29 210
+2,29 210
+2,29 211
+2,29 211
+17
+aSys->Dir 1:26.1,39.2 64
+11
+0:name:28.2,6 s
+4:uid:29.2,5 s
+8:gid:30.2,5 s
+12:muid:31.2,6 s
+16:qid:32.2,5 @1
+
+32:mode:33.2,6 i
+36:atime:34.2,7 i
+40:mtime:35.2,7 i
+48:length:36.2,8 B
+56:dtype:37.2,7 i
+60:dev:38.2,5 i
+aSys->Qid 11.1,16.2 16
+3
+0:path:13.2,6 B
+8:vers:14.2,6 i
+12:qtype:15.2,7 i
+aDraw->Chans 2:70.1,82.2 4
+1
+0:desc:72.2,6 i
+aDraw->Context 274.1,279.2 12
+3
+0:display:276.2,9 R@4
+
+4:screen:277.2,8 R@8
+
+8:wm:278.2,4 Ct8.2
+0:t0:15,21 s
+4:t1:15,21 Ct8.2
+0:t0:32,38 s
+4:t1:32,38 R@9
+
+
+
+aDraw->Display 201.1,230.2 20
+5
+0:image:203.2,7 R@5
+
+4:white:204.2,7 R@5
+
+8:black:205.2,7 R@5
+
+12:opaque:206.2,8 R@5
+
+16:transparent:207.2,13 R@5
+
+aDraw->Image 142.1,198.2 56
+8
+0:r:146.2,3 @6
+
+16:clipr:147.2,7 @6
+
+32:depth:148.2,7 i
+36:chans:149.2,7 @2
+
+40:repl:150.2,6 i
+44:display:151.2,9 R@4
+
+48:screen:152.2,8 R@8
+
+52:iname:153.2,7 s
+aDraw->Rect 116.1,139.2 16
+2
+0:min:118.2,5 @7
+
+8:max:119.2,5 @7
+
+aDraw->Point 99.1,113.2 8
+2
+0:x:101.2,3 i
+4:y:102.2,3 i
+aDraw->Screen 249.1,263.2 16
+4
+0:id:251.2,4 i
+4:image:252.2,7 R@5
+
+8:fill:253.2,6 R@5
+
+12:display:254.2,9 R@4
+
+aDraw->Wmcontext 282.1,291.2 28
+7
+0:kbd:284.2,5 Ci
+4:ptr:285.2,5 CR@10
+
+8:ctl:286.2,5 Cs
+12:wctl:287.2,6 Cs
+16:images:288.2,8 CR@5
+
+20:connfd:289.2,8 R@11
+
+24:ctxt:290.2,6 R@3
+
+aDraw->Pointer 266.1,271.2 16
+3
+0:buttons:268.2,9 i
+4:xy:269.2,4 @7
+
+12:msec:270.2,6 i
+aSys->FD 1:45.1,48.2 4
+1
+0:fd:47.2,4 i
+aSys->FileIO 65.1,69.2 8
+2
+0:read:67.2,6 Ct16.4
+0:t0:17,20 i
+4:t1:17,20 i
+8:t2:17,20 i
+12:t3:17,20 @13
+
+
+4:write:68.2,7 Ct16.4
+0:t0:18,21 i
+4:t1:18,21 Ab
+8:t2:18,21 i
+12:t3:18,21 @14
+
+
+Ct8.2
+0:t0:63.22,35 Ab
+4:t1:22,35 s
+Ct8.2
+0:t0:64.23,26 i
+4:t1:23,26 s
+aClient 0:153.0,159.1 20
+5
+0:fid:154.1,4 i
+4:bitdata:155.1,8 Ab
+8:nextmsg:156.1,8 R@16
+
+12:pending:157.1,8 @13
+
+16:pendlen:158.1,8 i
+aMsg 148.0,151.1 8
+2
+0:data:149.1,5 Ab
+4:next:150.1,5 R@16
+
+12
+0:init
+1
+36:args:19.29,33 Ls
+7
+40:bg:36.1,3 R@5
+
+44:display:32.1,8 R@4
+
+48:wb:42.1,3 R@5
+
+52:mntpt:29.1,6 s
+56:bit:54.1,4 R@12
+
+60:strokes:55.1,8 R@12
+
+76:r:41.1,2 @6
+
+n99:srv
+3
+32:wb:62.4,6 R@5
+
+36:bit:19,22 R@12
+
+40:strokes:24,31 R@12
+
+23
+44:c:97.2,3 R@15
+
+48:c:73.2,3 R@15
+
+52:bithdr:65.1,7 Ab
+56:data:77.3,7 Ab
+60:d:102.2,3 Ab
+64:err:116.2,5 s
+68:offset:68.2,8 i
+72:count:10,15 i
+76:fid:17,20 i
+80:r:22,23 @13
+
+84:nwbbytes:64.1,9 i
+108:offset:88.2,8 i
+112:data:10,14 Ab
+116:fid:16,19 i
+120:w:21,22 @14
+
+124:offset:92.2,8 i
+128:count:10,15 i
+132:fid:17,20 i
+136:r:22,23 @13
+
+140:offset:111.2,8 i
+144:data:10,14 Ab
+148:fid:16,19 i
+152:w:21,22 @14
+
+n294:rreply
+2
+32:rc:126.7,9 Ct8.2
+0:t0:20,33 Ab
+4:t1:20,33 s
+
+36:reply:44,49 t8.2
+0:t0:52,65 Ab
+4:t1:52,65 s
+
+0
+n302:wreply
+2
+32:wc:134.7,9 Ct8.2
+0:t0:20,23 i
+4:t1:20,23 s
+
+36:reply:34,39 t8.2
+0:t0:42,45 i
+4:t1:42,45 s
+
+0
+n310:newclient
+1
+32:fid:164.10,13 i
+1
+36:c:166.1,2 R@15
+
+R@15
+321:getclient
+1
+32:fid:171.10,13 i
+2
+36:cl:173.5,7 LR@15
+
+40:c:174.6,7 R@15
+
+R@15
+333:closeclient
+1
+32:fid:179.12,15 i
+2
+36:cl:182.5,7 LR@15
+
+40:nl:181.1,3 LR@15
+
+n345:writeclients
+1
+32:data:188.13,17 Ab
+4
+36:c:195.7,8 R@15
+
+40:cl:194.5,7 LR@15
+
+44:n:196.3,4 i
+48:nm:190.1,3 R@16
+
+n382:drawstrokes
+2
+32:wb:215.12,14 R@5
+
+36:data:27,31 Ab
+8
+40:x:221.16,17 i
+44:y:19,20 i
+48:colour:1,7 i
+52:n:217.2,3 i
+56:toks:5,9 Ls
+60:width:221.9,14 i
+80:p0:230.1,3 @7
+
+88:p1:234.2,4 @7
+
+s467:error
+1
+32:e:242.6,7 s
+0
+n479:badmod
+1
+32:path:253.7,11 s
+0
+n491:saveit
+2
+32:display:259.7,14 R@4
+
+36:img:29,32 R@5
+
+1
+40:fd:263.2,4 R@11
+
+n6
+88:clients:162.0,7 LR@15
+
+92:draw:7.1,5 mDraw
+2:1.0,298.1 0
+
+100:nextmsg:0:161.0,7 R@16
+
+108:pen:213.0,3 R@5
+
+112:pencol:212.0,6 i
+128:sys:4.1,4 mSys
+1:0,160.1 0
+
diff --git a/appl/demo/whiteboard/whiteboard.b b/appl/demo/whiteboard/whiteboard.b
new file mode 100644
index 00000000..ac9f72f1
--- /dev/null
+++ b/appl/demo/whiteboard/whiteboard.b
@@ -0,0 +1,605 @@
+implement Whiteboard;
+
+include "sys.m";
+ sys: Sys;
+
+include "draw.m";
+ draw: Draw;
+ Screen, Display, Image, Rect, Point, Font: import draw;
+
+include "tk.m";
+ tk: Tk;
+
+include "tkclient.m";
+ tkclient: Tkclient;
+
+Whiteboard: module {
+ init: fn(ctxt: ref Draw->Context, args: list of string);
+};
+
+ERASEWIDTH: con 6;
+
+
+stderr: ref Sys->FD;
+srvfd: ref Sys->FD;
+disp: ref Display;
+font: ref Draw->Font;
+drawctxt: ref Draw->Context;
+
+tksetup := array[] of {
+ "frame .f -bd 2",
+ "frame .c -bg white -width 600 -height 400",
+ "menu .penmenu",
+ ".penmenu add command -command {send cmd pen 0} -image pen0",
+ ".penmenu add command -command {send cmd pen 1} -image pen1",
+ ".penmenu add command -command {send cmd pen 2} -image pen2",
+ ".penmenu add command -command {send cmd pen erase} -image erase",
+ "menubutton .pen -menu .penmenu -image pen1",
+ "button .colour -bg black -activebackground black -command {send cmd getcolour}",
+ "pack .c -in .f",
+ "pack .f -side top -anchor center",
+ "pack .pen -side left",
+ "pack .colour -side left -fill both -expand 1",
+ "update",
+};
+
+tkconnected := array[] of {
+ "bind .c <Button-1> {send cmd down %x %y}",
+ "bind .c <ButtonRelease-1> {send cmd up %x %y}",
+ "update",
+};
+
+init(ctxt: ref Draw->Context, args: list of string)
+{
+ sys = load Sys Sys->PATH;
+ sys->pctl(Sys->NEWPGRP, nil);
+ stderr = sys->fildes(2);
+
+ draw = load Draw Draw->PATH;
+ tk = load Tk Tk->PATH;
+
+ tkclient = load Tkclient Tkclient->PATH;
+ if (tkclient == nil)
+ badmod(Tkclient->PATH);
+
+ args = tl args;
+ servicedir := ".";
+ if(args != nil)
+ (servicedir, args) = (hd args, tl args);
+
+ disp = ctxt.display;
+ if (disp == nil) {
+ sys->fprint(stderr, "bad Draw->Context\n");
+ raise "fail:init";
+ }
+ drawctxt = ctxt;
+
+ tkclient->init();
+ (win, winctl) := tkclient->toplevel(ctxt, nil, "Whiteboard", 0);
+ font = Font.open(disp, tkcmd(win, ". cget -font"));
+ if(font == nil)
+ font = Font.open(disp, "*default*");
+ cmd := chan of string;
+ tk->namechan(win, cmd, "cmd");
+ mkpenimgs(win);
+ tkcmds(win, tksetup);
+ tkclient->onscreen(win, nil);
+ tkclient->startinput(win, "kbd" :: "ptr" :: nil);
+ cimage := makeimage(win);
+
+ sc := chan of array of (Point, Point);
+ cc := chan of (string, ref Image, ref Sys->FD);
+ connected := 0;
+ sfd: ref Sys->FD;
+
+ showtext(cimage, "connecting...");
+ spawn connect(servicedir, cc);
+
+ err: string;
+ strokeimg: ref Image;
+Connect:
+ for (;;) alt {
+ (err, strokeimg, sfd) = <-cc =>
+ if (err == nil)
+ break Connect;
+ else
+ showtext(cimage, "Error: " + err);
+
+ s := <-winctl or
+ s = <-win.wreq or
+ s = <-win.ctxt.ctl =>
+ oldimg := win.image;
+ err = tkclient->wmctl(win, s);
+ if(s[0] == '!' && err == nil && win.image != oldimg){
+ cimage = makeimage(win);
+ showtext(cimage, "connecting...");
+ }
+ p := <-win.ctxt.ptr =>
+ tk->pointer(win, *p);
+ c := <-win.ctxt.kbd =>
+ tk->keyboard(win, c);
+ }
+
+ tkcmd(win, ".c configure -width " + string strokeimg.r.dx());
+ tkcmd(win, ".c configure -height " + string strokeimg.r.dy());
+ tkcmds(win, tkconnected);
+ tkcmd(win, "update");
+ cimage.draw(cimage.r, strokeimg, nil, strokeimg.r.min);
+
+ strokesin := chan of (int, int, array of Point);
+ strokesout := chan of (int, int, Point, Point);
+ spawn reader(sfd, strokesin);
+ spawn writer(sfd, strokesout);
+
+ pendown := 0;
+ p0, p1: Point;
+
+ getcolour := 0;
+ white := disp.white;
+ whitepen := disp.newimage(Rect(Point(0,0), Point(1,1)), Draw->CMAP8, 1, Draw->White);
+ pencolour := Draw->Black;
+ penwidth := 1;
+ erase := 0;
+ drawpen := disp.newimage(Rect(Point(0,0), Point(1,1)), Draw->CMAP8, 1, pencolour);
+
+ for (;;) alt {
+ s := <-winctl or
+ s = <-win.ctxt.ctl or
+ s = <-win.wreq =>
+ oldimg := win.image;
+ err = tkclient->wmctl(win, s);
+ if(s[0] == '!' && err == nil && win.image != oldimg){
+ cimage = makeimage(win);
+ cimage.draw(cimage.r, strokeimg, nil, strokeimg.r.min);
+ }
+ p := <-win.ctxt.ptr =>
+ tk->pointer(win, *p);
+ c := <-win.ctxt.kbd =>
+ tk->keyboard(win, c);
+ (colour, width, strokes) := <-strokesin =>
+ if (strokes == nil)
+ tkclient->settitle(win, "Whiteboard (Disconnected)");
+ else {
+ pen := disp.newimage(Rect(Point(0,0), Point(1,1)), Draw->CMAP8, 1, colour);
+ drawstrokes(cimage, cimage.r.min, pen, width, strokes);
+ drawstrokes(strokeimg, strokeimg.r.min, pen, width, strokes);
+ }
+
+ c := <-cmd =>
+ (nil, toks) := sys->tokenize(c, " ");
+ action := hd toks;
+ case action {
+ "up" or
+ "down" =>
+ toks = tl toks;
+ x := int hd toks;
+ y := int hd tl toks;
+ if (action == "down") {
+ if (!pendown) {
+ pendown = 1;
+ p0 = Point(x, y);
+ continue;
+ }
+ } else
+ pendown = 0;
+ p1 = Point(x, y);
+ if (pendown && p1.x == p0.x && p1.y == p0.y)
+ continue;
+ pen := drawpen;
+ colour := pencolour;
+ width := penwidth;
+ if (erase) {
+ pen = whitepen;
+ colour = Draw->White;
+ width = ERASEWIDTH;
+ }
+ drawstroke(cimage, cimage.r.min, p0, p1, pen, width);
+ drawstroke(strokeimg, strokeimg.r.min, p0, p1, pen, width);
+ strokesout <-= (colour, width, p0, p1);
+ p0 = p1;
+
+ "getcolour" =>
+ pendown = 0;
+ if (!getcolour)
+ spawn colourmenu(cmd);
+ "colour" =>
+ pendown = 0;
+ getcolour = 0;
+ toks = tl toks;
+ if (toks == nil)
+ # colourmenu was dismissed
+ continue;
+ erase = 0;
+ tkcmd(win, ".pen configure -image pen" + string penwidth);
+ tkcmd(win, "update");
+ pencolour = int hd toks;
+ toks = tl toks;
+ tkcolour := hd toks;
+ drawpen = disp.newimage(Rect(Point(0,0), Point(1,1)), Draw->CMAP8, 1, pencolour);
+ tkcmd(win, ".colour configure -bg " + tkcolour + " -activebackground " + tkcolour);
+ tkcmd(win, "update");
+
+ "pen" =>
+ pendown = 0;
+ p := hd tl toks;
+ i := "";
+ if (p == "erase") {
+ erase = 1;
+ i = "erase";
+ } else {
+ erase = 0;
+ penwidth = int p;
+ i = "pen"+p;
+ }
+ tkcmd(win, ".pen configure -image " + i);
+ tkcmd(win, "update");
+ }
+
+ }
+}
+
+makeimage(win: ref Tk->Toplevel): ref Draw->Image
+{
+ if(win.image == nil)
+ return nil;
+ scr := Screen.allocate(win.image, win.image.display.white, 0);
+ w := scr.newwindow(tk->rect(win, ".c", Tk->Local), Draw->Refnone, Draw->Nofill);
+ return w;
+}
+
+showtext(img: ref Image, s: string)
+{
+ r := img.r;
+ r.max.y = img.r.min.y + font.height;
+ img.draw(r, disp.white, nil, (0, 0));
+ img.text(r.min, disp.black, (0, 0), font, s);
+}
+
+penmenu(t: ref Tk->Toplevel, p: Point)
+{
+ topy := int tkcmd(t, ".penmenu yposition 0");
+ boty := int tkcmd(t, ".penmenu yposition end");
+ dy := boty - topy;
+ p.y -= dy;
+ tkcmd(t, ".penmenu post " + string p.x + " " + string p.y);
+}
+
+colourcmds := array[] of {
+ "label .l -height 10",
+ "frame .c -height 224 -width 224",
+ "pack .l -fill x -expand 1",
+ "pack .c -side bottom -fill both -expand 1",
+ "pack propagate . 0",
+ "bind .c <Button-1> {send cmd push %x %y}",
+ "bind .c <ButtonRelease-1> {send cmd release}",
+};
+
+lastcolour := "255";
+lasttkcolour := "#000000";
+
+colourmenu(c: chan of string)
+{
+ (t, winctl) := tkclient->toplevel(drawctxt, nil, "Whiteboard", Tkclient->OK);
+ cmd := chan of string;
+ tk->namechan(t, cmd, "cmd");
+ tkcmds(t, colourcmds);
+ tkcmd(t, ".l configure -bg " + lasttkcolour);
+ tkcmd(t, "update");
+ tkclient->onscreen(t, "onscreen");
+ tkclient->startinput(t, "kbd" :: "ptr" :: nil);
+
+ drawcolours(t.image, tk->rect(t, ".c", Tk->Local));
+
+ for(;;) alt {
+ p := <-t.ctxt.ptr =>
+ tk->pointer(t, *p);
+ s := <-t.ctxt.kbd =>
+ tk->keyboard(t, s);
+ s := <-winctl or
+ s = <-t.ctxt.ctl or
+ s = <-t.wreq =>
+ case s{
+ "ok" =>
+ c <-= "colour " + lastcolour + " " + lasttkcolour;
+ return;
+ "exit" =>
+ c <-= "colour";
+ return;
+ * =>
+ oldimage := t.image;
+ e := tkclient->wmctl(t, s);
+ if(s[0] == '!' && e == nil && oldimage != t.image)
+ drawcolours(t.image, tk->rect(t, ".c", Tk->Local));
+ }
+
+ press := <-cmd =>
+ (n, word) := sys->tokenize(press, " ");
+ case hd word {
+ "push" =>
+ (lastcolour, lasttkcolour) = color(int hd tl word, int hd tl tl word, tk->rect(t, ".c", 0).size());
+ tkcmd(t, ".l configure -bg " + lasttkcolour);
+ }
+ }
+}
+
+drawcolours(img: ref Image, cr: Rect)
+{
+ # use writepixels because it's much faster than allocating all those colors.
+ tmp := disp.newimage(((0,0),(cr.dx(),cr.dy()/16+1)), Draw->CMAP8, 0, 0);
+ if(tmp == nil)
+ return;
+ buf := array[tmp.r.dx()*tmp.r.dy()] of byte;
+ dx := cr.dx();
+ dy := cr.dy();
+ for(y:=0; y<16; y++){
+ for(i:=tmp.r.dx()-1; i>=0; --i)
+ buf[i] = byte (16*y+(16*i)/dx);
+ for(k:=tmp.r.dy()-1; k>=1; --k)
+ buf[dx*k:] = buf[0:dx];
+ tmp.writepixels(tmp.r, buf);
+ r: Rect;
+ r.min.x = cr.min.x;
+ r.max.x = cr.max.x;
+ r.min.y = cr.min.y+(dy*y)/16;
+ r.max.y = cr.min.y+(dy*(y+1))/16;
+ img.draw(r, tmp, nil, tmp.r.min);
+ }
+}
+
+color(x, y: int, size: Point): (string, string)
+{
+ x = (16*x)/size.x;
+ y = (16*y)/size.y;
+ col := 16*y+x;
+ (r, g, b) := disp.cmap2rgb(col);
+ tks := sys->sprint("#%.2x%.2x%.2x", r, g, b);
+ return (string disp.cmap2rgba(col), tks);
+}
+
+opensvc(dir: string, svc: string, name: string): (ref Sys->FD, string, string)
+{
+ ctlfd := sys->open(dir+"/ctl", Sys->ORDWR);
+ if(ctlfd == nil)
+ return (nil, nil, sys->sprint("can't open %s/ctl: %r", dir));
+ if(sys->fprint(ctlfd, "%s %s", svc, name) <= 0)
+ return (nil, nil, sys->sprint("can't access %s service %s: %r", svc, name));
+ buf := array [32] of byte;
+ sys->seek(ctlfd, big 0, Sys->SEEKSTART);
+ n := sys->read(ctlfd, buf, len buf);
+ if (n <= 0)
+ return (nil, nil, sys->sprint("%s/ctl: protocol error: %r", dir));
+ return (ctlfd, dir+"/"+string buf[0:n], nil);
+}
+
+connect(dir: string, res: chan of (string, ref Image, ref Sys->FD))
+{
+ bitpath := dir + "/wb.bit";
+ strokepath := dir + "/strokes";
+
+ sfd := sys->open(strokepath, Sys->ORDWR);
+ if (sfd == nil) {
+ err := sys->sprint("cannot open whiteboard data: %r");
+ res <-= (err, nil, nil);
+ srvfd = nil;
+ return;
+ }
+
+ bfd := sys->open(bitpath, Sys->OREAD);
+ if (bfd == nil) {
+ err := sys->sprint("cannot open whiteboard image: %r");
+ res <-= (err, nil, nil);
+ srvfd = nil;
+ return;
+ }
+
+ img := disp.readimage(bfd);
+ if (img == nil) {
+ err := sys->sprint("cannot read whiteboard image: %r");
+ res <-= (err, nil, nil);
+ srvfd = nil;
+ return;
+ }
+
+ # make sure image is depth 8 (because of image.line() bug)
+ if (img.depth != 8) {
+ nimg := disp.newimage(img.r, Draw->CMAP8, 0, 0);
+ if (nimg == nil) {
+ res <-= ("cannot allocate local image", nil, nil);
+ srvfd = nil;
+ return;
+ }
+ nimg.draw(nimg.r, img, nil, img.r.min);
+ img = nimg;
+ }
+
+ res <-= (nil, img, sfd);
+}
+
+mkpenimgs(win: ref Tk->Toplevel)
+{
+ ZP := Point(0,0);
+ pr := Rect((0,0), (13,14));
+ ir := pr.inset(2);
+ midx := ir.dx()/2 + ir.min.x;
+ start := Point(midx, ir.min.y);
+ end := Point(midx, ir.max.y-1);
+
+ i0 := disp.newimage(pr, Draw->GREY1, 0, Draw->White);
+ i1 := disp.newimage(pr, Draw->GREY1, 0, Draw->Black);
+ i2 := disp.newimage(pr, Draw->GREY1, 0, Draw->Black);
+ i3 := disp.newimage(pr, Draw->GREY1, 0, Draw->Black);
+
+ i0.draw(ir, disp.black, nil, ZP);
+ i1.line(start, end, Draw->Endsquare, Draw->Endsquare, 0, disp.white, ZP);
+ i2.line(start, end, Draw->Endsquare, Draw->Endsquare, 1, disp.white, ZP);
+ i3.line(start, end, Draw->Endsquare, Draw->Endsquare, 2, disp.white, ZP);
+
+ tk->cmd(win, "image create bitmap erase");
+ tk->cmd(win, "image create bitmap pen0");
+ tk->cmd(win, "image create bitmap pen1");
+ tk->cmd(win, "image create bitmap pen2");
+
+ tk->putimage(win, "erase", i0, nil);
+ tk->putimage(win, "pen0", i1, nil);
+ tk->putimage(win, "pen1", i2, nil);
+ tk->putimage(win, "pen2", i3, nil);
+}
+
+reader(fd: ref Sys->FD, sc: chan of (int, int, array of Point))
+{
+ buf := array [Sys->ATOMICIO] of byte;
+
+ for (;;) {
+ n := sys->read(fd, buf, len buf);
+ if (n <= 0) {
+ sc <-= (0, 0, nil);
+ return;
+ }
+ s := string buf[0:n];
+ (npts, toks) := sys->tokenize(s, " ");
+ if (npts & 1)
+ # something wrong
+ npts--;
+ if (npts < 6)
+ # ignore
+ continue;
+
+ colour, width: int;
+ (colour, toks) = (int hd toks, tl toks);
+ (width, toks) = (int hd toks, tl toks);
+ pts := array [(npts - 2)/ 2] of Point;
+ for (i := 0; toks != nil; i++) {
+ x, y: int;
+ (x, toks) = (int hd toks, tl toks);
+ (y, toks) = (int hd toks, tl toks);
+ pts[i] = Point(x, y);
+ }
+ sc <-= (colour, width, pts);
+ pts = nil;
+ }
+}
+
+Wmsg: adt {
+ data: array of byte;
+ datalen: int;
+ next: cyclic ref Wmsg;
+};
+
+writer(fd: ref Sys->FD, sc: chan of (int, int, Point, Point))
+{
+ lastcol := -1;
+ lastw := -1;
+ lastpt := Point(-1, -1);
+ curmsg: ref Wmsg;
+ nextmsg: ref Wmsg;
+
+ eofc := chan of int;
+ wc := chan of ref Wmsg;
+ wseof := 0;
+ spawn wslave(fd, wc, eofc);
+
+ for (;;) {
+ colour := -1;
+ width := 0;
+ p0, p1: Point;
+
+ if (curmsg == nil || wseof)
+ (colour, width, p0, p1) = <-sc;
+ else alt {
+ wseof = <-eofc =>
+ ;
+
+ (colour, width, p0, p1) = <-sc =>
+ ;
+
+ wc <-= curmsg =>
+ curmsg = curmsg.next;
+ continue;
+ }
+
+ newseq := 0;
+ if (curmsg == nil) {
+ curmsg = ref Wmsg(array [Sys->ATOMICIO] of byte, 0, nil);
+ nextmsg = curmsg;
+ newseq = 1;
+ }
+
+ if (colour != lastcol || width != lastw || p0.x != lastpt.x || p0.y != lastpt.y)
+ newseq = 1;
+
+ d: array of byte = nil;
+ if (!newseq) {
+ d = sys->aprint(" %d %d", p1.x, p1.y);
+ if (nextmsg.datalen + len d >= Sys->ATOMICIO) {
+ nextmsg.next = ref Wmsg(array [Sys->ATOMICIO] of byte, 0, nil);
+ nextmsg = nextmsg.next;
+ newseq = 1;
+ }
+ }
+ if (newseq) {
+ d = sys->aprint(" %d %d %d %d %d %d", colour, width, p0.x, p0.y, p1.x, p1.y);
+ if (nextmsg.datalen != 0) {
+ nextmsg.next = ref Wmsg(array [Sys->ATOMICIO] of byte, 0, nil);
+ nextmsg = nextmsg.next;
+ }
+ }
+ nextmsg.data[nextmsg.datalen:] = d;
+ nextmsg.datalen += len d;
+ lastcol = colour;
+ lastw = width;
+ lastpt = p1;
+ }
+}
+
+wslave(fd: ref Sys->FD, wc: chan of ref Wmsg, eof: chan of int)
+{
+ for (;;) {
+ wm := <-wc;
+ n := sys->write(fd, wm.data, wm.datalen);
+ if (n != wm.datalen)
+ break;
+ }
+ eof <-= 1;
+}
+
+drawstroke(img: ref Image, offset, p0, p1: Point, pen: ref Image, width: int)
+{
+ p0 = p0.add(offset);
+ p1 = p1.add(offset);
+ img.line(p0, p1, Draw->Enddisc, Draw->Enddisc, width, pen, p0);
+}
+
+drawstrokes(img: ref Image, offset: Point, pen: ref Image, width: int, pts: array of Point)
+{
+ if (len pts < 2)
+ return;
+ p0, p1: Point;
+ p0 = pts[0].add(offset);
+ for (i := 1; i < len pts; i++) {
+ p1 = pts[i].add(offset);
+ img.line(p0, p1, Draw->Enddisc, Draw->Enddisc, width, pen, p0);
+ p0 = p1;
+ }
+}
+
+badmod(mod: string)
+{
+ sys->fprint(stderr, "cannot load %s: %r\n", mod);
+ raise "fail:bad module";
+}
+
+tkcmd(t: ref Tk->Toplevel, cmd: string): string
+{
+ s := tk->cmd(t, cmd);
+ if (s != nil && s[0] == '!') {
+ sys->fprint(stderr, "%s\n", cmd);
+ sys->fprint(stderr, "tk error: %s\n", s);
+ }
+ return s;
+}
+
+tkcmds(t: ref Tk->Toplevel, cmds: array of string)
+{
+ for (i := 0; i < len cmds; i++)
+ tkcmd(t, cmds[i]);
+}
diff --git a/appl/demo/whiteboard/whiteboard.dis b/appl/demo/whiteboard/whiteboard.dis
new file mode 100644
index 00000000..f777f1a6
--- /dev/null
+++ b/appl/demo/whiteboard/whiteboard.dis
Binary files differ
diff --git a/appl/demo/whiteboard/whiteboard.sbl b/appl/demo/whiteboard/whiteboard.sbl
new file mode 100644
index 00000000..395232c1
--- /dev/null
+++ b/appl/demo/whiteboard/whiteboard.sbl
@@ -0,0 +1,1880 @@
+limbo .sbl 2.1
+Whiteboard
+5
+whiteboard.b
+sys.m
+draw.m
+tk.m
+tkclient.m
+1392
+54.1,25 0
+55.1,29 1
+11,23 1
+25,28 1
+1,29 1
+1,29 1
+56.1,24 2
+22,23 2
+1,24 2
+1,24 2
+58.1,28 3
+59.1,22 4
+61.1,40 5
+62.5,20 6
+63.2,24 7
+9,23 7
+2,24 7
+65.1,15 8
+66.1,18 9
+67.4,15 10
+68.24,31 11
+33,40 11
+3,13 11
+15,19 11
+15,19 12
+15,19 13
+70.1,20 14
+71.5,16 15
+72.2,44 16
+14,20 16
+22,43 16
+2,44 16
+2,44 16
+73.2,19 17
+75.1,16 18
+77.1,17 19
+1,17 19
+78.18,64 20
+37,41 20
+43,46 20
+48,60 20
+62,63 20
+18,64 20
+18,64 20
+79.24,50 21
+30,33 21
+35,49 21
+24,50 21
+24,50 21
+1,51 21
+18,22 21
+18,22 21
+18,22 22
+1,51 21
+1,51 21
+80.4,15 23
+81.2,37 24
+19,23 24
+25,36 24
+2,37 24
+2,37 24
+82.1,22 25
+83.1,30 26
+14,17 26
+19,22 26
+24,29 26
+1,30 26
+1,30 26
+1,30 27
+84.1,15 28
+11,14 28
+1,15 28
+85.1,21 29
+8,11 29
+13,20 29
+1,21 29
+86.1,29 30
+20,23 30
+25,28 30
+1,29 30
+87.1,49 31
+22,25 31
+45,48 31
+36,48 31
+27,48 31
+27,48 31
+27,48 32
+1,49 31
+88.1,25 33
+21,24 33
+1,25 33
+1,25 33
+90.1,38 34
+91.1,47 35
+92.1,15 36
+95.1,34 37
+10,16 37
+18,33 37
+1,34 37
+96.1,30 38
+15,25 38
+27,29 38
+1,30 38
+102.27,29 39
+27,29 39
+108.8,14 39
+8,14 39
+109.7,15 39
+7,15 39
+110.7,15 39
+7,19 39
+7,19 40
+7,19 39
+117.8,16 39
+8,20 39
+8,20 41
+8,20 39
+119.8,16 39
+8,20 39
+8,20 42
+8,20 39
+101.10,16 39
+10,16 39
+10,16 39
+10,16 39
+102.2,5 39
+7,16 39
+18,21 39
+18,21 43
+18,21 44
+18,21 45
+103.6,16 46
+104.3,8 47
+106.3,36 48
+12,18 48
+20,35 48
+3,36 48
+3,36 39
+3,36 39
+3,36 39
+111.2,21 49
+112.2,31 50
+24,27 50
+29,30 50
+2,31 50
+2,31 50
+113.5,9 51
+5,16 51
+20,30 51
+34,53 51
+114.3,26 52
+22,25 52
+3,26 52
+3,26 52
+115.3,36 53
+12,18 53
+20,35 53
+3,36 53
+3,36 54
+3,36 55
+3,36 39
+118.2,22 56
+14,17 56
+19,21 56
+2,22 56
+2,22 57
+2,22 39
+120.2,22 58
+15,18 58
+20,21 58
+2,22 58
+2,22 39
+123.44,60 59
+44,55 59
+44,60 59
+44,60 59
+37,60 59
+12,60 59
+1,61 59
+7,10 59
+7,10 59
+7,10 60
+1,61 59
+1,61 59
+1,61 61
+124.45,61 62
+45,56 62
+45,61 62
+45,61 62
+38,61 62
+12,61 62
+1,62 62
+7,10 62
+7,10 62
+7,10 63
+1,62 62
+1,62 62
+1,62 64
+125.1,25 65
+8,11 65
+13,24 65
+1,25 65
+126.1,21 66
+7,10 66
+12,20 66
+1,21 66
+1,21 66
+1,21 67
+127.1,55 68
+1,7 68
+13,21 68
+23,32 68
+34,37 68
+39,54 68
+1,55 68
+129.1,48 69
+130.1,47 70
+131.1,29 71
+14,17 71
+19,28 71
+1,29 71
+132.1,30 72
+14,17 72
+19,29 72
+1,30 72
+134.1,13 73
+137.1,15 74
+138.1,20 75
+139.1,85 76
+13,17 76
+38,39 76
+40,41 76
+50,51 76
+52,53 76
+2:90.18,31 76
+0:139.70,71 76
+73,84 76
+1,85 76
+1,85 76
+140.1,25 77
+141.1,14 78
+142.1,11 79
+143.1,82 80
+12,16 80
+37,38 80
+39,40 80
+49,50 80
+51,52 80
+2:90.18,31 80
+0:143.69,70 80
+72,81 80
+1,82 80
+1,82 80
+146.8,14 81
+8,14 81
+147.7,15 81
+7,19 81
+7,19 82
+7,19 81
+148.7,15 81
+7,15 81
+155.8,16 81
+8,20 81
+8,20 83
+8,20 81
+157.8,16 81
+8,20 81
+8,20 84
+8,20 81
+159.31,40 81
+31,40 81
+168.8,11 81
+8,11 81
+145.10,16 81
+10,16 81
+10,16 81
+10,16 81
+10,16 81
+10,16 81
+149.2,21 85
+150.2,31 86
+24,27 86
+29,30 86
+2,31 86
+2,31 86
+151.5,9 87
+5,16 87
+20,30 87
+34,53 87
+152.3,26 88
+22,25 88
+3,26 88
+3,26 88
+153.3,57 89
+3,9 89
+15,23 89
+25,34 89
+36,39 89
+41,56 89
+3,57 89
+3,57 90
+3,57 91
+3,57 81
+156.2,22 92
+14,17 92
+19,21 92
+2,22 92
+2,22 93
+2,22 81
+158.2,22 94
+15,18 94
+20,21 94
+2,22 94
+2,22 81
+159.29,40 81
+29,40 95
+160.6,20 96
+161.3,55 97
+22,25 97
+27,54 97
+3,55 97
+3,55 97
+3,55 98
+3,55 99
+163.3,77 100
+10,14 100
+35,36 100
+37,38 100
+47,48 100
+49,50 100
+2:90.18,31 100
+0:163.67,68 100
+70,76 100
+3,77 100
+3,77 100
+164.3,57 101
+15,21 101
+23,35 101
+37,40 101
+42,47 101
+49,56 101
+3,57 101
+165.3,63 102
+15,24 102
+26,41 102
+43,46 102
+48,53 102
+55,62 102
+3,63 102
+3,63 103
+3,63 104
+3,63 105
+3,63 81
+169.17,38 106
+31,32 106
+34,37 106
+17,38 106
+17,38 106
+8,12 106
+8,12 107
+170.2,19 108
+171.7,13 109
+174.3,17 110
+175.12,19 111
+3,19 111
+3,19 112
+176.15,22 113
+12,22 113
+3,22 113
+3,22 114
+177.7,23 115
+178.9,16 116
+179.5,16 117
+180.16,17 118
+19,20 118
+19,20 119
+19,20 120
+19,20 121
+19,20 122
+181.5,13 123
+184.4,15 124
+185.14,15 125
+17,18 125
+186.7,14 126
+18,30 126
+34,46 126
+34,46 127
+34,46 128
+34,46 129
+34,46 130
+187.4,12 131
+188.3,17 132
+189.3,22 133
+190.3,20 134
+191.7,12 135
+192.4,18 136
+193.4,24 137
+194.4,22 138
+196.3,55 139
+14,20 139
+22,34 139
+36,38 139
+40,42 139
+44,47 139
+49,54 139
+3,55 139
+197.3,61 140
+14,23 140
+25,40 140
+42,44 140
+46,48 140
+50,53 140
+55,60 140
+3,61 140
+198.19,25 141
+27,32 141
+34,36 141
+38,40 141
+3,41 141
+199.3,10 142
+3,10 143
+3,10 109
+202.3,14 144
+203.8,17 145
+204.4,25 146
+21,24 146
+4,25 146
+4,25 109
+206.3,14 147
+207.3,16 148
+208.3,17 149
+209.7,18 150
+7,18 151
+7,18 152
+7,18 153
+7,18 154
+211.4,12 155
+212.3,12 156
+213.3,60 157
+9,12 157
+44,59 157
+14,59 157
+14,59 158
+3,60 157
+3,60 157
+3,60 159
+214.3,23 160
+9,12 160
+14,22 160
+3,23 160
+3,23 160
+3,23 161
+215.19,26 162
+3,26 162
+3,26 163
+216.3,17 164
+217.3,22 165
+218.3,83 166
+13,17 166
+38,39 166
+40,41 166
+50,51 166
+52,53 166
+2:90.18,31 166
+0:218.70,71 166
+73,82 166
+3,83 166
+3,83 166
+219.3,85 167
+9,12 167
+14,49 167
+14,73 167
+14,84 167
+14,84 168
+3,85 167
+3,85 167
+3,85 169
+220.3,23 170
+9,12 170
+14,22 170
+3,23 170
+3,23 170
+3,23 171
+3,23 172
+3,23 109
+223.3,14 173
+224.11,18 174
+3,18 174
+3,18 175
+225.3,10 176
+226.7,19 177
+227.4,13 178
+228.4,15 179
+4,15 180
+230.4,13 181
+231.4,20 182
+232.4,15 183
+234.3,43 184
+9,12 184
+14,42 184
+3,43 184
+3,43 184
+3,43 185
+235.3,23 186
+9,12 186
+14,22 186
+3,23 186
+3,23 186
+3,23 187
+3,23 188
+3,23 189
+3,23 109
+3,23 190
+3,23 191
+3,23 192
+3,23 81
+243.4,20 193
+244.9,12 194
+2,12 194
+245.1,62 195
+24,33 195
+35,44 195
+35,52 195
+35,58 195
+35,58 196
+60,61 195
+1,62 195
+1,62 195
+246.20,50 197
+29,32 197
+34,38 197
+40,49 197
+20,50 197
+20,50 197
+1,80 197
+6,9 197
+6,9 197
+52,65 197
+67,79 197
+1,80 197
+1,80 197
+247.8,9 198
+1,9 198
+252.1,11 199
+253.11,22 200
+1,36 200
+254.1,37 201
+1,4 201
+10,11 201
+13,23 201
+25,28 201
+31,32 201
+34,35 201
+1,37 201
+255.1,45 202
+1,4 202
+10,15 202
+17,27 202
+30,31 202
+33,34 202
+37,41 202
+43,44 202
+1,45 202
+1,45 202
+256.0,1 203
+282.16,77 204
+35,43 204
+45,48 204
+50,62 204
+64,76 204
+16,77 204
+16,77 204
+283.1,22 205
+284.1,28 206
+14,15 206
+17,20 206
+22,27 206
+1,28 206
+1,28 206
+1,28 207
+285.1,22 208
+8,9 208
+11,21 208
+1,22 208
+286.1,45 209
+7,8 209
+10,44 209
+1,45 209
+1,45 209
+1,45 210
+287.1,19 211
+7,8 211
+10,18 211
+1,19 211
+1,19 211
+1,19 212
+288.1,34 213
+20,21 213
+23,33 213
+1,34 213
+289.1,47 214
+22,23 214
+43,46 214
+34,46 214
+25,46 214
+25,46 214
+25,46 215
+1,47 214
+291.22,50 216
+31,32 216
+34,38 216
+40,49 216
+22,50 216
+22,50 216
+1,51 216
+13,20 216
+13,20 216
+1,51 216
+294.8,14 217
+8,18 217
+8,18 218
+8,18 217
+296.8,14 217
+8,18 217
+8,18 219
+8,18 217
+298.8,14 217
+8,14 217
+299.7,13 217
+7,17 217
+7,17 220
+7,17 217
+300.7,13 217
+7,13 217
+315.12,15 217
+12,15 217
+293.9,15 217
+9,15 217
+9,15 217
+9,15 217
+295.2,20 221
+14,15 221
+17,19 221
+2,20 221
+2,20 222
+2,20 217
+297.2,20 223
+15,16 223
+18,19 223
+2,20 223
+2,20 217
+301.7,8 224
+7,8 224
+7,8 224
+303.9,31 225
+9,37 225
+9,52 225
+3,52 225
+3,52 226
+304.3,9 227
+306.3,17 228
+307.3,9 229
+309.3,22 230
+310.3,29 231
+24,25 231
+27,28 231
+3,29 231
+3,29 231
+311.6,10 232
+6,17 232
+21,29 232
+33,52 232
+312.25,53 233
+34,35 233
+37,41 233
+43,52 233
+25,53 233
+25,53 233
+4,54 233
+16,23 233
+16,23 233
+4,54 233
+4,54 234
+4,54 235
+4,54 224
+4,54 236
+4,54 217
+316.15,40 237
+29,34 237
+36,39 237
+15,40 237
+15,40 237
+3,4 237
+6,10 237
+6,10 238
+317.7,14 239
+7,14 239
+319.73,93 240
+82,83 240
+85,89 240
+91,92 240
+73,93 240
+73,93 240
+73,100 240
+73,100 240
+73,100 240
+73,100 240
+32,101 240
+45,52 240
+42,52 240
+38,52 240
+38,52 241
+64,71 240
+61,71 240
+58,71 240
+54,71 240
+54,71 242
+54,71 240
+32,101 240
+32,101 240
+4,14 240
+16,28 240
+16,28 243
+16,28 244
+320.3,47 245
+9,10 245
+12,46 245
+3,47 245
+3,47 245
+3,47 246
+3,47 239
+3,47 247
+3,47 248
+3,47 217
+328.24,25 249
+26,27 249
+30,37 249
+30,32 249
+30,37 249
+30,37 249
+38,45 249
+38,40 249
+38,45 249
+38,45 249
+38,48 249
+38,50 249
+1,72 249
+8,12 249
+8,12 249
+2:90.18,31 249
+0:328.67,68 249
+70,71 249
+1,72 249
+1,72 249
+329.4,14 250
+330.2,8 251
+331.14,24 252
+14,19 252
+14,24 252
+14,24 252
+25,35 252
+25,30 252
+25,35 252
+25,35 252
+14,35 252
+1,44 252
+332.1,14 253
+7,9 253
+1,14 253
+1,14 253
+333.1,14 254
+7,9 254
+1,14 254
+1,14 254
+334.5,9 255
+11,15 256
+335.9,19 257
+9,14 257
+9,19 257
+9,19 257
+6,21 257
+23,27 258
+336.3,9 259
+18,22 259
+23,29 259
+23,32 259
+17,33 259
+3,33 259
+335.29,32 260
+29,32 260
+337.9,19 261
+9,14 261
+9,19 261
+9,19 261
+6,21 261
+23,27 262
+338.7,11 263
+16,19 263
+16,25 263
+3,25 263
+3,25 264
+337.29,32 265
+29,32 265
+339.2,29 266
+2,5 266
+18,23 266
+25,28 266
+2,29 266
+2,29 266
+341.2,20 267
+342.2,20 268
+343.21,27 269
+21,30 269
+2,30 269
+344.25,30 270
+21,31 270
+21,34 270
+2,34 270
+345.2,34 271
+2,5 271
+11,12 271
+14,17 271
+19,22 271
+24,33 271
+2,34 271
+334.17,20 272
+17,20 272
+347.0,1 273
+351.5,11 274
+1,18 274
+352.5,11 275
+1,18 275
+353.8,12 276
+1,14 276
+354.14,32 277
+14,18 277
+28,31 277
+14,32 277
+14,32 277
+355.1,45 278
+20,35 278
+37,38 278
+40,41 278
+43,44 278
+1,45 278
+1,45 278
+356.16,35 279
+16,20 279
+31,34 279
+16,35 279
+16,35 279
+9,35 279
+37,40 279
+1,41 279
+376.1,27 280
+377.1,31 281
+379.1,41 282
+18,28 282
+30,40 282
+1,41 282
+1,41 282
+380.5,15 283
+381.2,55 284
+21,54 284
+2,55 284
+2,55 284
+382.11,14 285
+16,19 285
+21,24 285
+2,25 285
+2,25 286
+2,25 287
+2,25 288
+383.2,13 289
+384.2,8 290
+387.1,38 291
+18,25 291
+27,37 291
+1,38 291
+1,38 291
+388.5,15 292
+389.2,56 293
+21,55 293
+2,56 293
+2,56 293
+390.11,14 294
+16,19 294
+21,24 294
+2,25 294
+2,25 295
+2,25 296
+2,25 297
+391.2,13 298
+392.2,8 299
+395.1,27 300
+8,12 300
+23,26 300
+1,27 300
+1,27 300
+396.5,15 301
+397.2,56 302
+21,55 302
+2,56 302
+2,56 302
+398.11,14 303
+16,19 303
+21,24 303
+2,25 303
+2,25 304
+2,25 305
+2,25 306
+399.2,13 307
+400.2,8 308
+404.5,19 309
+405.2,49 310
+10,14 310
+24,29 310
+2:90.18,31 310
+0:405.44,45 310
+47,48 310
+2,49 310
+2,49 310
+406.6,17 311
+407.12,41 312
+43,46 312
+48,51 312
+3,52 312
+3,52 313
+3,52 314
+3,52 315
+408.3,14 316
+409.3,9 317
+411.2,40 318
+2,6 318
+12,18 318
+20,23 318
+25,28 318
+30,39 318
+2,40 318
+412.2,12 319
+2,12 320
+415.10,13 321
+15,18 321
+20,23 321
+1,24 321
+1,24 322
+1,24 323
+1,24 324
+416.0,1 325
+420.13,14 326
+15,16 326
+421.13,14 327
+15,16 327
+20,22 327
+23,25 327
+422.1,18 328
+7,9 328
+16,17 328
+1,18 328
+1,18 328
+423.9,16 329
+9,11 329
+9,16 329
+9,16 329
+9,18 329
+1,29 329
+424.16,20 330
+22,30 330
+425.14,18 331
+20,30 331
+427.1,53 332
+7,11 332
+21,23 332
+2:86.18,32 332
+0:427.38,39 332
+41,52 332
+1,53 332
+1,53 332
+428.1,53 333
+7,11 333
+21,23 333
+2:86.18,32 333
+0:428.38,39 333
+41,52 333
+1,53 333
+1,53 333
+429.1,53 334
+7,11 334
+21,23 334
+2:86.18,32 334
+0:429.38,39 334
+41,52 334
+1,53 334
+1,53 334
+430.1,53 335
+7,11 335
+21,23 335
+2:86.18,32 335
+0:430.38,39 335
+41,52 335
+1,53 335
+1,53 335
+432.1,33 336
+1,3 336
+9,11 336
+13,23 336
+25,28 336
+30,32 336
+1,33 336
+433.1,73 337
+1,3 337
+9,14 337
+16,19 337
+21,36 337
+38,53 337
+55,56 337
+58,68 337
+70,72 337
+1,73 337
+434.1,73 338
+1,3 338
+9,14 338
+16,19 338
+21,36 338
+38,53 338
+55,56 338
+58,68 338
+70,72 338
+1,73 338
+435.1,73 339
+1,3 339
+9,14 339
+16,19 339
+21,36 339
+38,53 339
+55,56 339
+58,68 339
+70,72 339
+1,73 339
+437.1,42 340
+9,12 340
+14,41 340
+1,42 340
+1,42 340
+1,42 341
+438.1,41 342
+9,12 342
+14,40 342
+1,41 342
+1,41 342
+1,41 343
+439.1,41 344
+9,12 344
+14,40 344
+1,41 344
+1,41 344
+1,41 345
+440.1,41 346
+9,12 346
+14,40 346
+1,41 346
+1,41 346
+1,41 347
+442.1,36 348
+14,17 348
+19,26 348
+28,30 348
+32,35 348
+1,36 348
+1,36 348
+1,36 349
+443.1,35 350
+14,17 350
+19,25 350
+27,29 350
+31,34 350
+1,35 350
+1,35 350
+1,35 351
+444.1,35 352
+14,17 352
+19,25 352
+27,29 352
+31,34 352
+1,35 352
+1,35 352
+1,35 353
+445.1,35 354
+14,17 354
+19,25 354
+27,29 354
+31,34 354
+1,35 354
+1,35 354
+1,35 355
+446.0,1 356
+450.1,37 357
+453.2,34 358
+17,19 358
+21,24 358
+26,33 358
+2,34 358
+2,34 358
+454.6,12 359
+455.11,12 360
+14,15 360
+17,20 360
+3,21 360
+3,21 361
+456.3,9 362
+458.14,17 363
+14,22 363
+2,22 363
+2,22 364
+459.18,39 365
+32,33 365
+35,38 365
+18,39 365
+18,39 365
+3,7 365
+9,13 365
+9,13 366
+460.6,14 367
+6,14 367
+462.3,9 368
+463.6,14 369
+6,14 370
+6,14 371
+6,14 372
+465.3,11 373
+468.24,31 374
+20,31 374
+20,31 375
+33,40 374
+3,9 374
+11,15 374
+11,15 376
+469.23,30 377
+19,30 377
+19,30 378
+32,39 377
+3,8 377
+10,14 377
+10,14 379
+470.16,26 380
+16,29 380
+2,39 380
+471.7,13 381
+15,26 382
+473.20,27 383
+16,27 383
+16,27 384
+29,36 383
+4,5 383
+7,11 383
+7,11 385
+474.20,27 386
+16,27 386
+16,27 387
+29,36 386
+4,5 386
+7,11 386
+7,11 388
+475.18,19 389
+21,22 389
+3,9 389
+3,23 389
+471.28,31 390
+28,31 390
+477.10,16 391
+18,23 391
+25,28 391
+2,29 391
+2,29 392
+478.2,11 393
+2,11 394
+2,11 395
+2,11 396
+2,11 396
+490.1,14 397
+491.1,12 398
+492.17,19 399
+21,23 399
+496.1,20 400
+497.1,23 401
+498.1,11 402
+499.1,27 403
+14,16 403
+18,20 403
+22,26 403
+1,27 403
+502.2,14 404
+503.2,12 405
+506.6,19 406
+23,28 406
+507.29,33 407
+4,10 407
+12,17 407
+19,21 407
+23,25 407
+23,25 408
+509.12,16 409
+12,16 409
+512.30,32 409
+30,32 409
+515.2,4 409
+2,4 409
+508.7,13 409
+7,13 409
+7,13 409
+7,13 409
+7,13 409
+512.3,9 409
+11,16 409
+18,20 409
+22,24 409
+22,24 409
+516.3,23 410
+3,23 411
+517.3,11 412
+520.2,13 413
+521.6,19 414
+522.3,59 415
+21,50 415
+52,53 415
+55,58 415
+3,59 415
+3,59 416
+523.3,19 417
+524.3,13 418
+527.6,23 419
+27,41 419
+45,61 419
+65,81 419
+528.3,13 420
+530.21,24 421
+531.7,13 422
+532.3,40 423
+19,27 423
+29,33 423
+35,39 423
+3,40 423
+3,40 423
+533.25,30 424
+7,22 424
+7,30 424
+7,47 424
+534.4,66 425
+28,57 425
+59,60 425
+62,65 425
+4,66 425
+4,66 426
+535.4,26 427
+536.4,14 428
+539.6,12 429
+540.3,79 430
+19,39 430
+41,47 430
+49,54 430
+56,60 430
+62,66 430
+68,72 430
+74,78 430
+3,79 430
+3,79 430
+541.7,27 431
+542.4,66 432
+28,57 432
+59,60 432
+62,65 432
+4,66 432
+4,66 433
+543.4,26 434
+546.15,30 435
+2,36 435
+547.21,26 436
+2,26 436
+548.2,18 437
+549.2,15 438
+550.2,13 439
+2,13 440
+2,13 440
+557.2,12 441
+558.2,42 442
+18,20 442
+22,29 442
+31,41 442
+2,42 442
+2,42 442
+559.6,21 443
+6,21 444
+560.3,8 445
+3,8 446
+3,8 446
+562.1,10 447
+563.0,1 448
+567.1,20 449
+6,8 449
+13,19 449
+1,20 449
+1,20 449
+568.1,20 450
+6,8 450
+13,19 450
+1,20 450
+1,20 450
+569.1,63 451
+1,4 451
+10,12 451
+14,16 451
+18,31 451
+33,46 451
+48,53 451
+55,58 451
+60,62 451
+1,63 451
+570.0,1 452
+574.5,12 453
+5,16 453
+575.2,8 454
+577.1,24 455
+6,12 455
+6,12 455
+17,23 455
+1,24 455
+1,24 455
+578.6,12 456
+18,25 457
+14,25 457
+579.2,25 458
+7,13 458
+7,13 458
+18,24 458
+2,25 458
+2,25 458
+580.2,64 459
+2,5 459
+11,13 459
+15,17 459
+19,32 459
+34,47 459
+49,54 459
+56,59 459
+61,63 459
+2,64 459
+581.2,9 460
+578.27,30 461
+27,30 461
+583.0,1 462
+587.1,49 463
+13,19 463
+21,43 463
+45,48 463
+1,49 463
+1,49 463
+588.1,24 464
+593.1,21 465
+14,15 465
+17,20 465
+1,21 465
+1,21 465
+594.5,13 466
+17,21 466
+17,28 466
+595.2,34 467
+14,20 467
+22,28 467
+30,33 467
+2,34 467
+2,34 467
+596.2,42 468
+14,20 468
+22,38 468
+40,41 468
+2,42 468
+2,42 468
+598.8,9 469
+1,9 469
+603.6,12 470
+18,26 471
+14,26 471
+604.2,19 472
+8,9 472
+11,18 472
+11,18 472
+2,19 472
+2,19 472
+2,19 473
+603.28,31 474
+28,31 474
+605.0,1 475
+15
+aSys->Dir 1:26.1,39.2 64
+11
+0:name:28.2,6 s
+4:uid:29.2,5 s
+8:gid:30.2,5 s
+12:muid:31.2,6 s
+16:qid:32.2,5 @1
+
+32:mode:33.2,6 i
+36:atime:34.2,7 i
+40:mtime:35.2,7 i
+48:length:36.2,8 B
+56:dtype:37.2,7 i
+60:dev:38.2,5 i
+aSys->Qid 11.1,16.2 16
+3
+0:path:13.2,6 B
+8:vers:14.2,6 i
+12:qtype:15.2,7 i
+aDraw->Chans 2:70.1,82.2 4
+1
+0:desc:72.2,6 i
+aDraw->Context 274.1,279.2 12
+3
+0:display:276.2,9 R@4
+
+4:screen:277.2,8 R@8
+
+8:wm:278.2,4 Ct8.2
+0:t0:15,21 s
+4:t1:15,21 Ct8.2
+0:t0:32,38 s
+4:t1:32,38 R@9
+
+
+
+aDraw->Display 201.1,230.2 20
+5
+0:image:203.2,7 R@5
+
+4:white:204.2,7 R@5
+
+8:black:205.2,7 R@5
+
+12:opaque:206.2,8 R@5
+
+16:transparent:207.2,13 R@5
+
+aDraw->Image 142.1,198.2 56
+8
+0:r:146.2,3 @6
+
+16:clipr:147.2,7 @6
+
+32:depth:148.2,7 i
+36:chans:149.2,7 @2
+
+40:repl:150.2,6 i
+44:display:151.2,9 R@4
+
+48:screen:152.2,8 R@8
+
+52:iname:153.2,7 s
+aDraw->Rect 116.1,139.2 16
+2
+0:min:118.2,5 @7
+
+8:max:119.2,5 @7
+
+aDraw->Point 99.1,113.2 8
+2
+0:x:101.2,3 i
+4:y:102.2,3 i
+aDraw->Screen 249.1,263.2 16
+4
+0:id:251.2,4 i
+4:image:252.2,7 R@5
+
+8:fill:253.2,6 R@5
+
+12:display:254.2,9 R@4
+
+aDraw->Wmcontext 282.1,291.2 28
+7
+0:kbd:284.2,5 Ci
+4:ptr:285.2,5 CR@10
+
+8:ctl:286.2,5 Cs
+12:wctl:287.2,6 Cs
+16:images:288.2,8 CR@5
+
+20:connfd:289.2,8 R@11
+
+24:ctxt:290.2,6 R@3
+
+aDraw->Pointer 266.1,271.2 16
+3
+0:buttons:268.2,9 i
+4:xy:269.2,4 @7
+
+12:msec:270.2,6 i
+aSys->FD 1:45.1,48.2 4
+1
+0:fd:47.2,4 i
+aTk->Toplevel 3:5.1,12.2 32
+5
+0:display:7.2,9 R@4
+
+4:wreq:8.2,6 Cs
+8:image:9.2,7 R@5
+
+12:ctxt:10.2,6 R@9
+
+16:screenr:11.2,9 @6
+
+aWmsg 0:482.0,486.1 12
+3
+0:data:483.1,5 Ab
+4:datalen:484.1,8 i
+8:next:485.1,5 R@13
+
+aDraw->Font 2:233.1,246.2 16
+4
+0:name:235.2,6 s
+4:height:236.2,8 i
+8:ascent:237.2,8 i
+12:display:238.2,9 R@4
+
+16
+0:init
+2
+32:ctxt:0:52.5,9 R@3
+
+36:args:30,34 Ls
+46
+40:win:78.2,5 R@12
+
+44:winctl:7,13 Cs
+48:cimage:88.1,7 R@5
+
+52:toks:169.8,12 Ls
+56:strokeimg:99.1,10 R@5
+
+60:err:98.1,4 s
+64:erase:142.1,6 i
+68:pencolour:140.1,10 i
+72:s:108.1,2 s
+76:s:146.1,2 s
+80:width:190.3,8 i
+84:cmd:82.1,4 Cs
+88:i:225.3,4 s
+92:p:224.3,4 s
+96:pen:188.3,6 R@5
+
+100:penwidth:141.1,9 i
+104:action:170.2,8 s
+108:cc:91.1,3 Ct12.3
+0:t0:16,22 s
+4:t1:16,22 R@5
+
+8:t2:16,22 R@11
+
+
+112:colour:189.3,9 i
+116:drawpen:143.1,8 R@5
+
+120:getcolour:137.1,10 i
+124:pen:163.3,6 R@5
+
+128:servicedir:66.1,11 s
+132:sfd:93.1,4 R@11
+
+136:strokesin:129.1,10 Ct12.3
+0:t0:23,26 i
+4:t1:23,26 i
+8:t2:23,26 A@7
+
+
+140:strokesout:130.1,11 Ct24.4
+0:t0:24,27 i
+4:t1:24,27 i
+8:t2:24,27 @7
+
+16:t3:24,27 @7
+
+
+144:tkcolour:217.3,11 s
+148:y:176.3,4 i
+152:c:119.1,2 i
+156:c:157.1,2 i
+160:c:168.1,2 s
+164:colour:159.2,8 i
+168:width:10,15 i
+172:strokes:17,24 A@7
+
+176:oldimg:111.2,8 R@5
+
+180:oldimg:149.2,8 R@5
+
+184:p:117.1,2 R@10
+
+188:p:155.1,2 R@10
+
+192:whitepen:139.1,9 R@5
+
+216:connected:92.1,10 i
+220:sc:90.1,3 CAt16.2
+0:t0:25,30 @7
+
+8:t1:25,30 @7
+
+
+224:white:138.1,6 R@5
+
+228:p0:135.1,3 @7
+
+236:p1:5,7 @7
+
+152:pendown:134.1,8 i
+156:x:175.3,4 i
+n516:makeimage
+1
+32:win:241.10,13 R@12
+
+2
+36:scr:245.1,4 R@8
+
+40:w:246.1,2 R@5
+
+R@5
+543:showtext
+2
+32:img:250.9,12 R@5
+
+36:s:25,26 s
+1
+44:r:252.1,2 @6
+
+n565:colourmenu
+1
+32:c:280.11,12 Cs
+11
+36:t:282.2,3 R@12
+
+40:winctl:5,11 Cs
+44:s:298.1,2 s
+48:cmd:283.1,4 Cs
+52:e:310.3,4 s
+56:oldimage:309.3,11 R@5
+
+60:p:294.1,2 R@10
+
+64:press:315.1,6 s
+68:s:296.1,2 i
+88:n:316.3,4 i
+92:word:6,10 Ls
+n734:drawcolours
+2
+32:img:325.12,15 R@5
+
+36:cr:28,30 @6
+
+8
+52:tmp:328.1,4 R@5
+
+56:y:334.5,6 i
+60:buf:331.1,4 Ab
+64:i:335.6,7 i
+68:dx:332.1,3 i
+72:k:337.6,7 i
+76:dy:333.1,3 i
+96:r:340.2,3 @6
+
+n828:color
+3
+32:x:349.6,7 i
+36:y:9,10 i
+40:size:17,21 @7
+
+5
+48:col:353.1,4 i
+52:r:354.2,3 i
+56:g:5,6 i
+60:b:8,9 i
+64:tks:355.1,4 s
+t8.2
+0:t0:349.32,38 s
+4:t1:32,38 s
+854:connect
+2
+32:dir:374.8,11 s
+36:res:21,24 Ct12.3
+0:t0:35,41 s
+4:t1:35,41 R@5
+
+8:t2:35,41 R@11
+
+
+9
+40:img:395.1,4 R@5
+
+44:nimg:405.2,6 R@5
+
+48:bfd:387.1,4 R@11
+
+52:sfd:379.1,4 R@11
+
+56:bitpath:376.1,8 s
+60:err:381.2,5 s
+64:err:389.2,5 s
+68:err:397.2,5 s
+72:strokepath:377.1,11 s
+n949:mkpenimgs
+1
+32:win:418.10,13 R@12
+
+10
+36:i0:427.1,3 R@5
+
+40:i1:428.1,3 R@5
+
+44:i2:429.1,3 R@5
+
+48:i3:430.1,3 R@5
+
+52:midx:423.1,5 i
+68:ir:422.1,3 @6
+
+84:pr:421.1,3 @6
+
+100:ZP:420.1,3 @7
+
+108:end:425.1,4 @7
+
+116:start:424.1,6 @7
+
+n1096:reader
+2
+32:fd:448.7,9 R@11
+
+36:sc:24,26 Ct12.3
+0:t0:37,40 i
+4:t1:37,40 i
+8:t2:37,40 A@7
+
+
+11
+40:npts:459.3,7 i
+44:toks:9,13 Ls
+48:buf:450.1,4 Ab
+52:pts:470.2,5 A@7
+
+56:i:471.7,8 i
+60:n:453.2,3 i
+64:colour:467.2,8 i
+68:s:458.2,3 s
+72:width:467.10,15 i
+76:x:472.3,4 i
+80:y:6,7 i
+n1179:writer
+2
+32:fd:488.7,9 R@11
+
+36:sc:24,26 Ct24.4
+0:t0:37,40 i
+4:t1:37,40 i
+8:t2:37,40 @7
+
+16:t3:37,40 @7
+
+
+14
+40:nextmsg:494.1,8 R@13
+
+44:curmsg:493.1,7 R@13
+
+48:colour:502.2,8 i
+52:d:530.2,3 Ab
+56:newseq:520.2,8 i
+60:width:503.2,7 i
+64:eofc:496.1,5 Ci
+68:lastcol:490.1,8 i
+72:lastw:491.1,6 i
+76:wc:497.1,3 CR@13
+
+80:wseof:498.1,6 i
+96:p1:504.6,8 @7
+
+104:p0:2,4 @7
+
+112:lastpt:492.1,7 @7
+
+n1283:wslave
+3
+32:fd:554.7,9 R@11
+
+36:wc:24,26 CR@13
+
+40:eof:46,49 Ci
+2
+44:wm:557.2,4 R@13
+
+48:n:558.2,3 i
+n1297:drawstroke
+6
+32:img:565.11,14 R@5
+
+36:offset:27,33 @7
+
+44:p0:35,37 @7
+
+52:p1:39,41 @7
+
+60:pen:50,53 R@5
+
+64:width:66,71 i
+0
+n1318:drawstrokes
+5
+32:img:572.12,15 R@5
+
+36:offset:28,34 @7
+
+44:pen:43,46 R@5
+
+48:width:59,64 i
+52:pts:71,74 A@7
+
+3
+56:i:578.6,7 i
+68:p0:576.1,3 @7
+
+76:p1:5,7 @7
+
+n1350:badmod
+1
+32:mod:585.7,10 s
+0
+n1357:tkcmd
+2
+32:t:591.6,7 R@12
+
+36:cmd:27,30 s
+1
+40:s:593.1,2 s
+s1379:tkcmds
+2
+32:t:601.7,8 R@12
+
+36:cmds:28,32 As
+1
+40:i:603.6,7 i
+n12
+360:colourcmds:267.0,10 As
+368:disp:25.0,4 R@4
+
+376:draw:7.1,5 mDraw
+2:1.0,298.1 0
+
+380:drawctxt:0:27.0,8 R@3
+
+396:font:26.0,4 R@14
+
+456:srvfd:24.0,5 R@11
+
+460:stderr:23.0,6 R@11
+
+464:sys:4.1,4 mSys
+1:0,160.1 0
+
+468:tk:0:11.1,3 mTk
+3:1.0,25.1 0
+
+476:tkclient:0:14.1,9 mTkclient
+4:1.0,26.1 0
+
+480:tkconnected:0:46.0,11 As
+484:tksetup:29.0,7 As