Check-in [b969f6bac2]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:More work on DVCS refs
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b969f6bac23ccb534beddd519df31190c749b3db
User & Date: bernd 2018-11-07 21:47:27
Context
2018-11-07
22:11
Bump version number check-in: ccdccc9a2f user: bernd tags: trunk, 0.8.3-20181107
21:47
More work on DVCS refs check-in: b969f6bac2 user: bernd tags: trunk
10:59
Added logo.png check-in: fd2a10ba81 user: bernd tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.in.

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
	  gui.fs net2o.fs ip.fs helper.fs keys.fs log.fs msg.fs notify.fs    \
	  qr.fs socks.fs squid.fs tools.fs vault.fs rng.fs xtype.fs $(TESTS) \
	  $(FORTHLIB) ed25519-donnalib.fs keccaklib.fs threefishlib.fs	     \
	  startn2o.fs doc/net2o-logo.png version.fs.in android/net.fs	     \
	  android/notify.fs linux/net.fs linux/notify.fs dhtroot.fs dvcs.fs  \
	  qrscan.fs android/qrscan-android.fs linux/qrscan-linux.fs	     \
	  doc/net2o-200.png doc/net2o.png json/parser.fs json/g+-schema.fs   \
	  json/g+-export.fs json/fb-schema.fs json/twitter-schema.fs	     \
	  json/test.fs json/test.json html/parser.fs xml/parser.fs	     \
	  xml/blogger-atom.fs

LANGS =	  lang/en lang/de lang/zh

ifeq "$(FAST)" "yes"
FORTHLIB += ed25519-donnafast.fs keccakfast.fs threefishfast.fs







|







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
	  gui.fs net2o.fs ip.fs helper.fs keys.fs log.fs msg.fs notify.fs    \
	  qr.fs socks.fs squid.fs tools.fs vault.fs rng.fs xtype.fs $(TESTS) \
	  $(FORTHLIB) ed25519-donnalib.fs keccaklib.fs threefishlib.fs	     \
	  startn2o.fs doc/net2o-logo.png version.fs.in android/net.fs	     \
	  android/notify.fs linux/net.fs linux/notify.fs dhtroot.fs dvcs.fs  \
	  qrscan.fs android/qrscan-android.fs linux/qrscan-linux.fs	     \
	  doc/net2o-200.png doc/net2o.png json/parser.fs json/g+-schema.fs   \
	  json/g+-import.fs json/fb-schema.fs json/twitter-schema.fs	     \
	  json/test.fs json/test.json html/parser.fs xml/parser.fs	     \
	  xml/blogger-atom.fs

LANGS =	  lang/en lang/de lang/zh

ifeq "$(FAST)" "yes"
FORTHLIB += ed25519-donnafast.fs keccakfast.fs threefishfast.fs

Changes to classes.fs.

376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
sfvalue: ts-grow
end-structure

\ io per-task variables

user-o io-mem

object class
    pollfd 4 *      uvar pollfds \ up to four file descriptors
    sockaddr_in     uvar sockaddr< \ incoming socket
    sockaddr_in     uvar sockaddr> \ outgoing socket
    sockaddr_in     uvar sockaddr1
    [IFDEF] no-hybrid
	sockaddr_in uvar sockaddr2
    [THEN]







|







376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
sfvalue: ts-grow
end-structure

\ io per-task variables

user-o io-mem

object uclass io-mem
    pollfd 4 *      uvar pollfds \ up to four file descriptors
    sockaddr_in     uvar sockaddr< \ incoming socket
    sockaddr_in     uvar sockaddr> \ outgoing socket
    sockaddr_in     uvar sockaddr1
    [IFDEF] no-hybrid
	sockaddr_in uvar sockaddr2
    [THEN]

Changes to crypt.fs.

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
..
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Variable my-0key
: your-0key ( -- addr u )
    o IF  dest-0key sec@  ELSE  #0.  THEN
    dup 0= IF  2drop lastaddr# cell+ $@  THEN ;

user-o keytmp \ storage for secure temporary keys

object class
    state2#   uvar key-assembly
    state2#   uvar ivs-assembly
    state#    uvar mykey    \ instance's rotating private key
    state#    uvar oldmykey \ previous rotating private key
    keysize   uvar oldpkc   \ previous pubkey after revocation
    keysize   uvar oldskc   \ previous secret key after revocation
    keysize   uvar oldpkrev \ previous revocation pubkey after revocation
................................................................................
    keysize   uvar vsk
    1 64s     uvar last-mykey
    cell      uvar keytmp-up
end-class keytmp-c

user-o keybuf \ storage for secure permanent keys

object class
    \ key storage
    \ client keys
    keysize uvar pkc   \ pubkey
    keysize uvar pk1   \ pubkey 1 for revokation
    keysize uvar skc   \ secret key
    keysize uvar sksig \ secret key for signature
    keysize uvar sk1   \ secret key 1 for revokation (will not last)







|







 







|







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
..
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Variable my-0key
: your-0key ( -- addr u )
    o IF  dest-0key sec@  ELSE  #0.  THEN
    dup 0= IF  2drop lastaddr# cell+ $@  THEN ;

user-o keytmp \ storage for secure temporary keys

object uclass keytmp
    state2#   uvar key-assembly
    state2#   uvar ivs-assembly
    state#    uvar mykey    \ instance's rotating private key
    state#    uvar oldmykey \ previous rotating private key
    keysize   uvar oldpkc   \ previous pubkey after revocation
    keysize   uvar oldskc   \ previous secret key after revocation
    keysize   uvar oldpkrev \ previous revocation pubkey after revocation
................................................................................
    keysize   uvar vsk
    1 64s     uvar last-mykey
    cell      uvar keytmp-up
end-class keytmp-c

user-o keybuf \ storage for secure permanent keys

object uclass keybuf
    \ key storage
    \ client keys
    keysize uvar pkc   \ pubkey
    keysize uvar pk1   \ pubkey 1 for revokation
    keysize uvar skc   \ secret key
    keysize uvar sksig \ secret key for signature
    keysize uvar sk1   \ secret key 1 for revokation (will not last)

Changes to dvcs.fs.

563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
...
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
...
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902




903

904
905
906
907
908
909
910
911
912
913


914
915
916
917
918
919
920
	I $@ ['] msg:display catch IF  ." invalid entry" cr 2drop THEN
    cell +LOOP  log free throw
    dvcs( ." === id>patch ===" cr id>patch# .hash
    ." === id>snap ===" cr id>snap# .hash ) ;
: chat>branches ( o:dvcs -- )
    project:project$ $@ ?msg-log  dvcs:commits @ .chat>branches-loop ;

: >branches ( addr u -- flag )
    $make branches[] >back ;
User id-check# \ check hash
: id>branches-loop ( addr u -- )
    BEGIN  2dup id-check# #@ d0<> IF  2drop  EXIT  THEN
	s" !" 2over id-check# #!
	2dup id>snap# #@ 2dup d0<> IF  >branches 2drop  EXIT  THEN
	2drop id>patch# #@ 2dup d0<> WHILE
................................................................................
    2dup >file-hash dvcs:hash$ $!
    dvcs( ." ===== ci '" dvcs:hash$ $@ 85type ." ' =====" cr )
    write-enc-hashed 2drop ;

: pull-readin ( -- )
    config>dvcs  chat>dvcs  chat>branches ;
: dvcs-readin ( $addr -- )
    pull-readin  $@ id>branches
    branches>dvcs  files>dvcs  new>dvcs  dvcs?modified ;

scope{ dvcs
: new-dvcs-log ( -- o )
    dvcs-log-class new >o msg-table @ token-table ! o o> ;
: clear-log ( -- )
    dvcs-log:sig$    $free  dvcs-log:tag$  $free  dvcs-log:id$    $free
    dvcs-log:action$ $free  dvcs-log:text$ $free  dvcs-log:chain$ $free ;
................................................................................

: #needed ( hash -- )
    cell+ $@ key| +needed ;
: dvcs-needed-files ( -- )
    id>patch# ['] #needed #map
    id>snap#  ['] #needed #map ;

: get-needed-files ( -- ) +resend
    sync-file-list[] $[]# 0 ?DO
	I /sync-reqs + I' umin I U+DO
	    net2o-code expect+slurp
	    $10 blocksize! 0 blockalign!
	    I /sync-files + I' umin I U+DO
		I sync-file-list[] $[]@ net2o:copy#
	    LOOP
	    I /sync-files + I' u>=
	    IF  end-code| net2o:close-all  ELSE  end-code  THEN
	/sync-files +LOOP
    /sync-reqs +LOOP ;

: dvcs-data-sync ( -- )
    sync-file-list[] $[]off  branches[] $[]off
    msg-group$ $@ ?msg-log
    dvcs:commits @ .chat>branches-loop
    dvcs:commits @ .dvcs-needed-files




    connection .get-needed-files ;


: handle-fetch ( -- )  ?.net2o/objects
    dvcs:new-dvcs >o  pull-readin
    msg( ." === syncing metadata ===" forth:cr )
    0 >o dvcs-connects +dvcs-sync-done
\    net2o-code expect-reply ['] last?, [msg,] end-code
    wait-dvcs-request o>
    msg( ." === syncing data ===" forth:cr )
    dvcs-data-sync
    msg( ." === data sync done ===" forth:cr )


    msg-group$ $@ >group last# silent-leave-chat
    dvcs:dispose-dvcs o> ;

0 [IF]
Local Variables:
forth-local-words:
    (







|







 







|
|







 







|
|




|











>
>
>
>
|
>










>
>







563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
...
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
...
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
	I $@ ['] msg:display catch IF  ." invalid entry" cr 2drop THEN
    cell +LOOP  log free throw
    dvcs( ." === id>patch ===" cr id>patch# .hash
    ." === id>snap ===" cr id>snap# .hash ) ;
: chat>branches ( o:dvcs -- )
    project:project$ $@ ?msg-log  dvcs:commits @ .chat>branches-loop ;

: >branches ( addr u -- )
    $make branches[] >back ;
User id-check# \ check hash
: id>branches-loop ( addr u -- )
    BEGIN  2dup id-check# #@ d0<> IF  2drop  EXIT  THEN
	s" !" 2over id-check# #!
	2dup id>snap# #@ 2dup d0<> IF  >branches 2drop  EXIT  THEN
	2drop id>patch# #@ 2dup d0<> WHILE
................................................................................
    2dup >file-hash dvcs:hash$ $!
    dvcs( ." ===== ci '" dvcs:hash$ $@ 85type ." ' =====" cr )
    write-enc-hashed 2drop ;

: pull-readin ( -- )
    config>dvcs  chat>dvcs  chat>branches ;
: dvcs-readin ( $addr -- )
    pull-readin  $@ id>branches  branches>dvcs
    files>dvcs  new>dvcs  dvcs?modified ;

scope{ dvcs
: new-dvcs-log ( -- o )
    dvcs-log-class new >o msg-table @ token-table ! o o> ;
: clear-log ( -- )
    dvcs-log:sig$    $free  dvcs-log:tag$  $free  dvcs-log:id$    $free
    dvcs-log:action$ $free  dvcs-log:text$ $free  dvcs-log:chain$ $free ;
................................................................................

: #needed ( hash -- )
    cell+ $@ key| +needed ;
: dvcs-needed-files ( -- )
    id>patch# ['] #needed #map
    id>snap#  ['] #needed #map ;

: get-needed-files { list -- } +resend
    list $[]# 0 ?DO
	I /sync-reqs + I' umin I U+DO
	    net2o-code expect+slurp
	    $10 blocksize! 0 blockalign!
	    I /sync-files + I' umin I U+DO
		I list $[]@ net2o:copy#
	    LOOP
	    I /sync-files + I' u>=
	    IF  end-code| net2o:close-all  ELSE  end-code  THEN
	/sync-files +LOOP
    /sync-reqs +LOOP ;

: dvcs-data-sync ( -- )
    sync-file-list[] $[]off  branches[] $[]off
    msg-group$ $@ ?msg-log
    dvcs:commits @ .chat>branches-loop
    dvcs:commits @ .dvcs-needed-files
    sync-file-list[] connection .get-needed-files ;

: dvcs-ref-sync ( -- )
    dvcs:new-dvcs-refs >o branches>dvcs
    dvcs:refs[] connection .get-needed-files
    dvcs:dispose-dvcs-refs o> ;

: handle-fetch ( -- )  ?.net2o/objects
    dvcs:new-dvcs >o  pull-readin
    msg( ." === syncing metadata ===" forth:cr )
    0 >o dvcs-connects +dvcs-sync-done
\    net2o-code expect-reply ['] last?, [msg,] end-code
    wait-dvcs-request o>
    msg( ." === syncing data ===" forth:cr )
    dvcs-data-sync
    msg( ." === data sync done ===" forth:cr )
    dvcs-ref-sync
    msg( ." === ref sync done ===" forth:cr )
    msg-group$ $@ >group last# silent-leave-chat
    dvcs:dispose-dvcs o> ;

0 [IF]
Local Variables:
forth-local-words:
    (

Changes to gui.fs.

693
694
695
696
697
698
699

700
701
702
703
704
705
706
    1e ambient% sf! set-uniforms ;

: net2o-gui ( -- )
    n2o-frame to top-widget
    "PASSPHRASE" getenv 2dup d0= IF  2drop
    ELSE
	>passphrase +key  read-keys

    THEN
    secret-keys# IF  show-nicks  THEN
    1config  !widgets  widgets-loop ;

' net2o-gui is run-gui

previous







>







693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
    1e ambient% sf! set-uniforms ;

: net2o-gui ( -- )
    n2o-frame to top-widget
    "PASSPHRASE" getenv 2dup d0= IF  2drop
    ELSE
	>passphrase +key  read-keys
	"PASSPHRASE" getenv erase \ erase passphrase after use!
    THEN
    secret-keys# IF  show-nicks  THEN
    1config  !widgets  widgets-loop ;

' net2o-gui is run-gui

previous

Name change from json/g+-export.fs to json/g+-import.fs.

1
2
3
4
5
6
7
8
\ Google+ export

\ Copyright (C) 2018   Bernd Paysan

\ This program is free software: you can redistribute it and/or modify
\ it under the terms of the GNU Affero General Public License as published by
\ the Free Software Foundation, either version 3 of the License, or
\ (at your option) any later version.
|







1
2
3
4
5
6
7
8
\ Google+ import

\ Copyright (C) 2018   Bernd Paysan

\ This program is free software: you can redistribute it and/or modify
\ it under the terms of the GNU Affero General Public License as published by
\ the Free Software Foundation, either version 3 of the License, or
\ (at your option) any later version.

Changes to tools.fs.

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
..
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
...
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
    0 ?DO enum LOOP drop ;
: bit ( n "name" -- n*2 )   dup Constant 2* ;

\ argument handling that works transparent from OS and Forth command line

user-o arg-o

object class
    umethod ?nextarg
    umethod ?@nextarg
    umethod ?peekarg
end-class cmd-args-c

align cmd-args-c , here constant cmd-args^

................................................................................
:noname ( -- addr u t / f )
    argc @ 1 > IF  1 arg true  ELSE  false  THEN ; to ?peekarg
:noname ( -- addr u t / f )
    argc @ 1 > IF
	1 arg drop c@ '@' = IF  next-arg 1 /string true  EXIT  THEN
    THEN  false ; to ?@nextarg

cmd-args-c class
end-class word-args-c

align word-args-c , here constant word-args^

: word-args ( -- )  word-args^ arg-o ! ;

word-args
................................................................................
    2dup *insflag @ IF  *-width2  ELSE  *-width1  THEN  edit-curpos !
    2dup *insflag @ IF  *type2  ELSE  *type  THEN ;
: *edit-update ( -- )
    .*resizeline .*all .*rest ;
: (*xins)  *insflag on (xins) ;
: *kill-prefix  *insflag off kill-prefix ;

edit-terminal-c class
end-class *edit-terminal-c

*edit-terminal-c ' new static-a with-allocater Constant *edit-terminal

*edit-terminal edit-out !

' (*xins) is insert-char







|







 







|







 







|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
..
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
...
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
    0 ?DO enum LOOP drop ;
: bit ( n "name" -- n*2 )   dup Constant 2* ;

\ argument handling that works transparent from OS and Forth command line

user-o arg-o

object uclass arg-o
    umethod ?nextarg
    umethod ?@nextarg
    umethod ?peekarg
end-class cmd-args-c

align cmd-args-c , here constant cmd-args^

................................................................................
:noname ( -- addr u t / f )
    argc @ 1 > IF  1 arg true  ELSE  false  THEN ; to ?peekarg
:noname ( -- addr u t / f )
    argc @ 1 > IF
	1 arg drop c@ '@' = IF  next-arg 1 /string true  EXIT  THEN
    THEN  false ; to ?@nextarg

cmd-args-c uclass arg-o
end-class word-args-c

align word-args-c , here constant word-args^

: word-args ( -- )  word-args^ arg-o ! ;

word-args
................................................................................
    2dup *insflag @ IF  *-width2  ELSE  *-width1  THEN  edit-curpos !
    2dup *insflag @ IF  *type2  ELSE  *type  THEN ;
: *edit-update ( -- )
    .*resizeline .*all .*rest ;
: (*xins)  *insflag on (xins) ;
: *kill-prefix  *insflag off kill-prefix ;

edit-terminal-c uclass edit-out
end-class *edit-terminal-c

*edit-terminal-c ' new static-a with-allocater Constant *edit-terminal

*edit-terminal edit-out !

' (*xins) is insert-char