diff options
Diffstat (limited to 'appl/demo/odbc')
| -rw-r--r-- | appl/demo/odbc/mkfile | 31 | ||||
| -rw-r--r-- | appl/demo/odbc/odbcmnt.b | 428 | ||||
| -rw-r--r-- | appl/demo/odbc/odbcmnt.dis | bin | 0 -> 8085 bytes | |||
| -rw-r--r-- | appl/demo/odbc/odbcmnt.sbl | 1602 | ||||
| -rwxr-xr-x | appl/demo/odbc/runodbc.sh | 17 |
5 files changed, 2078 insertions, 0 deletions
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 Binary files differnew file mode 100644 index 00000000..dec2e403 --- /dev/null +++ b/appl/demo/odbc/odbcmnt.dis 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 + |
