]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 8 Mar 2009 07:18:51 +0000 (01:18 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 8 Mar 2009 07:18:51 +0000 (01:18 -0600)
18 files changed:
README.txt
basis/farkup/farkup-tests.factor
basis/farkup/farkup.factor
basis/http/http-tests.factor
basis/http/http.factor
basis/http/parsers/parsers-tests.factor [new file with mode: 0644]
basis/http/parsers/parsers.factor
basis/http/server/cgi/cgi.factor
basis/simple-flat-file/simple-flat-file.factor
basis/tools/deploy/backend/backend.factor
basis/tools/deploy/unix/unix.factor
basis/tools/deploy/windows/windows.factor
basis/ui/tools/browser/browser.factor
basis/unix/bsd/freebsd/freebsd.factor
build-support/dlls.txt [new file with mode: 0644]
build-support/factor.sh
extra/mason/child/child.factor
extra/webapps/planet/planet.xml

index dfe70c00f428c5d565ca78d06e9c0d49e3dba370..bd9da0ab2bc85318bf37526af68a75b4ca312ecb 100755 (executable)
@@ -24,7 +24,7 @@ The Factor runtime is written in GNU C99, and is built with GNU make and
 gcc.
 
 Factor supports various platforms. For an up-to-date list, see
-<http://factorcode.org/getfactor.fhtml>.
+<http://factorcode.org>.
 
 Factor requires gcc 3.4 or later.
 
@@ -36,17 +36,6 @@ arguments for make.
 
 Run 'make' ('gmake' on *BSD) with no parameters to build the Factor VM.
 
-Compilation will yield an executable named 'factor' on Unix,
-'factor.exe' on Windows XP/Vista, and 'factor-ce.exe' on Windows CE.
-
-* Libraries needed for compilation
-
-For X11 support, you need recent development libraries for libc,
-Freetype, X11, OpenGL and GLUT. On a Debian-derived Linux distribution
-(like Ubuntu), you can use the following line to grab everything:
-
-    sudo apt-get install libc6-dev libfreetype6-dev libx11-dev glutg3-dev
-
 * Bootstrapping the Factor image
 
 Once you have compiled the Factor runtime, you must bootstrap the Factor
@@ -69,6 +58,12 @@ machines.
 On Unix, Factor can either run a graphical user interface using X11, or
 a terminal listener.
 
+For X11 support, you need recent development libraries for libc,
+Pango, X11, OpenGL and GLUT. On a Debian-derived Linux distribution
+(like Ubuntu), you can use the following line to grab everything:
+
+    sudo apt-get install libc6-dev libpango-1.0-dev libx11-dev glutg3-dev
+
 If your DISPLAY environment variable is set, the UI will start
 automatically:
 
@@ -78,14 +73,6 @@ To run an interactive terminal listener:
 
   ./factor -run=listener
 
-If you're inside a terminal session, you can start the UI with one of
-the following two commands:
-
-  ui
-  [ ui ] in-thread
-  
-The latter keeps the terminal listener running.
-
 * Running Factor on Mac OS X - Cocoa UI
 
 On Mac OS X, a Cocoa UI is available in addition to the terminal
@@ -110,7 +97,7 @@ When compiling Factor, pass the X11=1 parameter:
 
 Then bootstrap with the following switches:
 
-  ./factor -i=boot.<cpu>.image -ui-backend=x11
+  ./factor -i=boot.<cpu>.image -ui-backend=x11 -ui-text-backend=pango
 
 Now if $DISPLAY is set, running ./factor will start the UI.
 
@@ -126,6 +113,12 @@ the command prompt using the console application:
 
   factor.com -i=boot.<cpu>.image
 
+Before bootstrapping, you will need to download the DLLs for the Pango
+text rendering library. The required DLLs are listed in
+build-support/dlls.txt and are available from the following location:
+
+  <http://factorcode.org/dlls>
+
 Once bootstrapped, double-clicking factor.exe or factor.com starts
 the Factor UI.
 
@@ -135,7 +128,9 @@ To run the listener in the command prompt:
 
 * The Factor FAQ
 
-The Factor FAQ is available at <http://factorcode.org/faq.fhtml>.
+The Factor FAQ is available at the following location:
+
+  <http://concatenative.org/wiki/view/Factor/FAQ>
 
 * Command line usage
 
index 60a9f785e63a58a193bab712e61368a510ca9ec0..246da48b32eba0ade6f2a4131e96b05783d7141e 100644 (file)
@@ -99,6 +99,7 @@ link-no-follow? off
 [ "<p><img src=\"lol.jpg\" alt=\"teh lol\"/></p>" ] [ "[[image:lol.jpg|teh lol]]" convert-farkup ] unit-test
 [ "<p><a href=\"http://lol.com\">http://lol.com</a></p>" ] [ "[[http://lol.com]]" convert-farkup ] unit-test
 [ "<p><a href=\"http://lol.com\">haha</a></p>" ] [ "[[http://lol.com|haha]]" convert-farkup ] unit-test
+[ "<p><a href=\"http://lol.com/search?q=sex\">haha</a></p>" ] [ "[[http://lol.com/search?q=sex|haha]]" convert-farkup ] unit-test
 [ "<p><a href=\"Foo/Bar\">Bar</a></p>" ] [ "[[Foo/Bar]]" convert-farkup ] unit-test
 
 "/wiki/view/" relative-link-prefix [
index 50ee938659f41fe2638ab450786af1b548f64c3c..4041d927735819593f9b26ffb7db2b67ba0eb4f7 100755 (executable)
@@ -165,12 +165,12 @@ CONSTANT: invalid-url "javascript:alert('Invalid URL in farkup');"
         { [ dup [ 127 > ] any? ] [ drop invalid-url ] }
         { [ dup first "/\\" member? ] [ drop invalid-url ] }
         { [ CHAR: : over member? ] [ dup absolute-url? [ drop invalid-url ] unless ] }
-        [ relative-link-prefix get prepend "" like ]
-    } cond url-encode ;
+        [ relative-link-prefix get prepend "" like url-encode ]
+    } cond ;
 
 : write-link ( href text -- xml )
-    [ check-url link-no-follow? get "true" and ] dip
-    [XML <a href=<-> nofollow=<->><-></a> XML] ;
+    [ check-url link-no-follow? get "nofollow" and ] dip
+    [XML <a href=<-> rel=<->><-></a> XML] ;
 
 : write-image-link ( href text -- xml )
     disable-images? get [
index 229d05615ece724efdc3256e626cd2f7cd2c121f..2b9cd100f73ff8be255d88849a07fc7b14db9aa3 100644 (file)
@@ -11,12 +11,6 @@ IN: http.tests
 
 [ "application/octet-stream" binary ] [ "application/octet-stream" parse-content-type ] unit-test
 
-[ { } ] [ "" parse-cookie ] unit-test
-[ { } ] [ "" parse-set-cookie ] unit-test
-
-! Make sure that totally invalid cookies don't confuse us
-[ { } ] [ "hello world; how are you" parse-cookie ] unit-test
-
 : lf>crlf "\n" split "\r\n" join ;
 
 STRING: read-request-test-1
index a64a11690c3267d4aee0728089ca824c8410d5c9..c7f10a789d8883bccd8190e622cb78b023dfc541 100755 (executable)
@@ -34,7 +34,7 @@ IN: http
 
 : check-header-string ( str -- str )
     #! http://en.wikipedia.org/wiki/HTTP_Header_Injection
-    dup "\r\n\"" intersects?
+    dup "\r\n" intersects?
     [ "Header injection attack" throw ] when ;
 
 : write-header ( assoc -- )
diff --git a/basis/http/parsers/parsers-tests.factor b/basis/http/parsers/parsers-tests.factor
new file mode 100644 (file)
index 0000000..f87ed47
--- /dev/null
@@ -0,0 +1,16 @@
+IN: http.parsers.tests
+USING: http http.parsers tools.test ;
+
+[ { } ] [ "" parse-cookie ] unit-test
+[ { } ] [ "" parse-set-cookie ] unit-test
+
+! Make sure that totally invalid cookies don't confuse us
+[ { } ] [ "hello world; how are you" parse-cookie ] unit-test
+
+[ { T{ cookie { name "__s" } { value "12345567" } } } ]
+[ "__s=12345567" parse-cookie ]
+unit-test
+
+[ { T{ cookie { name "__s" } { value "12345567" } } } ]
+[ "__s=12345567;" parse-cookie ]
+unit-test
\ No newline at end of file
index d72147b3813caa854edae9b2d339cd18ad3f8b3c..2520c35acb9b215eb6fedb5e36bcdd63f8e6fdda 100644 (file)
@@ -162,7 +162,7 @@ PEG: (parse-set-cookie) ( string -- alist )
         'value' ,
         'space' ,
     ] seq*
-    [ ";,=" member? not ] satisfy repeat1 [ drop f ] action
+    [ ";,=" member? not ] satisfy repeat0 [ drop f ] action
     2choice ;
 
 PEG: (parse-cookie) ( string -- alist )
index a64fe9af3cbfef9f43e7e6f11f31e4fc22a43716..d2f453034a2de702d4211606b9b9c99688360d83 100644 (file)
@@ -53,9 +53,9 @@ IN: http.server.cgi
     "CGI output follows" >>message\r
     swap '[\r
         binary encode-output\r
-        _ output-stream get swap <cgi-process> binary <process-stream> [\r
+        output-stream get _ <cgi-process> binary <process-stream> [\r
             post-request? [ request get post-data>> data>> write flush ] when\r
-            '[ _ write ] each-block\r
+            '[ _ stream-write ] each-block\r
         ] with-stream\r
     ] >>body ;\r
 \r
index 721f4986a0dfc5095d1ac89c3dff376e14b2338c..403fc4d14b82e0a4b8056d0d5120184e867c3dbf 100644 (file)
@@ -7,10 +7,13 @@ IN: simple-flat-file
     [ "#" split1 drop ] map harvest ;
 
 : split-column ( line -- columns )
-    " \t" split harvest 2 head ;
+    " \t" split harvest 2 short head 2 f pad-tail ;
 
 : parse-hex ( s -- n )
-    2 short tail hex> ;
+    dup [
+        "0x" ?head [ "U+" ?head [ "Missing 0x or U+" throw ] unless ] unless
+        hex>
+    ] when ;
 
 : parse-line ( line -- code-unicode )
     split-column [ parse-hex ] map ;
index 7d8f35724007026b68629804dfb688dccde8cf27..28a32790dcae934258d70b92e52b08ce9debfe7c 100755 (executable)
@@ -1,4 +1,4 @@
-! Copyright (C) 2007, 2008 Slava Pestov.
+! Copyright (C) 2007, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: namespaces make continuations.private kernel.private init
 assocs kernel vocabs words sequences memory io system arrays
@@ -14,9 +14,14 @@ IN: tools.deploy.backend
 : copy-vm ( executable bundle-name -- vm )
     prepend-path vm over copy-file ;
 
-: copy-fonts ( name dir -- )
+CONSTANT: theme-path "basis/ui/gadgets/theme/"
+
+: copy-theme ( name dir -- )
     deploy-ui? get [
-        append-path "resource:fonts/" swap copy-tree-into
+        append-path
+        theme-path append-path
+        [ make-directories ]
+        [ theme-path "resource:" prepend swap copy-tree ] bi
     ] [ 2drop ] if ;
 
 : image-name ( vocab bundle-name -- str )
index c9bf308357af458fa4ee96ad6c10075cb0b9d6bf..f88cf06ef7fc8f48127b4e7875bfdad2f259c52a 100755 (executable)
@@ -7,7 +7,7 @@ tools.deploy.config.editor assocs hashtables prettyprint ;
 IN: tools.deploy.unix
 
 : create-app-dir ( vocab bundle-name -- vm )
-    dup "" copy-fonts
+    dup "" copy-theme
     copy-vm
     dup OCT: 755 set-file-permissions ;
 
index 0e9146b26eccc2911c9f4277db1163f4031bf379..bfa096ad2fb674ace677073a420d75b4f53a3ae0 100755 (executable)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2007, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: io io.files io.pathnames io.directories kernel namespaces
+USING: io io.files io.pathnames io.directories io.encodings.ascii kernel namespaces
 sequences locals system splitting tools.deploy.backend
 tools.deploy.config tools.deploy.config.editor assocs hashtables
 prettyprint combinators windows.shell32 windows.user32 ;
@@ -9,11 +9,10 @@ IN: tools.deploy.windows
 : copy-dll ( bundle-name -- )
     "resource:factor.dll" swap copy-file-into ;
 
-: copy-freetype ( bundle-name -- )
-    {
-        "resource:freetype6.dll"
-        "resource:zlib1.dll"
-    } swap copy-files-into ;
+: copy-pango ( bundle-name -- )
+    "resource:build-support/dlls.txt" ascii file-lines
+    [ "resource:" prepend-path ] map
+    swap copy-files-into ;
 
 :: copy-vm ( executable bundle-name extension -- vm )
     vm "." split1-last drop extension append
@@ -23,8 +22,8 @@ IN: tools.deploy.windows
 : create-exe-dir ( vocab bundle-name -- vm )
     dup copy-dll
     deploy-ui? get [
-        [ copy-freetype ]
-        [ "" copy-fonts ]
+        [ copy-pango ]
+        [ "" copy-theme ]
         [ ".exe" copy-vm ] tri
     ] [ ".com" copy-vm ] if ;
 
index 8fcd14c95f051b0233d3db4fcbc144690fa86ab0..078ece6546ecc6d82b31f7fe1b696ba865a90ac8 100644 (file)
@@ -86,7 +86,9 @@ M: browser-gadget focusable-child* search-field>> ;
     [ [ raise-window ] [ gadget-child show-help ] bi ]
     [ (browser-window) ] if* ;
 
-: show-browser ( -- ) "handbook" com-browse ;
+: show-browser ( -- )
+    [ browser-gadget? ] find-window
+    [ raise-window ] [ browser-window ] if* ;
 
 \ show-browser H{ { +nullary+ t } } define-command
 
index 4536c532bf649e377faaa0c4ed303f5f1fcbeb19..05642b506574c08c3a94dab417a2e45bc01ad13d 100644 (file)
@@ -1,7 +1,7 @@
 USING: alien.syntax ;
 IN: unix
 
-: FD_SETSIZE 1024 ;
+CONSTANT: FD_SETSIZE 1024
 
 C-STRUCT: addrinfo
     { "int" "flags" }
diff --git a/build-support/dlls.txt b/build-support/dlls.txt
new file mode 100644 (file)
index 0000000..97d0cf6
--- /dev/null
@@ -0,0 +1,12 @@
+libcairo-2.dll
+libgio-2.0-0.dll
+libglib-2.0-0.dll
+libgmodule-2.0-0.dll
+libgobject-2.0-0.dll
+libgthread-2.0-0.dll
+libpango-1.0-0.dll
+libpangocairo-1.0-0.dll
+libpangowin32-1.0-0.dll
+libpng12-0.dll
+libtiff3.dll
+zlib1.dll
index 3517d8f4ba41be828a4eacf4a54a906dd723cbd6..cf6aacb84fe274172577dfb8ab308ea659929fb0 100755 (executable)
@@ -447,31 +447,11 @@ get_url() {
 
 maybe_download_dlls() {
     if [[ $OS == winnt ]] ; then
-        get_url http://factorcode.org/dlls/freetype6.dll
-        get_url http://factorcode.org/dlls/zlib1.dll
-        get_url http://factorcode.org/dlls/OpenAL32.dll
-        get_url http://factorcode.org/dlls/alut.dll
-        get_url http://factorcode.org/dlls/comerr32.dll
-        get_url http://factorcode.org/dlls/gssapi32.dll
-        get_url http://factorcode.org/dlls/iconv.dll
-        get_url http://factorcode.org/dlls/k5sprt32.dll
-        get_url http://factorcode.org/dlls/krb5_32.dll
-        get_url http://factorcode.org/dlls/libcairo-2.dll
-        get_url http://factorcode.org/dlls/libeay32.dll
-        get_url http://factorcode.org/dlls/libiconv2.dll
-        get_url http://factorcode.org/dlls/libintl3.dll
-        get_url http://factorcode.org/dlls/libpq.dll
-        get_url http://factorcode.org/dlls/libxml2.dll
-        get_url http://factorcode.org/dlls/libxslt.dll
-        get_url http://factorcode.org/dlls/msvcr71.dll
-        get_url http://factorcode.org/dlls/ogg.dll
-        get_url http://factorcode.org/dlls/pgaevent.dll
-        get_url http://factorcode.org/dlls/sqlite3.dll
-        get_url http://factorcode.org/dlls/ssleay32.dll
-        get_url http://factorcode.org/dlls/theora.dll
-        get_url http://factorcode.org/dlls/vorbis.dll
-        chmod 777 *.dll
-        check_ret chmod
+       for file in `cat build-support/dlls.txt`; do
+           get_url http://factorcode.org/dlls/$file
+            chmod 777 *.dll
+            check_ret chmod
+       done
     fi
 }
 
@@ -522,7 +502,7 @@ make_boot_image() {
 }
 
 install_build_system_apt() {
-    sudo apt-get --yes install libc6-dev libfreetype6-dev libx11-dev xorg-dev glutg3-dev wget git-core git-doc rlwrap gcc make
+    sudo apt-get --yes install libc6-dev libpango-1.0-dev libx11-dev xorg-dev glutg3-dev wget git-core git-doc rlwrap gcc make
     check_ret sudo
 }
 
index 087ed2c3cbd992e19416cafa2a2b5fefb86f1339..1999c76d83545fb2ab07f7576ccdb879ade1b643 100644 (file)
@@ -1,21 +1,22 @@
-! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
+! Copyright (C) 2008, 2009 Eduardo Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays calendar combinators.short-circuit
-continuations debugger http.client io.directories io.files
-io.launcher io.pathnames kernel make mason.common mason.config
+continuations debugger http.client io.directories io.files io.launcher
+io.pathnames io.encodings.ascii kernel make mason.common mason.config
 mason.platform mason.report mason.email namespaces sequences ;
 IN: mason.child
 
 : make-cmd ( -- args )
     gnu-make platform 2array ;
 
+: dll-url ( -- url )
+    "http://factorcode.org/dlls/"
+    target-cpu get "x86.64" = [ "64/" append ] when ;
+
 : download-dlls ( -- )
     target-os get "winnt" = [
-        "http://factorcode.org/dlls/"
-        target-cpu get "x86.64" = [ "64/" append ] when
-        [ "freetype6.dll" append ]
-        [ "zlib1.dll" append ] bi
-        [ download ] bi@
+        dll-url "build-support/dlls.txt" ascii file-lines
+        [ append download ] with each
     ] when ;
 
 : make-vm ( -- )
index 412f42c64e733ccf94af895cac11733f8409fe3f..08cf07d4ceca4cc52f13776f5f1c670f259d6d51 100644 (file)
@@ -2,6 +2,8 @@
 
 <t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
 
+       <t:atom t:href="$planet/feed.xml">[ planet-factor ]</t:atom>
+
        <t:title>[ planet-factor ]</t:title>
 
        <table width="100%" cellpadding="10">