Artifact
865b7f7efb4df30b3dc21d0080ad76e34ad3eba4:
- File
net2o-log.fs
— part of check-in
[c9e72787fa]
at
2015-05-20 23:09:55
on branch trunk
— Multi-chat started
(user:
bernd
size: 2105)
0000: 5c 20 6c 6f 67 20 64 75 6d 70 20 63 6c 61 73 73 \ log dump class
0010: 0a 0a 5c 20 43 6f 70 79 72 69 67 68 74 20 28 43 ..\ Copyright (C
0020: 29 20 32 30 31 31 2d 32 30 31 34 20 20 20 42 65 ) 2011-2014 Be
0030: 72 6e 64 20 50 61 79 73 61 6e 0a 0a 5c 20 54 68 rnd Paysan..\ Th
0040: 69 73 20 70 72 6f 67 72 61 6d 20 69 73 20 66 72 is program is fr
0050: 65 65 20 73 6f 66 74 77 61 72 65 3a 20 79 6f 75 ee software: you
0060: 20 63 61 6e 20 72 65 64 69 73 74 72 69 62 75 74 can redistribut
0070: 65 20 69 74 20 61 6e 64 2f 6f 72 20 6d 6f 64 69 e it and/or modi
0080: 66 79 0a 5c 20 69 74 20 75 6e 64 65 72 20 74 68 fy.\ it under th
0090: 65 20 74 65 72 6d 73 20 6f 66 20 74 68 65 20 47 e terms of the G
00a0: 4e 55 20 41 66 66 65 72 6f 20 47 65 6e 65 72 61 NU Affero Genera
00b0: 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 l Public License
00c0: 20 61 73 20 70 75 62 6c 69 73 68 65 64 20 62 79 as published by
00d0: 0a 5c 20 74 68 65 20 46 72 65 65 20 53 6f 66 74 .\ the Free Soft
00e0: 77 61 72 65 20 46 6f 75 6e 64 61 74 69 6f 6e 2c ware Foundation,
00f0: 20 65 69 74 68 65 72 20 76 65 72 73 69 6f 6e 20 either version
0100: 33 20 6f 66 20 74 68 65 20 4c 69 63 65 6e 73 65 3 of the License
0110: 2c 20 6f 72 0a 5c 20 28 61 74 20 79 6f 75 72 20 , or.\ (at your
0120: 6f 70 74 69 6f 6e 29 20 61 6e 79 20 6c 61 74 65 option) any late
0130: 72 20 76 65 72 73 69 6f 6e 2e 0a 0a 5c 20 54 68 r version...\ Th
0140: 69 73 20 70 72 6f 67 72 61 6d 20 69 73 20 64 69 is program is di
0150: 73 74 72 69 62 75 74 65 64 20 69 6e 20 74 68 65 stributed in the
0160: 20 68 6f 70 65 20 74 68 61 74 20 69 74 20 77 69 hope that it wi
0170: 6c 6c 20 62 65 20 75 73 65 66 75 6c 2c 0a 5c 20 ll be useful,.\
0180: 62 75 74 20 57 49 54 48 4f 55 54 20 41 4e 59 20 but WITHOUT ANY
0190: 57 41 52 52 41 4e 54 59 3b 20 77 69 74 68 6f 75 WARRANTY; withou
01a0: 74 20 65 76 65 6e 20 74 68 65 20 69 6d 70 6c 69 t even the impli
01b0: 65 64 20 77 61 72 72 61 6e 74 79 20 6f 66 0a 5c ed warranty of.\
01c0: 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 MERCHANTABILITY
01d0: 20 6f 72 20 46 49 54 4e 45 53 53 20 46 4f 52 20 or FITNESS FOR
01e0: 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55 52 A PARTICULAR PUR
01f0: 50 4f 53 45 2e 20 20 53 65 65 20 74 68 65 0a 5c POSE. See the.\
0200: 20 47 4e 55 20 41 66 66 65 72 6f 20 47 65 6e 65 GNU Affero Gene
0210: 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e ral Public Licen
0220: 73 65 20 66 6f 72 20 6d 6f 72 65 20 64 65 74 61 se for more deta
0230: 69 6c 73 2e 0a 0a 5c 20 59 6f 75 20 73 68 6f 75 ils...\ You shou
0240: 6c 64 20 68 61 76 65 20 72 65 63 65 69 76 65 64 ld have received
0250: 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 47 a copy of the G
0260: 4e 55 20 41 66 66 65 72 6f 20 47 65 6e 65 72 61 NU Affero Genera
0270: 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 l Public License
0280: 0a 5c 20 61 6c 6f 6e 67 20 77 69 74 68 20 74 68 .\ along with th
0290: 69 73 20 70 72 6f 67 72 61 6d 2e 20 20 49 66 20 is program. If
02a0: 6e 6f 74 2c 20 73 65 65 20 3c 68 74 74 70 3a 2f not, see <http:/
02b0: 2f 77 77 77 2e 67 6e 75 2e 6f 72 67 2f 6c 69 63 /www.gnu.org/lic
02c0: 65 6e 73 65 73 2f 3e 2e 0a 0a 72 65 70 6c 79 2d enses/>...reply-
02d0: 74 61 62 6c 65 20 24 40 20 69 6e 68 65 72 69 74 table $@ inherit
02e0: 2d 74 61 62 6c 65 20 6c 6f 67 2d 74 61 62 6c 65 -table log-table
02f0: 0a 0a 67 65 74 2d 63 75 72 72 65 6e 74 20 61 6c ..get-current al
0300: 73 6f 20 6e 65 74 32 6f 2d 62 61 73 65 20 64 65 so net2o-base de
0310: 66 69 6e 69 74 69 6f 6e 73 0a 5c 67 20 0a 5c 67 finitions.\g .\g
0320: 20 23 23 23 20 6c 6f 67 20 63 6f 6d 6d 61 6e 64 ### log command
0330: 73 20 23 23 23 0a 5c 67 20 0a 6e 65 74 32 6f 27 s ###.\g .net2o'
0340: 20 74 6f 6b 65 6e 20 6e 65 74 32 6f 3a 20 6c 6f token net2o: lo
0350: 67 2d 74 6f 6b 65 6e 20 28 20 24 3a 74 6f 6b 65 g-token ( $:toke
0360: 6e 20 6e 20 2d 2d 20 29 0a 20 20 20 20 36 34 3e n n -- ). 64>
0370: 6e 20 30 20 2e 72 20 2e 22 20 3a 22 20 24 3e 20 n 0 .r ." :" $>
0380: 66 6f 72 74 68 3a 74 79 70 65 20 73 70 61 63 65 forth:type space
0390: 20 3b 0a 0a 24 32 30 20 6e 65 74 32 6f 3a 20 65 ;..$20 net2o: e
03a0: 6d 69 74 20 28 20 75 74 66 38 20 2d 2d 20 29 20 mit ( utf8 -- )
03b0: 5c 67 20 65 6d 69 74 20 63 68 61 72 61 63 74 65 \g emit characte
03c0: 72 20 6f 6e 20 73 65 72 76 65 72 20 6c 6f 67 0a r on server log.
03d0: 20 20 20 20 36 34 3e 6e 20 78 65 6d 69 74 20 3b 64>n xemit ;
03e0: 0a 2b 6e 65 74 32 6f 3a 20 74 79 70 65 20 28 20 .+net2o: type (
03f0: 24 3a 73 74 72 69 6e 67 20 2d 2d 20 29 20 5c 67 $:string -- ) \g
0400: 20 74 79 70 65 20 73 74 72 69 6e 67 20 6f 6e 20 type string on
0410: 73 65 72 76 65 72 20 6c 6f 67 0a 20 20 20 20 24 server log. $
0420: 3e 20 66 6f 72 74 68 3a 74 79 70 65 20 3b 0a 2b > forth:type ;.+
0430: 6e 65 74 32 6f 3a 20 63 72 20 28 20 2d 2d 20 29 net2o: cr ( -- )
0440: 20 5c 67 20 6e 65 77 6c 69 6e 65 20 6f 6e 20 73 \g newline on s
0450: 65 72 76 65 72 20 6c 6f 67 0a 20 20 20 20 66 6f erver log. fo
0460: 72 74 68 3a 63 72 20 3b 0a 2b 6e 65 74 32 6f 3a rth:cr ;.+net2o:
0470: 20 2e 20 28 20 6e 20 2d 2d 20 29 20 5c 67 20 70 . ( n -- ) \g p
0480: 72 69 6e 74 20 6e 75 6d 62 65 72 20 6f 6e 20 73 rint number on s
0490: 65 72 76 65 72 20 6c 6f 67 0a 20 20 20 20 36 34 erver log. 64
04a0: 2e 20 3b 0a 2b 6e 65 74 32 6f 3a 20 66 2e 20 28 . ;.+net2o: f. (
04b0: 20 72 20 2d 2d 20 29 20 5c 67 20 70 72 69 6e 74 r -- ) \g print
04c0: 20 66 70 20 6e 75 6d 62 65 72 20 6f 6e 20 73 65 fp number on se
04d0: 72 76 65 72 20 6c 6f 67 0a 20 20 20 20 66 6f 72 rver log. for
04e0: 74 68 3a 66 2e 20 3b 0a 2b 6e 65 74 32 6f 3a 20 th:f. ;.+net2o:
04f0: 2e 74 69 6d 65 20 28 20 2d 2d 20 29 20 5c 67 20 .time ( -- ) \g
0500: 70 72 69 6e 74 20 74 69 6d 65 72 20 74 6f 20 73 print timer to s
0510: 65 72 76 65 72 20 6c 6f 67 0a 20 20 20 20 66 6f erver log. fo
0520: 72 74 68 3a 2e 74 69 6d 65 20 2e 70 61 63 6b 65 rth:.time .packe
0530: 74 73 20 70 72 6f 66 69 6c 65 28 20 2e 74 69 6d ts profile( .tim
0540: 65 73 20 29 20 3b 0a 2b 6e 65 74 32 6f 3a 20 21 es ) ;.+net2o: !
0550: 74 69 6d 65 20 28 20 2d 2d 20 29 20 5c 67 20 73 time ( -- ) \g s
0560: 74 61 72 74 20 74 69 6d 65 72 0a 20 20 20 20 66 tart timer. f
0570: 6f 72 74 68 3a 21 74 69 6d 65 20 69 6e 69 74 2d orth:!time init-
0580: 74 69 6d 65 72 20 3b 0a 0a 67 65 6e 2d 74 61 62 timer ;..gen-tab
0590: 6c 65 20 24 66 72 65 65 7a 65 0a 27 20 63 6f 6e le $freeze.' con
05a0: 74 65 78 74 2d 74 61 62 6c 65 20 69 73 20 67 65 text-table is ge
05b0: 6e 2d 74 61 62 6c 65 0a 0a 24 33 32 20 6e 65 74 n-table..$32 net
05c0: 32 6f 3a 20 6c 6f 67 20 28 20 2d 2d 20 6f 3a 6c 2o: log ( -- o:l
05d0: 6f 67 20 29 0a 20 20 20 20 6c 6f 67 2d 63 6f 6e og ). log-con
05e0: 74 65 78 74 20 40 20 64 75 70 20 30 3d 20 49 46 text @ dup 0= IF
05f0: 0a 09 64 72 6f 70 20 20 6e 32 6f 3a 6e 65 77 2d ..drop n2o:new-
0600: 6c 6f 67 20 64 75 70 20 6c 6f 67 2d 63 6f 6e 74 log dup log-cont
0610: 65 78 74 20 21 0a 20 20 20 20 54 48 45 4e 20 20 ext !. THEN
0620: 6e 3a 3e 6f 20 3b 0a 6c 6f 67 2d 74 61 62 6c 65 n:>o ;.log-table
0630: 20 3e 74 61 62 6c 65 0a 0a 70 72 65 76 69 6f 75 >table..previou
0640: 73 20 73 65 74 2d 63 75 72 72 65 6e 74 0a 0a 30 s set-current..0
0650: 20 5b 49 46 5d 0a 4c 6f 63 61 6c 20 56 61 72 69 [IF].Local Vari
0660: 61 62 6c 65 73 3a 0a 66 6f 72 74 68 2d 6c 6f 63 ables:.forth-loc
0670: 61 6c 2d 77 6f 72 64 73 3a 0a 20 20 20 20 28 0a al-words:. (.
0680: 20 20 20 20 20 28 28 22 6e 65 74 32 6f 3a 22 20 (("net2o:"
0690: 22 2b 6e 65 74 32 6f 3a 22 29 20 64 65 66 69 6e "+net2o:") defin
06a0: 69 74 69 6f 6e 2d 73 74 61 72 74 65 72 20 28 66 ition-starter (f
06b0: 6f 6e 74 2d 6c 6f 63 6b 2d 6b 65 79 77 6f 72 64 ont-lock-keyword
06c0: 2d 66 61 63 65 20 2e 20 31 29 0a 20 20 20 20 20 -face . 1).
06d0: 20 22 5b 20 5c 74 5c 6e 5d 22 20 74 20 6e 61 6d "[ \t\n]" t nam
06e0: 65 20 28 66 6f 6e 74 2d 6c 6f 63 6b 2d 66 75 6e e (font-lock-fun
06f0: 63 74 69 6f 6e 2d 6e 61 6d 65 2d 66 61 63 65 20 ction-name-face
0700: 2e 20 33 29 29 0a 20 20 20 20 20 28 22 5b 61 2d . 3)). ("[a-
0710: 7a 5c 2d 30 2d 39 5d 2b 28 22 20 69 6d 6d 65 64 z\-0-9]+(" immed
0720: 69 61 74 65 20 28 66 6f 6e 74 2d 6c 6f 63 6b 2d iate (font-lock-
0730: 63 6f 6d 6d 65 6e 74 2d 66 61 63 65 20 2e 20 31 comment-face . 1
0740: 29 0a 20 20 20 20 20 20 22 29 22 20 6e 69 6c 20 ). ")" nil
0750: 63 6f 6d 6d 65 6e 74 20 28 66 6f 6e 74 2d 6c 6f comment (font-lo
0760: 63 6b 2d 63 6f 6d 6d 65 6e 74 2d 66 61 63 65 20 ck-comment-face
0770: 2e 20 31 29 29 0a 20 20 20 20 29 0a 66 6f 72 74 . 1)). ).fort
0780: 68 2d 6c 6f 63 61 6c 2d 69 6e 64 65 6e 74 2d 77 h-local-indent-w
0790: 6f 72 64 73 3a 0a 20 20 20 20 28 0a 20 20 20 20 ords:. (.
07a0: 20 28 28 22 6e 65 74 32 6f 3a 22 20 22 2b 6e 65 (("net2o:" "+ne
07b0: 74 32 6f 3a 22 29 20 28 30 20 2e 20 32 29 20 28 t2o:") (0 . 2) (
07c0: 30 20 2e 20 32 29 20 6e 6f 6e 2d 69 6d 6d 65 64 0 . 2) non-immed
07d0: 69 61 74 65 29 0a 20 20 20 20 20 28 28 22 5b 3a iate). (("[:
07e0: 22 29 20 28 30 20 2e 20 31 29 20 28 30 20 2e 20 ") (0 . 1) (0 .
07f0: 31 29 20 69 6d 6d 65 64 69 61 74 65 29 0a 20 20 1) immediate).
0800: 20 20 20 28 28 22 3b 5d 22 29 20 28 2d 31 20 2e ((";]") (-1 .
0810: 20 30 29 20 28 30 20 2e 20 2d 31 29 20 69 6d 6d 0) (0 . -1) imm
0820: 65 64 69 61 74 65 29 0a 20 20 20 20 29 0a 45 6e ediate). ).En
0830: 64 3a 0a 5b 54 48 45 4e 5d d:.[THEN]