picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

main.l (1459B)


      1 # 30jul13abu
      2 # (c) Software Lab. Alexander Burger
      3 
      4 (allowed ("app/")
      5    "!start" "!stop" "@lib.css" "!psh" )
      6 
      7 (scl 2)
      8 (load
      9    "@lib/http.l" "@lib/xhtml.l" "@lib/form.l"
     10    "@lib/ps.l" "@lib/adm.l"
     11    "@lib/boss.l" )
     12 
     13 (setq
     14    *Css "@lib.css"
     15    *Blob "blob/app/"
     16    *Salt (16 . "$6$@1$") )
     17 
     18 (load "app/er.l" "app/lib.l" "app/gui.l")
     19 
     20 (permission
     21    Customer    ,"Customer"
     22    Item        ,"Item"
     23    Order       ,"Order"
     24    Report      ,"Report"
     25    RoleAdmin   ,"Role Administration"
     26    UserAdmin   ,"User Administration"
     27    Password    ,"Password"
     28    Delete      ,"Delete" )
     29 
     30 (de *Locales
     31    ("English" NIL)
     32    ("English (US)" "US")
     33    ("English (UK)" "UK")
     34    ("Español (AR)" "AR" . "ar")
     35    ("Español (ES)" "ES" . "es")
     36    ("Deutsch (DE)" "DE" . "de")
     37    ("Deutsch (CH)" "CH" . "ch")
     38    ("Norsk" "NO" . "no")
     39    ("Русский" "RU" . "ru")
     40    ("日本語" "JP" . "jp") )
     41 
     42 # Entry point
     43 (de main ()
     44    (call 'mkdir "-p" "db/app/" *Blob)
     45    (pool "db/app/" *Dbs)
     46    (unless (seq *DB)
     47       (load "app/init.l") ) )
     48 
     49 (de go ()
     50    (pw 12)
     51    (task (port 4040)  # Set up query server in the background
     52       (let? Sock (accept @)
     53          (unless (fork)  # Child process
     54             (in Sock
     55                (while (rd)
     56                   (sync)
     57                   (tell)
     58                   (out Sock
     59                      (pr (eval @)) ) ) )
     60             (bye) )
     61          (close Sock) ) )
     62    (forked)
     63    (rollback)
     64    (server 8080 "!start") )
     65 
     66 # vi:et:ts=3:sw=3