Annotation of 43BSD/contrib/X/xted/start_up.clu, revision 1.1.1.1

1.1       root        1: # extend
                      2: 
                      3: qs = sequence[string]
                      4: qi = sequence[int]
                      5: 
                      6: qp = sequence[eproc]
                      7: tab = qp$[run_ctrlat, run_ctrla, run_ctrlb, run_ctrlat,
                      8:          run_ctrld, run_ctrle, run_ctrlf, run_ctrlg,
                      9:          ed_help, insert_char, run_interactive, run_ctrlk,
                     10:          run_ctrll, run_ctrlm, run_ctrlnp, run_ctrlo,
                     11:          run_ctrlnp, run_ctrlq, run_ctrlr, run_ctrls,
                     12:          run_ctrlt, run_ctrlu, run_ctrlv, run_ctrlw,
                     13:          run_ctrlx, run_ctrly, incremental_update, run_ctrlsk,
                     14:          indyan, run_adjust, run_ctrlsn, run_ctrlso]
                     15: 
                     16: start_up = proc ()
                     17:     own done: bool := false
                     18:     jcl: string := get_jcl()
                     19:     options: qs := qs$new()
                     20:     while ~string$empty(jcl)  cand
                     21:          (jcl[1] = '-'  cor  jcl[1] = ':'  cor  jcl[1] = '=') do
                     22:        i: int := string$indexc(' ', jcl)
                     23:        s: string
                     24:        if i = 0
                     25:           then s := jcl
                     26:                jcl := ""
                     27:           else s := string$substr(jcl, 1, i - 1)
                     28:                jcl := string$rest(jcl, i + 1)
                     29:           end
                     30:        options := qs$addh(options, s)
                     31:        end
                     32:     while jcl[1] = ' ' do
                     33:        jcl := string$rest(jcl, 2)
                     34:        end except when bounds: end
                     35:     _reset_input()
                     36:     screen$init(options)
                     37:     e: env
                     38:     if done
                     39:        then e := winset$reset()
                     40:        else _gc$control(2**18 - 2**15, 2**17 - 1)
                     41:            e := env$create(false)
                     42:            bufset$init()
                     43:            winset$init(e)
                     44:            bufset$display(e, bufset$create_buf("Main", "", e.buffer))
                     45:            chtab: vec := vec$fill(0, 128, insert_char)
                     46:            for i: int in qp$indexes(tab) do
                     47:                chtab[i - 1] := tab[i]
                     48:                end
                     49:            chtab[c2i(del)] := run_del
                     50:            e.chtab := chtab
                     51:            e.title := "---- Buffer: Main (type ^H for help)"
                     52:            nlines, nchars: int := _get_screen_size()
                     53:            e.top_line := 1
                     54:            e.size := nlines - 2
                     55:            e.width := nchars - 1
                     56:            umask: int := _umask(0)
                     57:            env$store_num(e, "umask", umask)
                     58:            env$store_num(e, "write_mode", i_and(0666, -umask - 1))
                     59:            env$store_str(e, "terminal", "vs100")
                     60:            env$store_str(e, "host", _host_name())
                     61:            done := true
                     62:        end except when not_possible (*): end
                     63:     env$clear(e)
                     64:     if ~string$empty(jcl)
                     65:        then _push_macro_chars(c2s(ctrlr) || jcl || "\r") end
                     66:     macro_file(e, fname$create(_environ("HOME"), "", "ted_init", ""))
                     67:        except when not_found, not_possible (*): end
                     68:     ted(e)
                     69:     end start_up

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.