|
Karsten Hopp |
81c285 |
To: vim-dev@vim.org
|
|
Karsten Hopp |
81c285 |
Subject: Patch 7.2.191
|
|
Karsten Hopp |
81c285 |
Fcc: outbox
|
|
Karsten Hopp |
81c285 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
81c285 |
Mime-Version: 1.0
|
|
Karsten Hopp |
81c285 |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
81c285 |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
81c285 |
------------
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
Patch 7.2.191
|
|
Karsten Hopp |
81c285 |
Problem: Mzscheme interface doesn't work on Ubuntu.
|
|
Karsten Hopp |
81c285 |
Solution: Change autoconf rules. Define missing macro. Some changes to
|
|
Karsten Hopp |
81c285 |
avoid gcc warnings. Remove per-buffer namespace. (Sergey Khorev)
|
|
Karsten Hopp |
81c285 |
Files: runtime/doc/if_mzsch.txt, src/Makefile, src/Make_ming.mak,
|
|
Karsten Hopp |
81c285 |
src/Make_mvc.mak, src/auto/configure, src/configure.in,
|
|
Karsten Hopp |
81c285 |
src/config.mk.in, src/eval.c, src/if_mzsch.c, src/if_mzsch.h,
|
|
Karsten Hopp |
81c285 |
src/main.c, src/proto/if_mzsch.pro
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.190/runtime/doc/if_mzsch.txt 2008-08-09 19:36:48.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- runtime/doc/if_mzsch.txt 2009-05-26 18:49:53.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1,4 ****
|
|
Karsten Hopp |
81c285 |
! *if_mzsch.txt* For Vim version 7.2. Last change: 2008 Jun 28
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
VIM REFERENCE MANUAL by Sergey Khorev
|
|
Karsten Hopp |
81c285 |
--- 1,4 ----
|
|
Karsten Hopp |
81c285 |
! *if_mzsch.txt* For Vim version 7.2. Last change: 2009 May 26
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
VIM REFERENCE MANUAL by Sergey Khorev
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 42,51 ****
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
*:mzfile* *:mzf*
|
|
Karsten Hopp |
81c285 |
:[range]mzf[ile] {file} Execute the MzScheme script in {file}. {not in Vi}
|
|
Karsten Hopp |
81c285 |
- All statements are executed in the namespace of the
|
|
Karsten Hopp |
81c285 |
- buffer that was current during :mzfile start.
|
|
Karsten Hopp |
81c285 |
- If you want to access other namespaces, use
|
|
Karsten Hopp |
81c285 |
- 'parameterize'.
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
All of these commands do essentially the same thing - they execute a piece of
|
|
Karsten Hopp |
81c285 |
MzScheme code, with the "current range" set to the given line
|
|
Karsten Hopp |
81c285 |
--- 42,47 ----
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 54,61 ****
|
|
Karsten Hopp |
81c285 |
In the case of :mzscheme, the code to execute is in the command-line.
|
|
Karsten Hopp |
81c285 |
In the case of :mzfile, the code to execute is the contents of the given file.
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
- Each buffer has its own MzScheme namespace. Global namespace is bound to
|
|
Karsten Hopp |
81c285 |
- the "global-namespace" value from the 'vimext' module.
|
|
Karsten Hopp |
81c285 |
MzScheme interface defines exception exn:vim, derived from exn.
|
|
Karsten Hopp |
81c285 |
It is raised for various Vim errors.
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 50,55 ----
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 79,118 ****
|
|
Karsten Hopp |
81c285 |
e.g.: >
|
|
Karsten Hopp |
81c285 |
:mzscheme (require (prefix vim- vimext))
|
|
Karsten Hopp |
81c285 |
<
|
|
Karsten Hopp |
81c285 |
! All the examples below assume this naming scheme. Note that you need to do
|
|
Karsten Hopp |
81c285 |
! this again for every buffer.
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
- The auto-instantiation can be achieved with autocommands, e.g. you can put
|
|
Karsten Hopp |
81c285 |
- something like this in your .vimrc (EOFs should not have indentation): >
|
|
Karsten Hopp |
81c285 |
- function s:MzRequire()
|
|
Karsten Hopp |
81c285 |
- if has("mzscheme")
|
|
Karsten Hopp |
81c285 |
- :mz << EOF
|
|
Karsten Hopp |
81c285 |
- (require (prefix vim- vimext))
|
|
Karsten Hopp |
81c285 |
- (let ((buf (vim-get-buff-by-name (vim-eval "expand(\"<afile>\")"))))
|
|
Karsten Hopp |
81c285 |
- (when (and buf (not (eq? buf (vim-curr-buff))))
|
|
Karsten Hopp |
81c285 |
- (parameterize ((current-namespace (vim-get-buff-namespace buf)))
|
|
Karsten Hopp |
81c285 |
- (namespace-attach-module vim-global-namespace 'vimext)
|
|
Karsten Hopp |
81c285 |
- (namespace-require '(prefix vim vimext)))))
|
|
Karsten Hopp |
81c285 |
- EOF
|
|
Karsten Hopp |
81c285 |
- endif
|
|
Karsten Hopp |
81c285 |
- endfunction
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
- function s:MzStartup()
|
|
Karsten Hopp |
81c285 |
- if has("mzscheme")
|
|
Karsten Hopp |
81c285 |
- au BufNew,BufNewFile,BufAdd,BufReadPre * :call s:MzRequire()
|
|
Karsten Hopp |
81c285 |
- :mz << EOF
|
|
Karsten Hopp |
81c285 |
- (current-library-collection-paths
|
|
Karsten Hopp |
81c285 |
- (cons
|
|
Karsten Hopp |
81c285 |
- (build-path (find-system-path 'addon-dir) (version) "collects")
|
|
Karsten Hopp |
81c285 |
- (current-library-collection-paths)))
|
|
Karsten Hopp |
81c285 |
- EOF
|
|
Karsten Hopp |
81c285 |
- endif
|
|
Karsten Hopp |
81c285 |
- endfunction
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
- call s:MzStartup()
|
|
Karsten Hopp |
81c285 |
- <
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
- The global namespace just instantiated this module with the prefix "vimext:".
|
|
Karsten Hopp |
81c285 |
*mzscheme-sandbox*
|
|
Karsten Hopp |
81c285 |
When executed in the |sandbox|, access to some filesystem and Vim interface
|
|
Karsten Hopp |
81c285 |
procedures is restricted.
|
|
Karsten Hopp |
81c285 |
--- 73,80 ----
|
|
Karsten Hopp |
81c285 |
e.g.: >
|
|
Karsten Hopp |
81c285 |
:mzscheme (require (prefix vim- vimext))
|
|
Karsten Hopp |
81c285 |
<
|
|
Karsten Hopp |
81c285 |
! All the examples below assume this naming scheme.
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
*mzscheme-sandbox*
|
|
Karsten Hopp |
81c285 |
When executed in the |sandbox|, access to some filesystem and Vim interface
|
|
Karsten Hopp |
81c285 |
procedures is restricted.
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 121,135 ****
|
|
Karsten Hopp |
81c285 |
2. Examples *mzscheme-examples*
|
|
Karsten Hopp |
81c285 |
>
|
|
Karsten Hopp |
81c285 |
:mzscheme (display "Hello")
|
|
Karsten Hopp |
81c285 |
:mzscheme (vim-set-buff-line 10 "This is line #10")
|
|
Karsten Hopp |
81c285 |
<
|
|
Karsten Hopp |
81c285 |
Inline script usage: >
|
|
Karsten Hopp |
81c285 |
function! <SID>SetFirstLine()
|
|
Karsten Hopp |
81c285 |
:mz << EOF
|
|
Karsten Hopp |
81c285 |
(display "!!!")
|
|
Karsten Hopp |
81c285 |
(vim-set-buff-line 1 "This is line #1")
|
|
Karsten Hopp |
81c285 |
(vim-beep)
|
|
Karsten Hopp |
81c285 |
! EOF
|
|
Karsten Hopp |
81c285 |
endfunction
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
nmap <F9> :call <SID>SetFirstLine() <CR>
|
|
Karsten Hopp |
81c285 |
--- 83,102 ----
|
|
Karsten Hopp |
81c285 |
2. Examples *mzscheme-examples*
|
|
Karsten Hopp |
81c285 |
>
|
|
Karsten Hopp |
81c285 |
:mzscheme (display "Hello")
|
|
Karsten Hopp |
81c285 |
+ :mz (display (string-append "Using MzScheme version " (version)))
|
|
Karsten Hopp |
81c285 |
+ :mzscheme (require (prefix vim- vimext)) ; for MzScheme < 4.x
|
|
Karsten Hopp |
81c285 |
+ :mzscheme (require (prefix-in vim- 'vimext)) ; MzScheme 4.x
|
|
Karsten Hopp |
81c285 |
:mzscheme (vim-set-buff-line 10 "This is line #10")
|
|
Karsten Hopp |
81c285 |
<
|
|
Karsten Hopp |
81c285 |
Inline script usage: >
|
|
Karsten Hopp |
81c285 |
function! <SID>SetFirstLine()
|
|
Karsten Hopp |
81c285 |
:mz << EOF
|
|
Karsten Hopp |
81c285 |
(display "!!!")
|
|
Karsten Hopp |
81c285 |
+ (require (prefix vim- vimext))
|
|
Karsten Hopp |
81c285 |
+ ; for newer versions (require (prefix-in vim- 'vimext))
|
|
Karsten Hopp |
81c285 |
(vim-set-buff-line 1 "This is line #1")
|
|
Karsten Hopp |
81c285 |
(vim-beep)
|
|
Karsten Hopp |
81c285 |
! EOF
|
|
Karsten Hopp |
81c285 |
endfunction
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
nmap <F9> :call <SID>SetFirstLine() <CR>
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 137,153 ****
|
|
Karsten Hopp |
81c285 |
File execution: >
|
|
Karsten Hopp |
81c285 |
:mzfile supascript.scm
|
|
Karsten Hopp |
81c285 |
<
|
|
Karsten Hopp |
81c285 |
! Accessing the current buffer namespace from an MzScheme program running in
|
|
Karsten Hopp |
81c285 |
! another buffer within |:mzfile|-executed script : >
|
|
Karsten Hopp |
81c285 |
! ; Move to the window below
|
|
Karsten Hopp |
81c285 |
! (vim-command "wincmd j")
|
|
Karsten Hopp |
81c285 |
! ; execute in the context of buffer, to which window belongs
|
|
Karsten Hopp |
81c285 |
! ; assume that buffer has 'textstring' defined
|
|
Karsten Hopp |
81c285 |
! (parameterize ((current-namespace
|
|
Karsten Hopp |
81c285 |
! (vim-get-buff-namespace (vim-curr-buff))))
|
|
Karsten Hopp |
81c285 |
! (eval '(vim-set-buff-line 1 textstring)))
|
|
Karsten Hopp |
81c285 |
! <
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
==============================================================================
|
|
Karsten Hopp |
81c285 |
3. Threads *mzscheme-threads*
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 104,136 ----
|
|
Karsten Hopp |
81c285 |
File execution: >
|
|
Karsten Hopp |
81c285 |
:mzfile supascript.scm
|
|
Karsten Hopp |
81c285 |
<
|
|
Karsten Hopp |
81c285 |
! Vim exception handling: >
|
|
Karsten Hopp |
81c285 |
! :mz << EOF
|
|
Karsten Hopp |
81c285 |
! (require (prefix vim- vimext))
|
|
Karsten Hopp |
81c285 |
! ; for newer versions (require (prefix-in vim- 'vimext))
|
|
Karsten Hopp |
81c285 |
! (with-handlers
|
|
Karsten Hopp |
81c285 |
! ([exn:vim? (lambda (e) (display (exn-message e)))])
|
|
Karsten Hopp |
81c285 |
! (vim-eval "nonsense-string"))
|
|
Karsten Hopp |
81c285 |
! EOF
|
|
Karsten Hopp |
81c285 |
! <
|
|
Karsten Hopp |
81c285 |
! Auto-instantiation of vimext module (can be placed in your |vimrc|): >
|
|
Karsten Hopp |
81c285 |
! function! MzRequire()
|
|
Karsten Hopp |
81c285 |
! :redir => l:mzversion
|
|
Karsten Hopp |
81c285 |
! :mz (version)
|
|
Karsten Hopp |
81c285 |
! :redir END
|
|
Karsten Hopp |
81c285 |
! if strpart(l:mzversion, 1, 1) < "4"
|
|
Karsten Hopp |
81c285 |
! " MzScheme versions < 4.x:
|
|
Karsten Hopp |
81c285 |
! :mz (require (prefix vim- vimext))
|
|
Karsten Hopp |
81c285 |
! else
|
|
Karsten Hopp |
81c285 |
! " newer versions:
|
|
Karsten Hopp |
81c285 |
! :mz (require (prefix-in vim- 'vimext))
|
|
Karsten Hopp |
81c285 |
! endif
|
|
Karsten Hopp |
81c285 |
! endfunction
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ if has("mzscheme")
|
|
Karsten Hopp |
81c285 |
+ silent call MzRequire()
|
|
Karsten Hopp |
81c285 |
+ endif
|
|
Karsten Hopp |
81c285 |
+ <
|
|
Karsten Hopp |
81c285 |
==============================================================================
|
|
Karsten Hopp |
81c285 |
3. Threads *mzscheme-threads*
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 168,178 ****
|
|
Karsten Hopp |
81c285 |
Common
|
|
Karsten Hopp |
81c285 |
------
|
|
Karsten Hopp |
81c285 |
(command {command-string}) Perform the vim ":Ex" style command.
|
|
Karsten Hopp |
81c285 |
! (eval {expr-string}) Evaluate the vim expression to a string.
|
|
Karsten Hopp |
81c285 |
! A |List| is turned into a string by
|
|
Karsten Hopp |
81c285 |
! joining the items and inserting line
|
|
Karsten Hopp |
81c285 |
! breaks.
|
|
Karsten Hopp |
81c285 |
! NOTE clashes with MzScheme eval
|
|
Karsten Hopp |
81c285 |
(range-start) Start/End of the range passed with
|
|
Karsten Hopp |
81c285 |
(range-end) the Scheme command.
|
|
Karsten Hopp |
81c285 |
(beep) beep
|
|
Karsten Hopp |
81c285 |
--- 151,161 ----
|
|
Karsten Hopp |
81c285 |
Common
|
|
Karsten Hopp |
81c285 |
------
|
|
Karsten Hopp |
81c285 |
(command {command-string}) Perform the vim ":Ex" style command.
|
|
Karsten Hopp |
81c285 |
! (eval {expr-string}) Evaluate the vim expression into
|
|
Karsten Hopp |
81c285 |
! respective MzScheme object: |Lists| are
|
|
Karsten Hopp |
81c285 |
! represented as Scheme lists,
|
|
Karsten Hopp |
81c285 |
! |Dictionaries| as hash tables.
|
|
Karsten Hopp |
81c285 |
! NOTE the name clashes with MzScheme eval
|
|
Karsten Hopp |
81c285 |
(range-start) Start/End of the range passed with
|
|
Karsten Hopp |
81c285 |
(range-end) the Scheme command.
|
|
Karsten Hopp |
81c285 |
(beep) beep
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 186,192 ****
|
|
Karsten Hopp |
81c285 |
be set. The symbol 'global can be passed
|
|
Karsten Hopp |
81c285 |
as {buffer-or-window}. Then |:setglobal|
|
|
Karsten Hopp |
81c285 |
will be used.
|
|
Karsten Hopp |
81c285 |
- global-namespace The MzScheme main namespace.
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
Buffers *mzscheme-buffer*
|
|
Karsten Hopp |
81c285 |
-------
|
|
Karsten Hopp |
81c285 |
--- 169,174 ----
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 228,234 ****
|
|
Karsten Hopp |
81c285 |
if there is no such buffer.
|
|
Karsten Hopp |
81c285 |
(get-buff-by-num {buffernum}) Get a buffer by its number (return #f if
|
|
Karsten Hopp |
81c285 |
there is no buffer with this number).
|
|
Karsten Hopp |
81c285 |
- (get-buff-namespace [buffer]) Get buffer namespace.
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
Windows *mzscheme-window*
|
|
Karsten Hopp |
81c285 |
------
|
|
Karsten Hopp |
81c285 |
--- 210,215 ----
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 250,256 ****
|
|
Karsten Hopp |
81c285 |
(set-cursor (line . col) [window]) Set cursor position.
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
==============================================================================
|
|
Karsten Hopp |
81c285 |
! 5. Dynamic loading *mzscheme-dynamic*
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
On MS-Windows the MzScheme libraries can be loaded dynamically. The |:version|
|
|
Karsten Hopp |
81c285 |
output then includes |+mzscheme/dyn|.
|
|
Karsten Hopp |
81c285 |
--- 231,237 ----
|
|
Karsten Hopp |
81c285 |
(set-cursor (line . col) [window]) Set cursor position.
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
==============================================================================
|
|
Karsten Hopp |
81c285 |
! 5. Dynamic loading *mzscheme-dynamic* *E812*
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
On MS-Windows the MzScheme libraries can be loaded dynamically. The |:version|
|
|
Karsten Hopp |
81c285 |
output then includes |+mzscheme/dyn|.
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.190/src/Makefile 2009-05-26 18:12:19.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/Makefile 2009-05-26 22:54:48.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 536,542 ****
|
|
Karsten Hopp |
81c285 |
# Use this with GCC to check for mistakes, unused arguments, etc.
|
|
Karsten Hopp |
81c285 |
#CFLAGS = -g -Wall -Wextra -Wmissing-prototypes -Wunreachable-code
|
|
Karsten Hopp |
81c285 |
#PYTHON_CFLAGS_EXTRA = -Wno-missing-field-initializers
|
|
Karsten Hopp |
81c285 |
! #MZSCHEME_CFLAGS_EXTRA = -Wno-unreachable-code
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
# EFENCE - Electric-Fence malloc debugging: catches memory accesses beyond
|
|
Karsten Hopp |
81c285 |
# allocated memory (and makes every malloc()/free() very slow).
|
|
Karsten Hopp |
81c285 |
--- 536,542 ----
|
|
Karsten Hopp |
81c285 |
# Use this with GCC to check for mistakes, unused arguments, etc.
|
|
Karsten Hopp |
81c285 |
#CFLAGS = -g -Wall -Wextra -Wmissing-prototypes -Wunreachable-code
|
|
Karsten Hopp |
81c285 |
#PYTHON_CFLAGS_EXTRA = -Wno-missing-field-initializers
|
|
Karsten Hopp |
81c285 |
! #MZSCHEME_CFLAGS_EXTRA = -Wno-unreachable-code -Wno-unused-parameter
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
# EFENCE - Electric-Fence malloc debugging: catches memory accesses beyond
|
|
Karsten Hopp |
81c285 |
# allocated memory (and makes every malloc()/free() very slow).
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2200,2205 ****
|
|
Karsten Hopp |
81c285 |
--- 2200,2206 ----
|
|
Karsten Hopp |
81c285 |
-rm -f $(TOOLS) auto/osdef.h auto/pathdef.c auto/if_perl.c
|
|
Karsten Hopp |
81c285 |
-rm -f conftest* *~ auto/link.sed
|
|
Karsten Hopp |
81c285 |
-rm -rf $(APPDIR)
|
|
Karsten Hopp |
81c285 |
+ -rm -rf mzscheme_base.c
|
|
Karsten Hopp |
81c285 |
if test -d $(PODIR); then \
|
|
Karsten Hopp |
81c285 |
cd $(PODIR); $(MAKE) prefix=$(DESTDIR)$(prefix) clean; \
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2433,2440 ****
|
|
Karsten Hopp |
81c285 |
objects/if_xcmdsrv.o: if_xcmdsrv.c
|
|
Karsten Hopp |
81c285 |
$(CCC) -o $@ if_xcmdsrv.c
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! objects/if_mzsch.o: if_mzsch.c
|
|
Karsten Hopp |
81c285 |
$(CCC) -o $@ $(MZSCHEME_CFLAGS_EXTRA) if_mzsch.c
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
objects/if_perl.o: auto/if_perl.c
|
|
Karsten Hopp |
81c285 |
$(CCC) -o $@ auto/if_perl.c
|
|
Karsten Hopp |
81c285 |
--- 2434,2444 ----
|
|
Karsten Hopp |
81c285 |
objects/if_xcmdsrv.o: if_xcmdsrv.c
|
|
Karsten Hopp |
81c285 |
$(CCC) -o $@ if_xcmdsrv.c
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! objects/if_mzsch.o: if_mzsch.c $(MZSCHEME_EXTRA)
|
|
Karsten Hopp |
81c285 |
$(CCC) -o $@ $(MZSCHEME_CFLAGS_EXTRA) if_mzsch.c
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ mzscheme_base.c:
|
|
Karsten Hopp |
81c285 |
+ $(MZSCHEME_MZC) --c-mods mzscheme_base.c ++lib scheme/base
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
objects/if_perl.o: auto/if_perl.c
|
|
Karsten Hopp |
81c285 |
$(CCC) -o $@ auto/if_perl.c
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.190/src/Make_ming.mak 2007-08-12 15:24:29.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/Make_ming.mak 2009-05-26 18:54:15.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 115,122 ****
|
|
Karsten Hopp |
81c285 |
--- 115,135 ----
|
|
Karsten Hopp |
81c285 |
MZSCHEME_VER=205_000
|
|
Karsten Hopp |
81c285 |
endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ ifndef MZSCHEME_PRECISE_GC
|
|
Karsten Hopp |
81c285 |
+ MZSCHEME_PRECISE_GC=no
|
|
Karsten Hopp |
81c285 |
+ endif
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ # for version 4.x we need to generate byte-code for Scheme base
|
|
Karsten Hopp |
81c285 |
+ ifndef MZSCHEME_GENERATE_BASE
|
|
Karsten Hopp |
81c285 |
+ MZSCHEME_GENERATE_BASE=no
|
|
Karsten Hopp |
81c285 |
+ endif
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
ifeq (no,$(DYNAMIC_MZSCHEME))
|
|
Karsten Hopp |
81c285 |
+ ifeq (yes,$(MZSCHEME_PRECISE_GC))
|
|
Karsten Hopp |
81c285 |
+ MZSCHEME_LIB=-lmzsch$(MZSCHEME_VER)
|
|
Karsten Hopp |
81c285 |
+ else
|
|
Karsten Hopp |
81c285 |
MZSCHEME_LIB = -lmzsch$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
|
|
Karsten Hopp |
81c285 |
+ endif
|
|
Karsten Hopp |
81c285 |
# the modern MinGW can dynamically link to dlls directly.
|
|
Karsten Hopp |
81c285 |
# point MZSCHEME_DLLS to where you put libmzschXXXXXXX.dll and libgcXXXXXXX.dll
|
|
Karsten Hopp |
81c285 |
ifndef MZSCHEME_DLLS
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 410,415 ****
|
|
Karsten Hopp |
81c285 |
--- 423,435 ----
|
|
Karsten Hopp |
81c285 |
ifdef MZSCHEME
|
|
Karsten Hopp |
81c285 |
OBJ += $(OUTDIR)/if_mzsch.o
|
|
Karsten Hopp |
81c285 |
MZSCHEME_INCL = if_mzsch.h
|
|
Karsten Hopp |
81c285 |
+ ifeq (yes,$(MZSCHEME_GENERATE_BASE))
|
|
Karsten Hopp |
81c285 |
+ CFLAGS += -DINCLUDE_MZSCHEME_BASE
|
|
Karsten Hopp |
81c285 |
+ MZ_EXTRA_DEP += mzscheme_base.c
|
|
Karsten Hopp |
81c285 |
+ endif
|
|
Karsten Hopp |
81c285 |
+ ifeq (yes,$(MZSCHEME_PRECISE_GC))
|
|
Karsten Hopp |
81c285 |
+ CFLAGS += -DMZ_PRECISE_GC
|
|
Karsten Hopp |
81c285 |
+ endif
|
|
Karsten Hopp |
81c285 |
endif
|
|
Karsten Hopp |
81c285 |
ifdef PYTHON
|
|
Karsten Hopp |
81c285 |
OBJ += $(OUTDIR)/if_python.o
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 588,593 ****
|
|
Karsten Hopp |
81c285 |
--- 608,619 ----
|
|
Karsten Hopp |
81c285 |
$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
|
|
Karsten Hopp |
81c285 |
$(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ $(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP)
|
|
Karsten Hopp |
81c285 |
+ $(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ mzscheme_base.c:
|
|
Karsten Hopp |
81c285 |
+ $(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
pathdef.c: $(INCL)
|
|
Karsten Hopp |
81c285 |
ifneq (sh.exe, $(SHELL))
|
|
Karsten Hopp |
81c285 |
@echo creating pathdef.c
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.190/src/Make_mvc.mak 2009-02-04 18:34:54.000000000 +0100
|
|
Karsten Hopp |
81c285 |
--- src/Make_mvc.mak 2009-05-26 18:54:51.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 34,39 ****
|
|
Karsten Hopp |
81c285 |
--- 34,40 ----
|
|
Karsten Hopp |
81c285 |
# MZSCHEME=[Path to MzScheme directory]
|
|
Karsten Hopp |
81c285 |
# DYNAMIC_MZSCHEME=yes (to load the MzScheme DLLs dynamically)
|
|
Karsten Hopp |
81c285 |
# MZSCHEME_VER=[version, 205_000, ...]
|
|
Karsten Hopp |
81c285 |
+ # MZSCHEME_DEBUG=no
|
|
Karsten Hopp |
81c285 |
#
|
|
Karsten Hopp |
81c285 |
# Perl interface:
|
|
Karsten Hopp |
81c285 |
# PERL=[Path to Perl directory]
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 621,635 ****
|
|
Karsten Hopp |
81c285 |
--- 622,658 ----
|
|
Karsten Hopp |
81c285 |
MZSCHEME_VER = 205_000
|
|
Karsten Hopp |
81c285 |
!endif
|
|
Karsten Hopp |
81c285 |
CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
|
|
Karsten Hopp |
81c285 |
+ !if EXIST("$(MZSCHEME)\collects\scheme\base.ss")
|
|
Karsten Hopp |
81c285 |
+ # for MzScheme 4.x we need to include byte code for basic Scheme stuff
|
|
Karsten Hopp |
81c285 |
+ MZSCHEME_EXTRA_DEP = mzscheme_base.c
|
|
Karsten Hopp |
81c285 |
+ CFLAGS = $(CFLAGS) -DINCLUDE_MZSCHEME_BASE
|
|
Karsten Hopp |
81c285 |
+ !endif
|
|
Karsten Hopp |
81c285 |
+ !if EXIST("$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib") \
|
|
Karsten Hopp |
81c285 |
+ && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib")
|
|
Karsten Hopp |
81c285 |
+ !message Building with Precise GC
|
|
Karsten Hopp |
81c285 |
+ MZSCHEME_PRECISE_GC = yes
|
|
Karsten Hopp |
81c285 |
+ CFLAGS = $(CFLAGS) -DMZ_PRECISE_GC
|
|
Karsten Hopp |
81c285 |
+ !endif
|
|
Karsten Hopp |
81c285 |
!if "$(DYNAMIC_MZSCHEME)" == "yes"
|
|
Karsten Hopp |
81c285 |
+ !if "$(MZSCHEME_PRECISE_GC)" == "yes"
|
|
Karsten Hopp |
81c285 |
+ !error MzScheme with Precise GC cannot be loaded dynamically
|
|
Karsten Hopp |
81c285 |
+ !endif
|
|
Karsten Hopp |
81c285 |
!message MzScheme DLLs will be loaded dynamically
|
|
Karsten Hopp |
81c285 |
CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME \
|
|
Karsten Hopp |
81c285 |
-DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" \
|
|
Karsten Hopp |
81c285 |
-DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
|
|
Karsten Hopp |
81c285 |
!else
|
|
Karsten Hopp |
81c285 |
+ !if "$(MZSCHEME_DEBUG)" == "yes"
|
|
Karsten Hopp |
81c285 |
+ CFLAGS = $(CFLAGS) -DMZSCHEME_FORCE_GC
|
|
Karsten Hopp |
81c285 |
+ !endif
|
|
Karsten Hopp |
81c285 |
+ !if "$(MZSCHEME_PRECISE_GC)" == "yes"
|
|
Karsten Hopp |
81c285 |
+ # Precise GC does not use separate dll
|
|
Karsten Hopp |
81c285 |
+ MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib
|
|
Karsten Hopp |
81c285 |
+ !else
|
|
Karsten Hopp |
81c285 |
MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib \
|
|
Karsten Hopp |
81c285 |
$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib
|
|
Karsten Hopp |
81c285 |
!endif
|
|
Karsten Hopp |
81c285 |
+ !endif
|
|
Karsten Hopp |
81c285 |
MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
|
|
Karsten Hopp |
81c285 |
!endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 930,938 ****
|
|
Karsten Hopp |
81c285 |
$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
|
|
Karsten Hopp |
81c285 |
$(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! $(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c $(INCL)
|
|
Karsten Hopp |
81c285 |
$(CC) $(CFLAGS) if_mzsch.c \
|
|
Karsten Hopp |
81c285 |
-DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c $(INCL)
|
|
Karsten Hopp |
81c285 |
$(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
|
|
Karsten Hopp |
81c285 |
--- 953,963 ----
|
|
Karsten Hopp |
81c285 |
$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
|
|
Karsten Hopp |
81c285 |
$(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! $(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c $(INCL) $(MZSCHEME_EXTRA_DEP)
|
|
Karsten Hopp |
81c285 |
$(CC) $(CFLAGS) if_mzsch.c \
|
|
Karsten Hopp |
81c285 |
-DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
|
|
Karsten Hopp |
81c285 |
+ mzscheme_base.c:
|
|
Karsten Hopp |
81c285 |
+ $(MZSCHEME)\mzc --c-mods mzscheme_base.c ++lib scheme/base
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c $(INCL)
|
|
Karsten Hopp |
81c285 |
$(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.190/src/auto/configure 2009-05-21 23:25:38.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/auto/configure 2009-05-26 19:12:29.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 701,706 ****
|
|
Karsten Hopp |
81c285 |
--- 701,708 ----
|
|
Karsten Hopp |
81c285 |
shrpenv
|
|
Karsten Hopp |
81c285 |
vi_cv_perllib
|
|
Karsten Hopp |
81c285 |
vi_cv_path_perl
|
|
Karsten Hopp |
81c285 |
+ MZSCHEME_MZC
|
|
Karsten Hopp |
81c285 |
+ MZSCHEME_EXTRA
|
|
Karsten Hopp |
81c285 |
MZSCHEME_CFLAGS
|
|
Karsten Hopp |
81c285 |
MZSCHEME_LIBS
|
|
Karsten Hopp |
81c285 |
MZSCHEME_PRO
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4641,4648 ****
|
|
Karsten Hopp |
81c285 |
$as_echo "\"$PLTHOME\"" >&6; }
|
|
Karsten Hopp |
81c285 |
vi_cv_path_mzscheme_pfx="$PLTHOME"
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! { $as_echo "$as_me:$LINENO: result: \"not set\"" >&5
|
|
Karsten Hopp |
81c285 |
! $as_echo "\"not set\"" >&6; }
|
|
Karsten Hopp |
81c285 |
# Extract the first word of "mzscheme", so it can be a program name with args.
|
|
Karsten Hopp |
81c285 |
set dummy mzscheme; ac_word=$2
|
|
Karsten Hopp |
81c285 |
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
|
|
Karsten Hopp |
81c285 |
--- 4643,4650 ----
|
|
Karsten Hopp |
81c285 |
$as_echo "\"$PLTHOME\"" >&6; }
|
|
Karsten Hopp |
81c285 |
vi_cv_path_mzscheme_pfx="$PLTHOME"
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! { $as_echo "$as_me:$LINENO: result: not set" >&5
|
|
Karsten Hopp |
81c285 |
! $as_echo "not set" >&6; }
|
|
Karsten Hopp |
81c285 |
# Extract the first word of "mzscheme", so it can be a program name with args.
|
|
Karsten Hopp |
81c285 |
set dummy mzscheme; ac_word=$2
|
|
Karsten Hopp |
81c285 |
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4697,4712 ****
|
|
Karsten Hopp |
81c285 |
if test "${vi_cv_path_mzscheme_pfx+set}" = set; then
|
|
Karsten Hopp |
81c285 |
$as_echo_n "(cached) " >&6
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! vi_cv_path_mzscheme_pfx=`
|
|
Karsten Hopp |
81c285 |
! ${vi_cv_path_mzscheme} -evm \
|
|
Karsten Hopp |
81c285 |
! "(display (simplify-path \
|
|
Karsten Hopp |
81c285 |
(build-path (call-with-values \
|
|
Karsten Hopp |
81c285 |
(lambda () (split-path (find-system-path (quote exec-file)))) \
|
|
Karsten Hopp |
81c285 |
! (lambda (base name must-be-dir?) base)) (quote up))))"`
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
{ $as_echo "$as_me:$LINENO: result: $vi_cv_path_mzscheme_pfx" >&5
|
|
Karsten Hopp |
81c285 |
$as_echo "$vi_cv_path_mzscheme_pfx" >&6; }
|
|
Karsten Hopp |
81c285 |
! vi_cv_path_mzscheme_pfx=`echo "$vi_cv_path_mzscheme_pfx" | sed 's+/$++'`
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
--- 4699,4714 ----
|
|
Karsten Hopp |
81c285 |
if test "${vi_cv_path_mzscheme_pfx+set}" = set; then
|
|
Karsten Hopp |
81c285 |
$as_echo_n "(cached) " >&6
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! echo "(display (simplify-path \
|
|
Karsten Hopp |
81c285 |
(build-path (call-with-values \
|
|
Karsten Hopp |
81c285 |
(lambda () (split-path (find-system-path (quote exec-file)))) \
|
|
Karsten Hopp |
81c285 |
! (lambda (base name must-be-dir?) base)) (quote up))))" > mzdirs.scm
|
|
Karsten Hopp |
81c285 |
! vi_cv_path_mzscheme_pfx=`${vi_cv_path_mzscheme} -r mzdirs.scm | \
|
|
Karsten Hopp |
81c285 |
! sed -e 's+/$++'`
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
{ $as_echo "$as_me:$LINENO: result: $vi_cv_path_mzscheme_pfx" >&5
|
|
Karsten Hopp |
81c285 |
$as_echo "$vi_cv_path_mzscheme_pfx" >&6; }
|
|
Karsten Hopp |
81c285 |
! rm -f mzdirs.scm
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4716,4736 ****
|
|
Karsten Hopp |
81c285 |
{ $as_echo "$as_me:$LINENO: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include" >&5
|
|
Karsten Hopp |
81c285 |
$as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include... " >&6; }
|
|
Karsten Hopp |
81c285 |
if test -f $vi_cv_path_mzscheme_pfx/include/scheme.h; then
|
|
Karsten Hopp |
81c285 |
! { $as_echo "$as_me:$LINENO: result: \"yes\"" >&5
|
|
Karsten Hopp |
81c285 |
! $as_echo "\"yes\"" >&6; }
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! { $as_echo "$as_me:$LINENO: result: \"no\"" >&5
|
|
Karsten Hopp |
81c285 |
! $as_echo "\"no\"" >&6; }
|
|
Karsten Hopp |
81c285 |
! { $as_echo "$as_me:$LINENO: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/plt/include" >&5
|
|
Karsten Hopp |
81c285 |
! $as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/plt/include... " >&6; }
|
|
Karsten Hopp |
81c285 |
if test -f $vi_cv_path_mzscheme_pfx/include/plt/scheme.h; then
|
|
Karsten Hopp |
81c285 |
! { $as_echo "$as_me:$LINENO: result: \"yes\"" >&5
|
|
Karsten Hopp |
81c285 |
! $as_echo "\"yes\"" >&6; }
|
|
Karsten Hopp |
81c285 |
! SCHEME_INC=/plt
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! { $as_echo "$as_me:$LINENO: result: \"no\"" >&5
|
|
Karsten Hopp |
81c285 |
! $as_echo "\"no\"" >&6; }
|
|
Karsten Hopp |
81c285 |
! vi_cv_path_mzscheme_pfx=
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
--- 4718,4749 ----
|
|
Karsten Hopp |
81c285 |
{ $as_echo "$as_me:$LINENO: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include" >&5
|
|
Karsten Hopp |
81c285 |
$as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include... " >&6; }
|
|
Karsten Hopp |
81c285 |
if test -f $vi_cv_path_mzscheme_pfx/include/scheme.h; then
|
|
Karsten Hopp |
81c285 |
! SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include
|
|
Karsten Hopp |
81c285 |
! { $as_echo "$as_me:$LINENO: result: yes" >&5
|
|
Karsten Hopp |
81c285 |
! $as_echo "yes" >&6; }
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! { $as_echo "$as_me:$LINENO: result: no" >&5
|
|
Karsten Hopp |
81c285 |
! $as_echo "no" >&6; }
|
|
Karsten Hopp |
81c285 |
! { $as_echo "$as_me:$LINENO: checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt" >&5
|
|
Karsten Hopp |
81c285 |
! $as_echo_n "checking if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt... " >&6; }
|
|
Karsten Hopp |
81c285 |
if test -f $vi_cv_path_mzscheme_pfx/include/plt/scheme.h; then
|
|
Karsten Hopp |
81c285 |
! { $as_echo "$as_me:$LINENO: result: yes" >&5
|
|
Karsten Hopp |
81c285 |
! $as_echo "yes" >&6; }
|
|
Karsten Hopp |
81c285 |
! SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! { $as_echo "$as_me:$LINENO: result: no" >&5
|
|
Karsten Hopp |
81c285 |
! $as_echo "no" >&6; }
|
|
Karsten Hopp |
81c285 |
! { $as_echo "$as_me:$LINENO: checking if scheme.h can be found in /usr/include/plt/" >&5
|
|
Karsten Hopp |
81c285 |
! $as_echo_n "checking if scheme.h can be found in /usr/include/plt/... " >&6; }
|
|
Karsten Hopp |
81c285 |
! if test -f /usr/include/plt/scheme.h; then
|
|
Karsten Hopp |
81c285 |
! { $as_echo "$as_me:$LINENO: result: yes" >&5
|
|
Karsten Hopp |
81c285 |
! $as_echo "yes" >&6; }
|
|
Karsten Hopp |
81c285 |
! SCHEME_INC=/usr/include/plt
|
|
Karsten Hopp |
81c285 |
! else
|
|
Karsten Hopp |
81c285 |
! { $as_echo "$as_me:$LINENO: result: no" >&5
|
|
Karsten Hopp |
81c285 |
! $as_echo "no" >&6; }
|
|
Karsten Hopp |
81c285 |
! vi_cv_path_mzscheme_pfx=
|
|
Karsten Hopp |
81c285 |
! fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4738,4758 ****
|
|
Karsten Hopp |
81c285 |
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
|
|
Karsten Hopp |
81c285 |
if test "x$MACOSX" = "xyes"; then
|
|
Karsten Hopp |
81c285 |
MZSCHEME_LIBS="-framework PLT_MzScheme"
|
|
Karsten Hopp |
81c285 |
elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then
|
|
Karsten Hopp |
81c285 |
MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc"
|
|
Karsten Hopp |
81c285 |
if test "$GCC" = yes; then
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_LIBS="$MZSCHEME_LIBS -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib"
|
|
Karsten Hopp |
81c285 |
elif test "`(uname) 2>/dev/null`" = SunOS &&
|
|
Karsten Hopp |
81c285 |
uname -r | grep '^5' >/dev/null; then
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_LIBS="$MZSCHEME_LIBS -R ${vi_cv_path_mzscheme_pfx}/lib"
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then
|
|
Karsten Hopp |
81c285 |
SCHEME_COLLECTS=lib/plt/
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_CFLAGS="-I${vi_cv_path_mzscheme_pfx}/include${SCHEME_INC} \
|
|
Karsten Hopp |
81c285 |
-DMZSCHEME_COLLECTS='\"${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects\"'"
|
|
Karsten Hopp |
81c285 |
MZSCHEME_SRC="if_mzsch.c"
|
|
Karsten Hopp |
81c285 |
MZSCHEME_OBJ="objects/if_mzsch.o"
|
|
Karsten Hopp |
81c285 |
--- 4751,4784 ----
|
|
Karsten Hopp |
81c285 |
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
|
|
Karsten Hopp |
81c285 |
if test "x$MACOSX" = "xyes"; then
|
|
Karsten Hopp |
81c285 |
MZSCHEME_LIBS="-framework PLT_MzScheme"
|
|
Karsten Hopp |
81c285 |
+ elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then
|
|
Karsten Hopp |
81c285 |
+ MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"
|
|
Karsten Hopp |
81c285 |
+ MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
|
|
Karsten Hopp |
81c285 |
elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then
|
|
Karsten Hopp |
81c285 |
MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.so"; then
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme3m"
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
|
|
Karsten Hopp |
81c285 |
! else
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc"
|
|
Karsten Hopp |
81c285 |
! fi
|
|
Karsten Hopp |
81c285 |
if test "$GCC" = yes; then
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib"
|
|
Karsten Hopp |
81c285 |
elif test "`(uname) 2>/dev/null`" = SunOS &&
|
|
Karsten Hopp |
81c285 |
uname -r | grep '^5' >/dev/null; then
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${vi_cv_path_mzscheme_pfx}/lib"
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then
|
|
Karsten Hopp |
81c285 |
SCHEME_COLLECTS=lib/plt/
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
! if test -f "${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects/scheme/base.ss" ; then
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_EXTRA="mzscheme_base.c"
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE"
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc"
|
|
Karsten Hopp |
81c285 |
! fi
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \
|
|
Karsten Hopp |
81c285 |
-DMZSCHEME_COLLECTS='\"${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects\"'"
|
|
Karsten Hopp |
81c285 |
MZSCHEME_SRC="if_mzsch.c"
|
|
Karsten Hopp |
81c285 |
MZSCHEME_OBJ="objects/if_mzsch.o"
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4767,4772 ****
|
|
Karsten Hopp |
81c285 |
--- 4793,4800 ----
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.190/src/configure.in 2009-05-21 23:25:38.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/configure.in 2009-05-26 18:57:35.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 414,420 ****
|
|
Karsten Hopp |
81c285 |
AC_MSG_RESULT("$PLTHOME")
|
|
Karsten Hopp |
81c285 |
vi_cv_path_mzscheme_pfx="$PLTHOME"
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! AC_MSG_RESULT("not set")
|
|
Karsten Hopp |
81c285 |
dnl -- try to find MzScheme executable
|
|
Karsten Hopp |
81c285 |
AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme)
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 414,420 ----
|
|
Karsten Hopp |
81c285 |
AC_MSG_RESULT("$PLTHOME")
|
|
Karsten Hopp |
81c285 |
vi_cv_path_mzscheme_pfx="$PLTHOME"
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! AC_MSG_RESULT(not set)
|
|
Karsten Hopp |
81c285 |
dnl -- try to find MzScheme executable
|
|
Karsten Hopp |
81c285 |
AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme)
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 430,443 ****
|
|
Karsten Hopp |
81c285 |
if test "X$vi_cv_path_mzscheme" != "X"; then
|
|
Karsten Hopp |
81c285 |
dnl -- find where MzScheme thinks it was installed
|
|
Karsten Hopp |
81c285 |
AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx,
|
|
Karsten Hopp |
81c285 |
! [ vi_cv_path_mzscheme_pfx=`
|
|
Karsten Hopp |
81c285 |
! ${vi_cv_path_mzscheme} -evm \
|
|
Karsten Hopp |
81c285 |
! "(display (simplify-path \
|
|
Karsten Hopp |
81c285 |
(build-path (call-with-values \
|
|
Karsten Hopp |
81c285 |
(lambda () (split-path (find-system-path (quote exec-file)))) \
|
|
Karsten Hopp |
81c285 |
! (lambda (base name must-be-dir?) base)) (quote up))))"` ])
|
|
Karsten Hopp |
81c285 |
! dnl Remove a trailing slash.
|
|
Karsten Hopp |
81c285 |
! vi_cv_path_mzscheme_pfx=`echo "$vi_cv_path_mzscheme_pfx" | sed 's+/$++'`
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
--- 430,445 ----
|
|
Karsten Hopp |
81c285 |
if test "X$vi_cv_path_mzscheme" != "X"; then
|
|
Karsten Hopp |
81c285 |
dnl -- find where MzScheme thinks it was installed
|
|
Karsten Hopp |
81c285 |
AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx,
|
|
Karsten Hopp |
81c285 |
! dnl different versions of MzScheme differ in command line processing
|
|
Karsten Hopp |
81c285 |
! dnl use universal approach
|
|
Karsten Hopp |
81c285 |
! echo "(display (simplify-path \
|
|
Karsten Hopp |
81c285 |
(build-path (call-with-values \
|
|
Karsten Hopp |
81c285 |
(lambda () (split-path (find-system-path (quote exec-file)))) \
|
|
Karsten Hopp |
81c285 |
! (lambda (base name must-be-dir?) base)) (quote up))))" > mzdirs.scm
|
|
Karsten Hopp |
81c285 |
! dnl Remove a trailing slash
|
|
Karsten Hopp |
81c285 |
! [ vi_cv_path_mzscheme_pfx=`${vi_cv_path_mzscheme} -r mzdirs.scm | \
|
|
Karsten Hopp |
81c285 |
! sed -e 's+/$++'` ])
|
|
Karsten Hopp |
81c285 |
! rm -f mzdirs.scm
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 446,461 ****
|
|
Karsten Hopp |
81c285 |
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
|
|
Karsten Hopp |
81c285 |
AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include)
|
|
Karsten Hopp |
81c285 |
if test -f $vi_cv_path_mzscheme_pfx/include/scheme.h; then
|
|
Karsten Hopp |
81c285 |
! AC_MSG_RESULT("yes")
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! AC_MSG_RESULT("no")
|
|
Karsten Hopp |
81c285 |
! AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/plt/include)
|
|
Karsten Hopp |
81c285 |
if test -f $vi_cv_path_mzscheme_pfx/include/plt/scheme.h; then
|
|
Karsten Hopp |
81c285 |
! AC_MSG_RESULT("yes")
|
|
Karsten Hopp |
81c285 |
! SCHEME_INC=/plt
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! AC_MSG_RESULT("no")
|
|
Karsten Hopp |
81c285 |
! vi_cv_path_mzscheme_pfx=
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
--- 448,471 ----
|
|
Karsten Hopp |
81c285 |
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
|
|
Karsten Hopp |
81c285 |
AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include)
|
|
Karsten Hopp |
81c285 |
if test -f $vi_cv_path_mzscheme_pfx/include/scheme.h; then
|
|
Karsten Hopp |
81c285 |
! SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include
|
|
Karsten Hopp |
81c285 |
! AC_MSG_RESULT(yes)
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! AC_MSG_RESULT(no)
|
|
Karsten Hopp |
81c285 |
! AC_MSG_CHECKING(if scheme.h can be found in $vi_cv_path_mzscheme_pfx/include/plt)
|
|
Karsten Hopp |
81c285 |
if test -f $vi_cv_path_mzscheme_pfx/include/plt/scheme.h; then
|
|
Karsten Hopp |
81c285 |
! AC_MSG_RESULT(yes)
|
|
Karsten Hopp |
81c285 |
! SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! AC_MSG_RESULT(no)
|
|
Karsten Hopp |
81c285 |
! AC_MSG_CHECKING(if scheme.h can be found in /usr/include/plt/)
|
|
Karsten Hopp |
81c285 |
! if test -f /usr/include/plt/scheme.h; then
|
|
Karsten Hopp |
81c285 |
! AC_MSG_RESULT(yes)
|
|
Karsten Hopp |
81c285 |
! SCHEME_INC=/usr/include/plt
|
|
Karsten Hopp |
81c285 |
! else
|
|
Karsten Hopp |
81c285 |
! AC_MSG_RESULT(no)
|
|
Karsten Hopp |
81c285 |
! vi_cv_path_mzscheme_pfx=
|
|
Karsten Hopp |
81c285 |
! fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 463,485 ****
|
|
Karsten Hopp |
81c285 |
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
|
|
Karsten Hopp |
81c285 |
if test "x$MACOSX" = "xyes"; then
|
|
Karsten Hopp |
81c285 |
MZSCHEME_LIBS="-framework PLT_MzScheme"
|
|
Karsten Hopp |
81c285 |
elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then
|
|
Karsten Hopp |
81c285 |
MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc"
|
|
Karsten Hopp |
81c285 |
if test "$GCC" = yes; then
|
|
Karsten Hopp |
81c285 |
dnl Make Vim remember the path to the library. For when it's not in
|
|
Karsten Hopp |
81c285 |
dnl $LD_LIBRARY_PATH.
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_LIBS="$MZSCHEME_LIBS -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib"
|
|
Karsten Hopp |
81c285 |
elif test "`(uname) 2>/dev/null`" = SunOS &&
|
|
Karsten Hopp |
81c285 |
uname -r | grep '^5' >/dev/null; then
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_LIBS="$MZSCHEME_LIBS -R ${vi_cv_path_mzscheme_pfx}/lib"
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then
|
|
Karsten Hopp |
81c285 |
SCHEME_COLLECTS=lib/plt/
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_CFLAGS="-I${vi_cv_path_mzscheme_pfx}/include${SCHEME_INC} \
|
|
Karsten Hopp |
81c285 |
-DMZSCHEME_COLLECTS='\"${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects\"'"
|
|
Karsten Hopp |
81c285 |
MZSCHEME_SRC="if_mzsch.c"
|
|
Karsten Hopp |
81c285 |
MZSCHEME_OBJ="objects/if_mzsch.o"
|
|
Karsten Hopp |
81c285 |
--- 473,510 ----
|
|
Karsten Hopp |
81c285 |
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
|
|
Karsten Hopp |
81c285 |
if test "x$MACOSX" = "xyes"; then
|
|
Karsten Hopp |
81c285 |
MZSCHEME_LIBS="-framework PLT_MzScheme"
|
|
Karsten Hopp |
81c285 |
+ elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then
|
|
Karsten Hopp |
81c285 |
+ MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"
|
|
Karsten Hopp |
81c285 |
+ MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
|
|
Karsten Hopp |
81c285 |
elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then
|
|
Karsten Hopp |
81c285 |
MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
! dnl Using shared objects
|
|
Karsten Hopp |
81c285 |
! if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.so"; then
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme3m"
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
|
|
Karsten Hopp |
81c285 |
! else
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc"
|
|
Karsten Hopp |
81c285 |
! fi
|
|
Karsten Hopp |
81c285 |
if test "$GCC" = yes; then
|
|
Karsten Hopp |
81c285 |
dnl Make Vim remember the path to the library. For when it's not in
|
|
Karsten Hopp |
81c285 |
dnl $LD_LIBRARY_PATH.
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_LIBS="${MZSCHEME_LIBS} -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib"
|
|
Karsten Hopp |
81c285 |
elif test "`(uname) 2>/dev/null`" = SunOS &&
|
|
Karsten Hopp |
81c285 |
uname -r | grep '^5' >/dev/null; then
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_LIBS="${MZSCHEME_LIBS} -R ${vi_cv_path_mzscheme_pfx}/lib"
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then
|
|
Karsten Hopp |
81c285 |
SCHEME_COLLECTS=lib/plt/
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
! if test -f "${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects/scheme/base.ss" ; then
|
|
Karsten Hopp |
81c285 |
! dnl need to generate bytecode for MzScheme base
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_EXTRA="mzscheme_base.c"
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -DINCLUDE_MZSCHEME_BASE"
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc"
|
|
Karsten Hopp |
81c285 |
! fi
|
|
Karsten Hopp |
81c285 |
! MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \
|
|
Karsten Hopp |
81c285 |
-DMZSCHEME_COLLECTS='\"${vi_cv_path_mzscheme_pfx}/${SCHEME_COLLECTS}collects\"'"
|
|
Karsten Hopp |
81c285 |
MZSCHEME_SRC="if_mzsch.c"
|
|
Karsten Hopp |
81c285 |
MZSCHEME_OBJ="objects/if_mzsch.o"
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 491,496 ****
|
|
Karsten Hopp |
81c285 |
--- 516,523 ----
|
|
Karsten Hopp |
81c285 |
AC_SUBST(MZSCHEME_PRO)
|
|
Karsten Hopp |
81c285 |
AC_SUBST(MZSCHEME_LIBS)
|
|
Karsten Hopp |
81c285 |
AC_SUBST(MZSCHEME_CFLAGS)
|
|
Karsten Hopp |
81c285 |
+ AC_SUBST(MZSCHEME_EXTRA)
|
|
Karsten Hopp |
81c285 |
+ AC_SUBST(MZSCHEME_MZC)
|
|
Karsten Hopp |
81c285 |
fi
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.190/src/config.mk.in 2008-06-25 00:49:03.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/config.mk.in 2009-05-26 18:57:49.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 41,46 ****
|
|
Karsten Hopp |
81c285 |
--- 41,48 ----
|
|
Karsten Hopp |
81c285 |
MZSCHEME_OBJ = @MZSCHEME_OBJ@
|
|
Karsten Hopp |
81c285 |
MZSCHEME_CFLAGS = @MZSCHEME_CFLAGS@
|
|
Karsten Hopp |
81c285 |
MZSCHEME_PRO = @MZSCHEME_PRO@
|
|
Karsten Hopp |
81c285 |
+ MZSCHEME_EXTRA = @MZSCHEME_EXTRA@
|
|
Karsten Hopp |
81c285 |
+ MZSCHEME_MZC = @MZSCHEME_MZC@
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
PERL = @vi_cv_path_perl@
|
|
Karsten Hopp |
81c285 |
PERLLIB = @vi_cv_perllib@
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.190/src/eval.c 2009-05-24 13:40:17.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/eval.c 2009-05-26 18:58:20.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 5866,5872 ****
|
|
Karsten Hopp |
81c285 |
return item1 == NULL && item2 == NULL;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! #if defined(FEAT_PYTHON) || defined(PROTO)
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* Return the dictitem that an entry in a hashtable points to.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
--- 5866,5872 ----
|
|
Karsten Hopp |
81c285 |
return item1 == NULL && item2 == NULL;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! #if defined(FEAT_PYTHON) || defined(FEAT_MZSCHEME) || defined(PROTO)
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* Return the dictitem that an entry in a hashtable points to.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.190/src/if_mzsch.c 2009-05-17 16:23:20.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/if_mzsch.c 2009-05-26 19:24:18.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 4,9 ****
|
|
Karsten Hopp |
81c285 |
--- 4,11 ----
|
|
Karsten Hopp |
81c285 |
* Original work by Brent Fulgham <bfulgham@debian.org>
|
|
Karsten Hopp |
81c285 |
* (Based on lots of help from Matthew Flatt)
|
|
Karsten Hopp |
81c285 |
*
|
|
Karsten Hopp |
81c285 |
+ * TODO Convert byte-strings to char strings?
|
|
Karsten Hopp |
81c285 |
+ *
|
|
Karsten Hopp |
81c285 |
* This consists of six parts:
|
|
Karsten Hopp |
81c285 |
* 1. MzScheme interpreter main program
|
|
Karsten Hopp |
81c285 |
* 2. Routines that handle the external interface between MzScheme and
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 18,24 ****
|
|
Karsten Hopp |
81c285 |
* garbage collector will do it self
|
|
Karsten Hopp |
81c285 |
* 2. Requires at least NORMAL features. I can't imagine why one may want
|
|
Karsten Hopp |
81c285 |
* to build with SMALL or TINY features but with MzScheme interface.
|
|
Karsten Hopp |
81c285 |
! * 3. I don't use K&R-style functions. Anyway, MzScheme headers are ANSI.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#include "vim.h"
|
|
Karsten Hopp |
81c285 |
--- 20,26 ----
|
|
Karsten Hopp |
81c285 |
* garbage collector will do it self
|
|
Karsten Hopp |
81c285 |
* 2. Requires at least NORMAL features. I can't imagine why one may want
|
|
Karsten Hopp |
81c285 |
* to build with SMALL or TINY features but with MzScheme interface.
|
|
Karsten Hopp |
81c285 |
! * 3. I don't use K&R-style functions. Anyways, MzScheme headers are ANSI.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#include "vim.h"
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 29,42 ****
|
|
Karsten Hopp |
81c285 |
* depend". */
|
|
Karsten Hopp |
81c285 |
#if defined(FEAT_MZSCHEME) || defined(PROTO)
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* Base data structures */
|
|
Karsten Hopp |
81c285 |
#define SCHEME_VIMBUFFERP(obj) SAME_TYPE(SCHEME_TYPE(obj), mz_buffer_type)
|
|
Karsten Hopp |
81c285 |
#define SCHEME_VIMWINDOWP(obj) SAME_TYPE(SCHEME_TYPE(obj), mz_window_type)
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
typedef struct
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Scheme_Type tag;
|
|
Karsten Hopp |
81c285 |
! Scheme_Env *env;
|
|
Karsten Hopp |
81c285 |
buf_T *buf;
|
|
Karsten Hopp |
81c285 |
} vim_mz_buffer;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 31,45 ----
|
|
Karsten Hopp |
81c285 |
* depend". */
|
|
Karsten Hopp |
81c285 |
#if defined(FEAT_MZSCHEME) || defined(PROTO)
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ #include <assert.h>
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
/* Base data structures */
|
|
Karsten Hopp |
81c285 |
#define SCHEME_VIMBUFFERP(obj) SAME_TYPE(SCHEME_TYPE(obj), mz_buffer_type)
|
|
Karsten Hopp |
81c285 |
#define SCHEME_VIMWINDOWP(obj) SAME_TYPE(SCHEME_TYPE(obj), mz_window_type)
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
typedef struct
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Scheme_Object so;
|
|
Karsten Hopp |
81c285 |
buf_T *buf;
|
|
Karsten Hopp |
81c285 |
} vim_mz_buffer;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 44,50 ****
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
typedef struct
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Scheme_Type tag;
|
|
Karsten Hopp |
81c285 |
win_T *win;
|
|
Karsten Hopp |
81c285 |
} vim_mz_window;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 47,53 ----
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
typedef struct
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Scheme_Object so;
|
|
Karsten Hopp |
81c285 |
win_T *win;
|
|
Karsten Hopp |
81c285 |
} vim_mz_window;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 67,85 ****
|
|
Karsten Hopp |
81c285 |
Scheme_Object *port;
|
|
Karsten Hopp |
81c285 |
} Port_Info;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
- /* info for closed prim */
|
|
Karsten Hopp |
81c285 |
- /*
|
|
Karsten Hopp |
81c285 |
- * data have different means:
|
|
Karsten Hopp |
81c285 |
- * for do_eval it is char*
|
|
Karsten Hopp |
81c285 |
- * for do_apply is Apply_Onfo*
|
|
Karsten Hopp |
81c285 |
- * for do_load is Port_Info*
|
|
Karsten Hopp |
81c285 |
- */
|
|
Karsten Hopp |
81c285 |
- typedef struct
|
|
Karsten Hopp |
81c285 |
- {
|
|
Karsten Hopp |
81c285 |
- void *data;
|
|
Karsten Hopp |
81c285 |
- Scheme_Env *env;
|
|
Karsten Hopp |
81c285 |
- } Cmd_Info;
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
/* info for do_apply */
|
|
Karsten Hopp |
81c285 |
typedef struct
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
--- 70,75 ----
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 122,128 ****
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *insert_buffer_line_list(void *, int, Scheme_Object **);
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *get_range_start(void *, int, Scheme_Object **);
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *get_range_end(void *, int, Scheme_Object **);
|
|
Karsten Hopp |
81c285 |
- static Scheme_Object *get_buffer_namespace(void *, int, Scheme_Object **);
|
|
Karsten Hopp |
81c285 |
static vim_mz_buffer *get_vim_curr_buffer(void);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* Window-related commands */
|
|
Karsten Hopp |
81c285 |
--- 112,117 ----
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 163,170 ****
|
|
Karsten Hopp |
81c285 |
static int do_mzscheme_command(exarg_T *, void *, Scheme_Closed_Prim *what);
|
|
Karsten Hopp |
81c285 |
static void startup_mzscheme(void);
|
|
Karsten Hopp |
81c285 |
static char *string_to_line(Scheme_Object *obj);
|
|
Karsten Hopp |
81c285 |
- static int mzscheme_io_init(void);
|
|
Karsten Hopp |
81c285 |
- static void mzscheme_interface_init(vim_mz_buffer *self);
|
|
Karsten Hopp |
81c285 |
static void do_output(char *mesg, long len);
|
|
Karsten Hopp |
81c285 |
static void do_printf(char *format, ...);
|
|
Karsten Hopp |
81c285 |
static void do_flush(void);
|
|
Karsten Hopp |
81c285 |
--- 152,157 ----
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 174,192 ****
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *do_eval(void *, int noargc, Scheme_Object **noargv);
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *do_load(void *, int noargc, Scheme_Object **noargv);
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *do_apply(void *, int noargc, Scheme_Object **noargv);
|
|
Karsten Hopp |
81c285 |
! static void register_vim_exn(Scheme_Env *env);
|
|
Karsten Hopp |
81c285 |
static vim_mz_buffer *get_buffer_arg(const char *fname, int argnum,
|
|
Karsten Hopp |
81c285 |
int argc, Scheme_Object **argv);
|
|
Karsten Hopp |
81c285 |
static vim_mz_window *get_window_arg(const char *fname, int argnum,
|
|
Karsten Hopp |
81c285 |
int argc, Scheme_Object **argv);
|
|
Karsten Hopp |
81c285 |
- static void add_vim_exn(Scheme_Env *env);
|
|
Karsten Hopp |
81c285 |
static int line_in_range(linenr_T, buf_T *);
|
|
Karsten Hopp |
81c285 |
static void check_line_range(linenr_T, buf_T *);
|
|
Karsten Hopp |
81c285 |
static void mz_fix_cursor(int lo, int hi, int extra);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! static int eval_in_namespace(void *, Scheme_Closed_Prim *, Scheme_Env *,
|
|
Karsten Hopp |
81c285 |
! Scheme_Object **ret);
|
|
Karsten Hopp |
81c285 |
! static void make_modules(Scheme_Env *);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#ifdef DYNAMIC_MZSCHEME
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 161,212 ----
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *do_eval(void *, int noargc, Scheme_Object **noargv);
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *do_load(void *, int noargc, Scheme_Object **noargv);
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *do_apply(void *, int noargc, Scheme_Object **noargv);
|
|
Karsten Hopp |
81c285 |
! static void register_vim_exn(void);
|
|
Karsten Hopp |
81c285 |
static vim_mz_buffer *get_buffer_arg(const char *fname, int argnum,
|
|
Karsten Hopp |
81c285 |
int argc, Scheme_Object **argv);
|
|
Karsten Hopp |
81c285 |
static vim_mz_window *get_window_arg(const char *fname, int argnum,
|
|
Karsten Hopp |
81c285 |
int argc, Scheme_Object **argv);
|
|
Karsten Hopp |
81c285 |
static int line_in_range(linenr_T, buf_T *);
|
|
Karsten Hopp |
81c285 |
static void check_line_range(linenr_T, buf_T *);
|
|
Karsten Hopp |
81c285 |
static void mz_fix_cursor(int lo, int hi, int extra);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! static int eval_with_exn_handling(void *, Scheme_Closed_Prim *,
|
|
Karsten Hopp |
81c285 |
! Scheme_Object **ret);
|
|
Karsten Hopp |
81c285 |
! static void make_modules(void);
|
|
Karsten Hopp |
81c285 |
! static void init_exn_catching_apply(void);
|
|
Karsten Hopp |
81c285 |
! static int mzscheme_env_main(Scheme_Env *env, int argc, char **argv);
|
|
Karsten Hopp |
81c285 |
! static int mzscheme_init(void);
|
|
Karsten Hopp |
81c285 |
! #ifdef FEAT_EVAL
|
|
Karsten Hopp |
81c285 |
! static Scheme_Object *vim_to_mzscheme(typval_T *vim_value, int depth,
|
|
Karsten Hopp |
81c285 |
! Scheme_Hash_Table *visited);
|
|
Karsten Hopp |
81c285 |
! #endif
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! #ifdef MZ_PRECISE_GC
|
|
Karsten Hopp |
81c285 |
! static int buffer_size_proc(void *obj)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! return gcBYTES_TO_WORDS(sizeof(vim_mz_buffer));
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! static int buffer_mark_proc(void *obj)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! return buffer_size_proc(obj);
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! static int buffer_fixup_proc(void *obj)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! return buffer_size_proc(obj);
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! static int window_size_proc(void *obj)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! return gcBYTES_TO_WORDS(sizeof(vim_mz_window));
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! static int window_mark_proc(void *obj)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! return window_size_proc(obj);
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! static int window_fixup_proc(void *obj)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! return window_size_proc(obj);
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! #endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#ifdef DYNAMIC_MZSCHEME
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 260,267 ****
|
|
Karsten Hopp |
81c285 |
(Scheme_Closed_Prim *prim, void *data, const char *name, mzshort mina,
|
|
Karsten Hopp |
81c285 |
mzshort maxa);
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *(*dll_scheme_make_integer_value)(long i);
|
|
Karsten Hopp |
81c285 |
- static Scheme_Object *(*dll_scheme_make_namespace)(int argc,
|
|
Karsten Hopp |
81c285 |
- Scheme_Object *argv[]);
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *(*dll_scheme_make_pair)(Scheme_Object *car,
|
|
Karsten Hopp |
81c285 |
Scheme_Object *cdr);
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *(*dll_scheme_make_prim_w_arity)(Scheme_Prim *prim,
|
|
Karsten Hopp |
81c285 |
--- 280,285 ----
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 311,316 ****
|
|
Karsten Hopp |
81c285 |
--- 329,345 ----
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *(*dll_scheme_char_string_to_path)
|
|
Karsten Hopp |
81c285 |
(Scheme_Object *s);
|
|
Karsten Hopp |
81c285 |
# endif
|
|
Karsten Hopp |
81c285 |
+ static Scheme_Hash_Table *(*dll_scheme_make_hash_table)(int type);
|
|
Karsten Hopp |
81c285 |
+ static void (*dll_scheme_hash_set)(Scheme_Hash_Table *table,
|
|
Karsten Hopp |
81c285 |
+ Scheme_Object *key, Scheme_Object *value);
|
|
Karsten Hopp |
81c285 |
+ static Scheme_Object *(*dll_scheme_hash_get)(Scheme_Hash_Table *table,
|
|
Karsten Hopp |
81c285 |
+ Scheme_Object *key);
|
|
Karsten Hopp |
81c285 |
+ static Scheme_Object *(*dll_scheme_make_double)(double d);
|
|
Karsten Hopp |
81c285 |
+ # ifdef INCLUDE_MZSCHEME_BASE
|
|
Karsten Hopp |
81c285 |
+ static Scheme_Object *(*dll_scheme_make_sized_byte_string)(char *chars,
|
|
Karsten Hopp |
81c285 |
+ long len, int copy);
|
|
Karsten Hopp |
81c285 |
+ static Scheme_Object *(*dll_scheme_namespace_require)(Scheme_Object *req);
|
|
Karsten Hopp |
81c285 |
+ # endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* arrays are imported directly */
|
|
Karsten Hopp |
81c285 |
# define scheme_eof dll_scheme_eof
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 368,374 ****
|
|
Karsten Hopp |
81c285 |
# define scheme_lookup_global dll_scheme_lookup_global
|
|
Karsten Hopp |
81c285 |
# define scheme_make_closed_prim_w_arity dll_scheme_make_closed_prim_w_arity
|
|
Karsten Hopp |
81c285 |
# define scheme_make_integer_value dll_scheme_make_integer_value
|
|
Karsten Hopp |
81c285 |
- # define scheme_make_namespace dll_scheme_make_namespace
|
|
Karsten Hopp |
81c285 |
# define scheme_make_pair dll_scheme_make_pair
|
|
Karsten Hopp |
81c285 |
# define scheme_make_prim_w_arity dll_scheme_make_prim_w_arity
|
|
Karsten Hopp |
81c285 |
# if MZSCHEME_VERSION_MAJOR < 299
|
|
Karsten Hopp |
81c285 |
--- 397,402 ----
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 403,408 ****
|
|
Karsten Hopp |
81c285 |
--- 431,444 ----
|
|
Karsten Hopp |
81c285 |
# define scheme_char_string_to_path \
|
|
Karsten Hopp |
81c285 |
dll_scheme_char_string_to_path
|
|
Karsten Hopp |
81c285 |
# endif
|
|
Karsten Hopp |
81c285 |
+ # define scheme_make_hash_table dll_scheme_make_hash_table
|
|
Karsten Hopp |
81c285 |
+ # define scheme_hash_set dll_scheme_hash_set
|
|
Karsten Hopp |
81c285 |
+ # define scheme_hash_get dll_scheme_hash_get
|
|
Karsten Hopp |
81c285 |
+ # define scheme_make_double dll_scheme_make_double
|
|
Karsten Hopp |
81c285 |
+ # ifdef INCLUDE_MZSCHEME_BASE
|
|
Karsten Hopp |
81c285 |
+ # define scheme_make_sized_byte_string dll_scheme_make_sized_byte_string
|
|
Karsten Hopp |
81c285 |
+ # define scheme_namespace_require dll_scheme_namespace_require
|
|
Karsten Hopp |
81c285 |
+ # endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
typedef struct
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 468,474 ****
|
|
Karsten Hopp |
81c285 |
{"scheme_make_closed_prim_w_arity",
|
|
Karsten Hopp |
81c285 |
(void **)&dll_scheme_make_closed_prim_w_arity},
|
|
Karsten Hopp |
81c285 |
{"scheme_make_integer_value", (void **)&dll_scheme_make_integer_value},
|
|
Karsten Hopp |
81c285 |
- {"scheme_make_namespace", (void **)&dll_scheme_make_namespace},
|
|
Karsten Hopp |
81c285 |
{"scheme_make_pair", (void **)&dll_scheme_make_pair},
|
|
Karsten Hopp |
81c285 |
{"scheme_make_prim_w_arity", (void **)&dll_scheme_make_prim_w_arity},
|
|
Karsten Hopp |
81c285 |
# if MZSCHEME_VERSION_MAJOR < 299
|
|
Karsten Hopp |
81c285 |
--- 504,509 ----
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 502,510 ****
|
|
Karsten Hopp |
81c285 |
{"scheme_current_config", (void **)&dll_scheme_current_config},
|
|
Karsten Hopp |
81c285 |
{"scheme_char_string_to_byte_string",
|
|
Karsten Hopp |
81c285 |
(void **)&dll_scheme_char_string_to_byte_string},
|
|
Karsten Hopp |
81c285 |
! {"scheme_char_string_to_path",
|
|
Karsten Hopp |
81c285 |
! (void **)&dll_scheme_char_string_to_path},
|
|
Karsten Hopp |
81c285 |
# endif
|
|
Karsten Hopp |
81c285 |
{NULL, NULL}};
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
static HINSTANCE hMzGC = 0;
|
|
Karsten Hopp |
81c285 |
--- 537,552 ----
|
|
Karsten Hopp |
81c285 |
{"scheme_current_config", (void **)&dll_scheme_current_config},
|
|
Karsten Hopp |
81c285 |
{"scheme_char_string_to_byte_string",
|
|
Karsten Hopp |
81c285 |
(void **)&dll_scheme_char_string_to_byte_string},
|
|
Karsten Hopp |
81c285 |
! {"scheme_char_string_to_path", (void **)&dll_scheme_char_string_to_path},
|
|
Karsten Hopp |
81c285 |
# endif
|
|
Karsten Hopp |
81c285 |
+ {"scheme_make_hash_table", (void **)&dll_scheme_make_hash_table},
|
|
Karsten Hopp |
81c285 |
+ {"scheme_hash_set", (void **)&dll_scheme_hash_set},
|
|
Karsten Hopp |
81c285 |
+ {"scheme_hash_get", (void **)&dll_scheme_hash_get},
|
|
Karsten Hopp |
81c285 |
+ {"scheme_make_double", (void **)&dll_scheme_make_double},
|
|
Karsten Hopp |
81c285 |
+ # ifdef INCLUDE_MZSCHEME_BASE
|
|
Karsten Hopp |
81c285 |
+ {"scheme_make_sized_byte_string", (void **)&dll_scheme_make_sized_byte_string},
|
|
Karsten Hopp |
81c285 |
+ {"scheme_namespace_require", (void **)&dll_scheme_namespace_require},
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
{NULL, NULL}};
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
static HINSTANCE hMzGC = 0;
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 592,597 ****
|
|
Karsten Hopp |
81c285 |
--- 634,644 ----
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
#endif /* DYNAMIC_MZSCHEME */
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ /* need to put it here for dynamic stuff to work */
|
|
Karsten Hopp |
81c285 |
+ #ifdef INCLUDE_MZSCHEME_BASE
|
|
Karsten Hopp |
81c285 |
+ # include "mzscheme_base.c"
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
*========================================================================
|
|
Karsten Hopp |
81c285 |
* 1. MzScheme interpreter startup
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 601,621 ****
|
|
Karsten Hopp |
81c285 |
static Scheme_Type mz_buffer_type;
|
|
Karsten Hopp |
81c285 |
static Scheme_Type mz_window_type;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! static int initialized = 0;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* global environment */
|
|
Karsten Hopp |
81c285 |
static Scheme_Env *environment = NULL;
|
|
Karsten Hopp |
81c285 |
/* output/error handlers */
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *curout = NULL;
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *curerr = NULL;
|
|
Karsten Hopp |
81c285 |
! /* vim:exn exception */
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *exn_catching_apply = NULL;
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *exn_p = NULL;
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *exn_message = NULL;
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *vim_exn = NULL; /* Vim Error exception */
|
|
Karsten Hopp |
81c285 |
! /* values for exn:vim - constructor, predicate, accessors etc */
|
|
Karsten Hopp |
81c285 |
! static Scheme_Object *vim_exn_names = NULL;
|
|
Karsten Hopp |
81c285 |
! static Scheme_Object *vim_exn_values = NULL;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
static long range_start;
|
|
Karsten Hopp |
81c285 |
static long range_end;
|
|
Karsten Hopp |
81c285 |
--- 648,669 ----
|
|
Karsten Hopp |
81c285 |
static Scheme_Type mz_buffer_type;
|
|
Karsten Hopp |
81c285 |
static Scheme_Type mz_window_type;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! static int initialized = FALSE;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* global environment */
|
|
Karsten Hopp |
81c285 |
static Scheme_Env *environment = NULL;
|
|
Karsten Hopp |
81c285 |
/* output/error handlers */
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *curout = NULL;
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *curerr = NULL;
|
|
Karsten Hopp |
81c285 |
! /* exn:vim exception */
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *exn_catching_apply = NULL;
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *exn_p = NULL;
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *exn_message = NULL;
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *vim_exn = NULL; /* Vim Error exception */
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! #if !defined(MZ_PRECISE_GC) || MZSCHEME_VERSION_MAJOR < 400
|
|
Karsten Hopp |
81c285 |
! static void *stack_base = NULL;
|
|
Karsten Hopp |
81c285 |
! #endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
static long range_start;
|
|
Karsten Hopp |
81c285 |
static long range_end;
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 668,677 ****
|
|
Karsten Hopp |
81c285 |
timer_proc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
|
|
Karsten Hopp |
81c285 |
# elif defined(FEAT_GUI_GTK)
|
|
Karsten Hopp |
81c285 |
static gint
|
|
Karsten Hopp |
81c285 |
! timer_proc(gpointer data UNUSED)
|
|
Karsten Hopp |
81c285 |
# elif defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)
|
|
Karsten Hopp |
81c285 |
static void
|
|
Karsten Hopp |
81c285 |
! timer_proc(XtPointer timed_out UNUSED, XtIntervalId *interval_id UNUSED)
|
|
Karsten Hopp |
81c285 |
# elif defined(FEAT_GUI_MAC)
|
|
Karsten Hopp |
81c285 |
pascal void
|
|
Karsten Hopp |
81c285 |
timer_proc(EventLoopTimerRef theTimer, void *userData)
|
|
Karsten Hopp |
81c285 |
--- 716,725 ----
|
|
Karsten Hopp |
81c285 |
timer_proc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
|
|
Karsten Hopp |
81c285 |
# elif defined(FEAT_GUI_GTK)
|
|
Karsten Hopp |
81c285 |
static gint
|
|
Karsten Hopp |
81c285 |
! timer_proc(gpointer data)
|
|
Karsten Hopp |
81c285 |
# elif defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)
|
|
Karsten Hopp |
81c285 |
static void
|
|
Karsten Hopp |
81c285 |
! timer_proc(XtPointer timed_out, XtIntervalId *interval_id)
|
|
Karsten Hopp |
81c285 |
# elif defined(FEAT_GUI_MAC)
|
|
Karsten Hopp |
81c285 |
pascal void
|
|
Karsten Hopp |
81c285 |
timer_proc(EventLoopTimerRef theTimer, void *userData)
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 751,762 ****
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
static void
|
|
Karsten Hopp |
81c285 |
startup_mzscheme(void)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *proc_make_security_guard;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! scheme_set_stack_base(NULL, 1);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(environment);
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(curout);
|
|
Karsten Hopp |
81c285 |
--- 799,862 ----
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ void
|
|
Karsten Hopp |
81c285 |
+ mzscheme_main(void)
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ #if defined(MZ_PRECISE_GC) && MZSCHEME_VERSION_MAJOR >= 400
|
|
Karsten Hopp |
81c285 |
+ /* use trampoline for precise GC in MzScheme >= 4.x */
|
|
Karsten Hopp |
81c285 |
+ scheme_main_setup(TRUE, mzscheme_env_main, 0, NULL);
|
|
Karsten Hopp |
81c285 |
+ #else
|
|
Karsten Hopp |
81c285 |
+ mzscheme_env_main(NULL, 0, NULL);
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ static int
|
|
Karsten Hopp |
81c285 |
+ mzscheme_env_main(Scheme_Env *env, int argc, char **argv)
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ /* neither argument nor return values are used */
|
|
Karsten Hopp |
81c285 |
+ #ifdef MZ_PRECISE_GC
|
|
Karsten Hopp |
81c285 |
+ # if MZSCHEME_VERSION_MAJOR < 400
|
|
Karsten Hopp |
81c285 |
+ /*
|
|
Karsten Hopp |
81c285 |
+ * Starting from version 4.x, embedding applications must use
|
|
Karsten Hopp |
81c285 |
+ * scheme_main_setup/scheme_main_stack_setup trampolines
|
|
Karsten Hopp |
81c285 |
+ * rather than setting stack base directly with scheme_set_stack_base
|
|
Karsten Hopp |
81c285 |
+ */
|
|
Karsten Hopp |
81c285 |
+ Scheme_Object *dummy = NULL;
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_DECL_REG(1);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_VAR_IN_REG(0, dummy);
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ stack_base = &__gc_var_stack__;
|
|
Karsten Hopp |
81c285 |
+ # else
|
|
Karsten Hopp |
81c285 |
+ /* environment has been created by us by Scheme */
|
|
Karsten Hopp |
81c285 |
+ environment = env;
|
|
Karsten Hopp |
81c285 |
+ # endif
|
|
Karsten Hopp |
81c285 |
+ /*
|
|
Karsten Hopp |
81c285 |
+ * In 4.x, all activities must be performed inside trampoline
|
|
Karsten Hopp |
81c285 |
+ * so we are forced to initialise GC immediately
|
|
Karsten Hopp |
81c285 |
+ * This can be postponed in 3.x but I see no point in implementing
|
|
Karsten Hopp |
81c285 |
+ * a feature which will work in older versions only.
|
|
Karsten Hopp |
81c285 |
+ * One would better use conservative GC if he needs dynamic MzScheme
|
|
Karsten Hopp |
81c285 |
+ */
|
|
Karsten Hopp |
81c285 |
+ mzscheme_init();
|
|
Karsten Hopp |
81c285 |
+ #else
|
|
Karsten Hopp |
81c285 |
+ int dummy = 0;
|
|
Karsten Hopp |
81c285 |
+ stack_base = (void *)&dummy;
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
+ main_loop(FALSE, FALSE);
|
|
Karsten Hopp |
81c285 |
+ #if defined(MZ_PRECISE_GC) && MZSCHEME_VERSION_MAJOR < 400
|
|
Karsten Hopp |
81c285 |
+ /* releasing dummy */
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
+ return 0;
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
static void
|
|
Karsten Hopp |
81c285 |
startup_mzscheme(void)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! #if !defined(MZ_PRECISE_GC) || MZSCHEME_VERSION_MAJOR < 400
|
|
Karsten Hopp |
81c285 |
! scheme_set_stack_base(stack_base, 1);
|
|
Karsten Hopp |
81c285 |
! #endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(environment);
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(curout);
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 765,774 ****
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(exn_p);
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(exn_message);
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(vim_exn);
|
|
Karsten Hopp |
81c285 |
- MZ_REGISTER_STATIC(vim_exn_names);
|
|
Karsten Hopp |
81c285 |
- MZ_REGISTER_STATIC(vim_exn_values);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
environment = scheme_basic_env();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* redirect output */
|
|
Karsten Hopp |
81c285 |
scheme_console_output = do_output;
|
|
Karsten Hopp |
81c285 |
--- 865,899 ----
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(exn_p);
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(exn_message);
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(vim_exn);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ #if !defined(MZ_PRECISE_GC) || MZSCHEME_VERSION_MAJOR < 400
|
|
Karsten Hopp |
81c285 |
+ /* in newer versions of precise GC the initial env has been created */
|
|
Karsten Hopp |
81c285 |
environment = scheme_basic_env();
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ #ifdef INCLUDE_MZSCHEME_BASE
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ /*
|
|
Karsten Hopp |
81c285 |
+ * versions 4.x do not provide Scheme bindings by defaults
|
|
Karsten Hopp |
81c285 |
+ * we need to add them explicitly
|
|
Karsten Hopp |
81c285 |
+ */
|
|
Karsten Hopp |
81c285 |
+ Scheme_Object *scheme_base_symbol = NULL;
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_DECL_REG(1);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_VAR_IN_REG(0, scheme_base_symbol);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
+ /* invoke function from generated and included base.c */
|
|
Karsten Hopp |
81c285 |
+ declare_modules(environment);
|
|
Karsten Hopp |
81c285 |
+ scheme_base_symbol = scheme_intern_symbol("scheme/base");
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ scheme_namespace_require(scheme_base_symbol);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
+ register_vim_exn();
|
|
Karsten Hopp |
81c285 |
+ /* use new environment to initialise exception handling */
|
|
Karsten Hopp |
81c285 |
+ init_exn_catching_apply();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* redirect output */
|
|
Karsten Hopp |
81c285 |
scheme_console_output = do_output;
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 776,823 ****
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#ifdef MZSCHEME_COLLECTS
|
|
Karsten Hopp |
81c285 |
/* setup 'current-library-collection-paths' parameter */
|
|
Karsten Hopp |
81c285 |
- scheme_set_param(scheme_config, MZCONFIG_COLLECTION_PATHS,
|
|
Karsten Hopp |
81c285 |
- scheme_make_pair(
|
|
Karsten Hopp |
81c285 |
# if MZSCHEME_VERSION_MAJOR >= 299
|
|
Karsten Hopp |
81c285 |
! scheme_char_string_to_path(
|
|
Karsten Hopp |
81c285 |
! scheme_byte_string_to_char_string(
|
|
Karsten Hopp |
81c285 |
! scheme_make_byte_string(MZSCHEME_COLLECTS))),
|
|
Karsten Hopp |
81c285 |
# else
|
|
Karsten Hopp |
81c285 |
! scheme_make_string(MZSCHEME_COLLECTS),
|
|
Karsten Hopp |
81c285 |
# endif
|
|
Karsten Hopp |
81c285 |
- scheme_null));
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
#ifdef HAVE_SANDBOX
|
|
Karsten Hopp |
81c285 |
! /* setup sandbox guards */
|
|
Karsten Hopp |
81c285 |
! proc_make_security_guard = scheme_lookup_global(
|
|
Karsten Hopp |
81c285 |
! scheme_intern_symbol("make-security-guard"),
|
|
Karsten Hopp |
81c285 |
! environment);
|
|
Karsten Hopp |
81c285 |
! if (proc_make_security_guard != NULL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *args[3];
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *guard;
|
|
Karsten Hopp |
81c285 |
! args[0] = scheme_get_param(scheme_config, MZCONFIG_SECURITY_GUARD);
|
|
Karsten Hopp |
81c285 |
! args[1] = scheme_make_prim_w_arity(sandbox_file_guard,
|
|
Karsten Hopp |
81c285 |
! "sandbox-file-guard", 3, 3);
|
|
Karsten Hopp |
81c285 |
! args[2] = scheme_make_prim_w_arity(sandbox_network_guard,
|
|
Karsten Hopp |
81c285 |
! "sandbox-network-guard", 4, 4);
|
|
Karsten Hopp |
81c285 |
! guard = scheme_apply(proc_make_security_guard, 3, args);
|
|
Karsten Hopp |
81c285 |
! scheme_set_param(scheme_config, MZCONFIG_SECURITY_GUARD, guard);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
/* Create buffer and window types for use in Scheme code */
|
|
Karsten Hopp |
81c285 |
mz_buffer_type = scheme_make_type("<vim-buffer>");
|
|
Karsten Hopp |
81c285 |
mz_window_type = scheme_make_type("<vim-window>");
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! register_vim_exn(environment);
|
|
Karsten Hopp |
81c285 |
! make_modules(environment);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* setup callback to receive notifications
|
|
Karsten Hopp |
81c285 |
* whether thread scheduling is (or not) required
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
scheme_notify_multithread = notify_multithread;
|
|
Karsten Hopp |
81c285 |
- initialized = 1;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
--- 901,1031 ----
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#ifdef MZSCHEME_COLLECTS
|
|
Karsten Hopp |
81c285 |
/* setup 'current-library-collection-paths' parameter */
|
|
Karsten Hopp |
81c285 |
# if MZSCHEME_VERSION_MAJOR >= 299
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *coll_byte_string = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *coll_char_string = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *coll_path = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *coll_pair = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Config *config = NULL;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(5);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, coll_byte_string);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(1, coll_char_string);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(2, coll_path);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(3, coll_pair);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(4, config);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
! coll_byte_string = scheme_make_byte_string(MZSCHEME_COLLECTS);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! coll_char_string = scheme_byte_string_to_char_string(coll_byte_string);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! coll_path = scheme_char_string_to_path(coll_char_string);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! coll_pair = scheme_make_pair(coll_path, scheme_null);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! config = scheme_config;
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! scheme_set_param(config, MZCONFIG_COLLECTION_PATHS, coll_pair);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
# else
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *coll_string = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *coll_pair = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Config *config = NULL;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(3);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, coll_string);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(1, coll_pair);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(2, config);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
! coll_string = scheme_make_string(MZSCHEME_COLLECTS);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! coll_pair = scheme_make_pair(coll_string, scheme_null);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! config = scheme_config;
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! scheme_set_param(config, MZCONFIG_COLLECTION_PATHS, coll_pair);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
# endif
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
#ifdef HAVE_SANDBOX
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *make_security_guard = NULL;
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(1);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, make_security_guard);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! #if MZSCHEME_VERSION_MAJOR < 400
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *make_security_guard_symbol = NULL;
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(1);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, make_security_guard_symbol);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
! make_security_guard_symbol = scheme_intern_symbol("make-security-guard");
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! make_security_guard = scheme_lookup_global(
|
|
Karsten Hopp |
81c285 |
! make_security_guard_symbol, environment);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! #else
|
|
Karsten Hopp |
81c285 |
! make_security_guard = scheme_builtin_value("make-security-guard");
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! #endif
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! /* setup sandbox guards */
|
|
Karsten Hopp |
81c285 |
! if (make_security_guard != NULL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *args[3] = {NULL, NULL, NULL};
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *guard = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Config *config = NULL;
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(5);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_ARRAY_VAR_IN_REG(0, args, 3);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(3, guard);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(4, config);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
! config = scheme_config;
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! args[0] = scheme_get_param(config, MZCONFIG_SECURITY_GUARD);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! args[1] = scheme_make_prim_w_arity(sandbox_file_guard,
|
|
Karsten Hopp |
81c285 |
! "sandbox-file-guard", 3, 3);
|
|
Karsten Hopp |
81c285 |
! args[2] = scheme_make_prim_w_arity(sandbox_network_guard,
|
|
Karsten Hopp |
81c285 |
! "sandbox-network-guard", 4, 4);
|
|
Karsten Hopp |
81c285 |
! guard = scheme_apply(make_security_guard, 3, args);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! scheme_set_param(config, MZCONFIG_SECURITY_GUARD, guard);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
/* Create buffer and window types for use in Scheme code */
|
|
Karsten Hopp |
81c285 |
mz_buffer_type = scheme_make_type("<vim-buffer>");
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
mz_window_type = scheme_make_type("<vim-window>");
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ #ifdef MZ_PRECISE_GC
|
|
Karsten Hopp |
81c285 |
+ GC_register_traversers(mz_buffer_type,
|
|
Karsten Hopp |
81c285 |
+ buffer_size_proc, buffer_mark_proc, buffer_fixup_proc,
|
|
Karsten Hopp |
81c285 |
+ TRUE, TRUE);
|
|
Karsten Hopp |
81c285 |
+ GC_register_traversers(mz_window_type,
|
|
Karsten Hopp |
81c285 |
+ window_size_proc, window_mark_proc, window_fixup_proc,
|
|
Karsten Hopp |
81c285 |
+ TRUE, TRUE);
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! make_modules();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* setup callback to receive notifications
|
|
Karsten Hopp |
81c285 |
* whether thread scheduling is (or not) required
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
scheme_notify_multithread = notify_multithread;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 827,897 ****
|
|
Karsten Hopp |
81c285 |
static int
|
|
Karsten Hopp |
81c285 |
mzscheme_init(void)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
- int do_require = FALSE;
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
if (!initialized)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
- do_require = TRUE;
|
|
Karsten Hopp |
81c285 |
#ifdef DYNAMIC_MZSCHEME
|
|
Karsten Hopp |
81c285 |
if (!mzscheme_enabled(TRUE))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! EMSG(_("???: Sorry, this command is disabled, the MzScheme library could not be loaded."));
|
|
Karsten Hopp |
81c285 |
return -1;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
startup_mzscheme();
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! if (mzscheme_io_init())
|
|
Karsten Hopp |
81c285 |
! return -1;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! /* recreate ports each call effectivelly clearing these ones */
|
|
Karsten Hopp |
81c285 |
! curout = scheme_make_string_output_port();
|
|
Karsten Hopp |
81c285 |
! curerr = scheme_make_string_output_port();
|
|
Karsten Hopp |
81c285 |
! scheme_set_param(scheme_config, MZCONFIG_OUTPUT_PORT, curout);
|
|
Karsten Hopp |
81c285 |
! scheme_set_param(scheme_config, MZCONFIG_ERROR_PORT, curerr);
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! if (do_require)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! /* auto-instantiate in basic env */
|
|
Karsten Hopp |
81c285 |
! eval_in_namespace("(require (prefix vimext: vimext))", do_eval,
|
|
Karsten Hopp |
81c285 |
! environment, NULL);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
- return 0;
|
|
Karsten Hopp |
81c285 |
- }
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
- /*
|
|
Karsten Hopp |
81c285 |
- * This routine fills the namespace with various important routines that can
|
|
Karsten Hopp |
81c285 |
- * be used within MzScheme.
|
|
Karsten Hopp |
81c285 |
- */
|
|
Karsten Hopp |
81c285 |
- static void
|
|
Karsten Hopp |
81c285 |
- mzscheme_interface_init(vim_mz_buffer *mzbuff)
|
|
Karsten Hopp |
81c285 |
- {
|
|
Karsten Hopp |
81c285 |
- Scheme_Object *attach;
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
- mzbuff->env = (Scheme_Env *)scheme_make_namespace(0, NULL);
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
- /*
|
|
Karsten Hopp |
81c285 |
- * attach instantiated modules from global namespace
|
|
Karsten Hopp |
81c285 |
- * so they can be easily instantiated in the buffer namespace
|
|
Karsten Hopp |
81c285 |
- */
|
|
Karsten Hopp |
81c285 |
- attach = scheme_lookup_global(
|
|
Karsten Hopp |
81c285 |
- scheme_intern_symbol("namespace-attach-module"),
|
|
Karsten Hopp |
81c285 |
- environment);
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
- if (attach != NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *ret;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *args[2];
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! args[0] = (Scheme_Object *)environment;
|
|
Karsten Hopp |
81c285 |
! args[1] = scheme_intern_symbol("vimext");
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! ret = (Scheme_Object *)mzvim_apply(attach, 2, args);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! add_vim_exn(mzbuff->env);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
--- 1035,1072 ----
|
|
Karsten Hopp |
81c285 |
static int
|
|
Karsten Hopp |
81c285 |
mzscheme_init(void)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
if (!initialized)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
#ifdef DYNAMIC_MZSCHEME
|
|
Karsten Hopp |
81c285 |
if (!mzscheme_enabled(TRUE))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! EMSG(_("E812: Sorry, this command is disabled, the MzScheme libraries could not be loaded."));
|
|
Karsten Hopp |
81c285 |
return -1;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
startup_mzscheme();
|
|
Karsten Hopp |
81c285 |
! initialized = TRUE;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Scheme_Config *config = NULL;
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(1);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, config);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
! config = scheme_config;
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! /* recreate ports each call effectivelly clearing these ones */
|
|
Karsten Hopp |
81c285 |
! curout = scheme_make_string_output_port();
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! curerr = scheme_make_string_output_port();
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! scheme_set_param(config, MZCONFIG_OUTPUT_PORT, curout);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! scheme_set_param(config, MZCONFIG_ERROR_PORT, curerr);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! return 0;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 901,928 ****
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
! * Evaluate command in namespace with exception handling
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
static int
|
|
Karsten Hopp |
81c285 |
! eval_in_namespace(void *data, Scheme_Closed_Prim *what, Scheme_Env *env,
|
|
Karsten Hopp |
81c285 |
! Scheme_Object **ret)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *value;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *exn;
|
|
Karsten Hopp |
81c285 |
! Cmd_Info info; /* closure info */
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! info.data = data;
|
|
Karsten Hopp |
81c285 |
! info.env = env;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! scheme_set_param(scheme_config, MZCONFIG_ENV,
|
|
Karsten Hopp |
81c285 |
! (Scheme_Object *) env);
|
|
Karsten Hopp |
81c285 |
! /*
|
|
Karsten Hopp |
81c285 |
! * ensure all evaluations will be in current buffer namespace,
|
|
Karsten Hopp |
81c285 |
! * the second argument to scheme_eval_string isn't enough!
|
|
Karsten Hopp |
81c285 |
! */
|
|
Karsten Hopp |
81c285 |
! value = _apply_thunk_catch_exceptions(
|
|
Karsten Hopp |
81c285 |
! scheme_make_closed_prim_w_arity(what, &info, "mzvim", 0, 0),
|
|
Karsten Hopp |
81c285 |
! &exn;;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (!value)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
--- 1076,1100 ----
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
! * Evaluate command with exception handling
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
static int
|
|
Karsten Hopp |
81c285 |
! eval_with_exn_handling(void *data, Scheme_Closed_Prim *what, Scheme_Object **ret)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *value = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *exn = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *prim = NULL;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(3);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, value);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(1, exn);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(2, prim);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! prim = scheme_make_closed_prim_w_arity(what, data, "mzvim", 0, 0);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! value = _apply_thunk_catch_exceptions(prim, &exn;;
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (!value)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 930,938 ****
|
|
Karsten Hopp |
81c285 |
/* Got an exn? */
|
|
Karsten Hopp |
81c285 |
if (value)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! scheme_display(value, curerr); /* Send to stderr-vim */
|
|
Karsten Hopp |
81c285 |
do_flush();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
/* `raise' was called on some arbitrary value */
|
|
Karsten Hopp |
81c285 |
return FAIL;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
--- 1102,1112 ----
|
|
Karsten Hopp |
81c285 |
/* Got an exn? */
|
|
Karsten Hopp |
81c285 |
if (value)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! scheme_display(value, curerr); /* Send to stderr-vim */
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
do_flush();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
/* `raise' was called on some arbitrary value */
|
|
Karsten Hopp |
81c285 |
return FAIL;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 941,949 ****
|
|
Karsten Hopp |
81c285 |
--- 1115,1127 ----
|
|
Karsten Hopp |
81c285 |
*ret = value;
|
|
Karsten Hopp |
81c285 |
/* Print any result, as long as it's not a void */
|
|
Karsten Hopp |
81c285 |
else if (!SCHEME_VOIDP(value))
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
scheme_display(value, curout); /* Send to stdout-vim */
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
do_flush();
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
return OK;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 957,963 ****
|
|
Karsten Hopp |
81c285 |
range_start = eap->line1;
|
|
Karsten Hopp |
81c285 |
range_end = eap->line2;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! return eval_in_namespace(data, what, get_vim_curr_buffer()->env, NULL);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
--- 1135,1141 ----
|
|
Karsten Hopp |
81c285 |
range_start = eap->line1;
|
|
Karsten Hopp |
81c285 |
range_end = eap->line2;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! return eval_with_exn_handling(data, what, NULL);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 974,979 ****
|
|
Karsten Hopp |
81c285 |
--- 1152,1158 ----
|
|
Karsten Hopp |
81c285 |
bp->buf = INVALID_BUFFER_VALUE;
|
|
Karsten Hopp |
81c285 |
buf->b_mzscheme_ref = NULL;
|
|
Karsten Hopp |
81c285 |
scheme_gc_ptr_ok(bp);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 990,995 ****
|
|
Karsten Hopp |
81c285 |
--- 1169,1175 ----
|
|
Karsten Hopp |
81c285 |
wp->win = INVALID_WINDOW_VALUE;
|
|
Karsten Hopp |
81c285 |
win->w_mzscheme_ref = NULL;
|
|
Karsten Hopp |
81c285 |
scheme_gc_ptr_ok(wp);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1014,1031 ****
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
- /* eval MzScheme string */
|
|
Karsten Hopp |
81c285 |
- void *
|
|
Karsten Hopp |
81c285 |
- mzvim_eval_string(char_u *str)
|
|
Karsten Hopp |
81c285 |
- {
|
|
Karsten Hopp |
81c285 |
- Scheme_Object *ret = NULL;
|
|
Karsten Hopp |
81c285 |
- if (mzscheme_init())
|
|
Karsten Hopp |
81c285 |
- return FAIL;
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
- eval_in_namespace(str, do_eval, get_vim_curr_buffer()->env, &ret;;
|
|
Karsten Hopp |
81c285 |
- return ret;
|
|
Karsten Hopp |
81c285 |
- }
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* apply MzScheme procedure with arguments,
|
|
Karsten Hopp |
81c285 |
* handling errors
|
|
Karsten Hopp |
81c285 |
--- 1194,1199 ----
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1033,1075 ****
|
|
Karsten Hopp |
81c285 |
Scheme_Object *
|
|
Karsten Hopp |
81c285 |
mzvim_apply(Scheme_Object *proc, int argc, Scheme_Object **argv)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
- Apply_Info data;
|
|
Karsten Hopp |
81c285 |
- Scheme_Object *ret = NULL;
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
if (mzscheme_init())
|
|
Karsten Hopp |
81c285 |
return FAIL;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! data.proc = proc;
|
|
Karsten Hopp |
81c285 |
! data.argc = argc;
|
|
Karsten Hopp |
81c285 |
! data.argv = argv;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! eval_in_namespace(&data, do_apply, get_vim_curr_buffer()->env, &ret;;
|
|
Karsten Hopp |
81c285 |
! return ret;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *
|
|
Karsten Hopp |
81c285 |
do_load(void *data, int noargc, Scheme_Object **noargv)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Cmd_Info *info = (Cmd_Info *)data;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *result = scheme_void;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *expr;
|
|
Karsten Hopp |
81c285 |
! char_u *file = scheme_malloc_fail_ok(
|
|
Karsten Hopp |
81c285 |
! scheme_malloc_atomic, MAXPATHL + 1);
|
|
Karsten Hopp |
81c285 |
! Port_Info *pinfo = (Port_Info *)(info->data);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* make Vim expansion */
|
|
Karsten Hopp |
81c285 |
! expand_env((char_u *)pinfo->name, file, MAXPATHL);
|
|
Karsten Hopp |
81c285 |
! /* scheme_load looks strange working with namespaces and error handling*/
|
|
Karsten Hopp |
81c285 |
pinfo->port = scheme_open_input_file(file, "mzfile");
|
|
Karsten Hopp |
81c285 |
! scheme_count_lines(pinfo->port); /* to get accurate read error location*/
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* Like REPL but print only last result */
|
|
Karsten Hopp |
81c285 |
while (!SCHEME_EOFP(expr = scheme_read(pinfo->port)))
|
|
Karsten Hopp |
81c285 |
! result = scheme_eval(expr, info->env);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* errors will be caught in do_mzscheme_comamnd and ex_mzfile */
|
|
Karsten Hopp |
81c285 |
scheme_close_input_port(pinfo->port);
|
|
Karsten Hopp |
81c285 |
pinfo->port = NULL;
|
|
Karsten Hopp |
81c285 |
return result;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 1201,1265 ----
|
|
Karsten Hopp |
81c285 |
Scheme_Object *
|
|
Karsten Hopp |
81c285 |
mzvim_apply(Scheme_Object *proc, int argc, Scheme_Object **argv)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
if (mzscheme_init())
|
|
Karsten Hopp |
81c285 |
return FAIL;
|
|
Karsten Hopp |
81c285 |
+ else
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ Apply_Info data = {NULL, 0, NULL};
|
|
Karsten Hopp |
81c285 |
+ Scheme_Object *ret = NULL;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(5);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, ret);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(1, data.proc);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_ARRAY_VAR_IN_REG(2, data.argv, argc);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! data.proc = proc;
|
|
Karsten Hopp |
81c285 |
! data.argc = argc;
|
|
Karsten Hopp |
81c285 |
! data.argv = argv;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! eval_with_exn_handling(&data, do_apply, &ret;;
|
|
Karsten Hopp |
81c285 |
! MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
! return ret;
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *
|
|
Karsten Hopp |
81c285 |
do_load(void *data, int noargc, Scheme_Object **noargv)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *expr = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *result = NULL;
|
|
Karsten Hopp |
81c285 |
! char *file = NULL;
|
|
Karsten Hopp |
81c285 |
! Port_Info *pinfo = (Port_Info *)data;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(3);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, expr);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(1, result);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(2, file);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! file = (char *)scheme_malloc_fail_ok(scheme_malloc_atomic, MAXPATHL + 1);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* make Vim expansion */
|
|
Karsten Hopp |
81c285 |
! expand_env((char_u *)pinfo->name, (char_u *)file, MAXPATHL);
|
|
Karsten Hopp |
81c285 |
pinfo->port = scheme_open_input_file(file, "mzfile");
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! scheme_count_lines(pinfo->port); /* to get accurate read error location*/
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* Like REPL but print only last result */
|
|
Karsten Hopp |
81c285 |
while (!SCHEME_EOFP(expr = scheme_read(pinfo->port)))
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! result = scheme_eval(expr, environment);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* errors will be caught in do_mzscheme_comamnd and ex_mzfile */
|
|
Karsten Hopp |
81c285 |
scheme_close_input_port(pinfo->port);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
pinfo->port = NULL;
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
return result;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1077,1089 ****
|
|
Karsten Hopp |
81c285 |
void
|
|
Karsten Hopp |
81c285 |
ex_mzfile(exarg_T *eap)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Port_Info pinfo;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
pinfo.name = (char *)eap->arg;
|
|
Karsten Hopp |
81c285 |
- pinfo.port = NULL;
|
|
Karsten Hopp |
81c285 |
if (do_mzscheme_command(eap, &pinfo, do_load) != OK
|
|
Karsten Hopp |
81c285 |
&& pinfo.port != NULL) /* looks like port was not closed */
|
|
Karsten Hopp |
81c285 |
scheme_close_input_port(pinfo.port);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 1267,1286 ----
|
|
Karsten Hopp |
81c285 |
void
|
|
Karsten Hopp |
81c285 |
ex_mzfile(exarg_T *eap)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Port_Info pinfo = {NULL, NULL};
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(1);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, pinfo.port);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
pinfo.name = (char *)eap->arg;
|
|
Karsten Hopp |
81c285 |
if (do_mzscheme_command(eap, &pinfo, do_load) != OK
|
|
Karsten Hopp |
81c285 |
&& pinfo.port != NULL) /* looks like port was not closed */
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
scheme_close_input_port(pinfo.port);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1103,1116 ****
|
|
Karsten Hopp |
81c285 |
"(with-handlers ([void (lambda (exn) (cons #f exn))]) "
|
|
Karsten Hopp |
81c285 |
"(cons #t (thunk))))";
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /* make sure we have a namespace with the standard syntax: */
|
|
Karsten Hopp |
81c285 |
! Scheme_Env *env = (Scheme_Env *)scheme_make_namespace(0, NULL);
|
|
Karsten Hopp |
81c285 |
! add_vim_exn(env);
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! exn_catching_apply = scheme_eval_string(e, env);
|
|
Karsten Hopp |
81c285 |
! exn_p = scheme_lookup_global(scheme_intern_symbol("exn?"), env);
|
|
Karsten Hopp |
81c285 |
! exn_message = scheme_lookup_global(
|
|
Karsten Hopp |
81c285 |
! scheme_intern_symbol("exn-message"), env);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 1300,1311 ----
|
|
Karsten Hopp |
81c285 |
"(with-handlers ([void (lambda (exn) (cons #f exn))]) "
|
|
Karsten Hopp |
81c285 |
"(cons #t (thunk))))";
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! exn_catching_apply = scheme_eval_string(e, environment);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! exn_p = scheme_builtin_value("exn?");
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! exn_message = scheme_builtin_value("exn-message");
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1124,1131 ****
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
Scheme_Object *v;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
- init_exn_catching_apply();
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
v = _scheme_apply(exn_catching_apply, 1, &f);
|
|
Karsten Hopp |
81c285 |
/* v is a pair: (cons #t value) or (cons #f exn) */
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 1319,1324 ----
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1141,1148 ****
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *
|
|
Karsten Hopp |
81c285 |
extract_exn_message(Scheme_Object *v)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
- init_exn_catching_apply();
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
if (SCHEME_TRUEP(_scheme_apply(exn_p, 1, &v)))
|
|
Karsten Hopp |
81c285 |
return _scheme_apply(exn_message, 1, &v);
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
--- 1334,1339 ----
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1152,1167 ****
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *
|
|
Karsten Hopp |
81c285 |
do_eval(void *s, int noargc, Scheme_Object **noargv)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Cmd_Info *info = (Cmd_Info *)s;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! return scheme_eval_string_all((char *)(info->data), info->env, TRUE);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *
|
|
Karsten Hopp |
81c285 |
do_apply(void *a, int noargc, Scheme_Object **noargv)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Apply_Info *info = (Apply_Info *)(((Cmd_Info *)a)->data);
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
return scheme_apply(info->proc, info->argc, info->argv);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 1343,1355 ----
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *
|
|
Karsten Hopp |
81c285 |
do_eval(void *s, int noargc, Scheme_Object **noargv)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! return scheme_eval_string_all((char *)s, environment, TRUE);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *
|
|
Karsten Hopp |
81c285 |
do_apply(void *a, int noargc, Scheme_Object **noargv)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Apply_Info *info = (Apply_Info *)a;
|
|
Karsten Hopp |
81c285 |
return scheme_apply(info->proc, info->argc, info->argv);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1219,1224 ****
|
|
Karsten Hopp |
81c285 |
--- 1407,1413 ----
|
|
Karsten Hopp |
81c285 |
long length;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
buff = scheme_get_sized_string_output(curerr, &length);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
if (length)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
do_err_output(buff, length);
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1226,1242 ****
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
buff = scheme_get_sized_string_output(curout, &length);
|
|
Karsten Hopp |
81c285 |
if (length)
|
|
Karsten Hopp |
81c285 |
do_output(buff, length);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
- static int
|
|
Karsten Hopp |
81c285 |
- mzscheme_io_init(void)
|
|
Karsten Hopp |
81c285 |
- {
|
|
Karsten Hopp |
81c285 |
- /* Nothing needed so far... */
|
|
Karsten Hopp |
81c285 |
- return 0;
|
|
Karsten Hopp |
81c285 |
- }
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
*========================================================================
|
|
Karsten Hopp |
81c285 |
* 4. Implementation of the Vim Features for MzScheme
|
|
Karsten Hopp |
81c285 |
--- 1415,1425 ----
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
buff = scheme_get_sized_string_output(curout, &length);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
if (length)
|
|
Karsten Hopp |
81c285 |
do_output(buff, length);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
*========================================================================
|
|
Karsten Hopp |
81c285 |
* 4. Implementation of the Vim Features for MzScheme
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1263,1284 ****
|
|
Karsten Hopp |
81c285 |
vim_eval(void *data, int argc, Scheme_Object **argv)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
#ifdef FEAT_EVAL
|
|
Karsten Hopp |
81c285 |
! Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
! char *expr;
|
|
Karsten Hopp |
81c285 |
! char *str;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *result;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! expr = SCHEME_STR_VAL(GUARANTEE_STRING(prim->name, 0));
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! str = (char *)eval_to_string((char_u *)expr, NULL, TRUE);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! if (str == NULL)
|
|
Karsten Hopp |
81c285 |
raise_vim_exn(_("invalid expression"));
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! result = scheme_make_string(str);
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! vim_free(str);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
return result;
|
|
Karsten Hopp |
81c285 |
#else
|
|
Karsten Hopp |
81c285 |
raise_vim_exn(_("expressions disabled at compile time"));
|
|
Karsten Hopp |
81c285 |
--- 1446,1475 ----
|
|
Karsten Hopp |
81c285 |
vim_eval(void *data, int argc, Scheme_Object **argv)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
#ifdef FEAT_EVAL
|
|
Karsten Hopp |
81c285 |
! Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
! char *expr;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *result;
|
|
Karsten Hopp |
81c285 |
! /* hash table to store visited values to avoid infinite loops */
|
|
Karsten Hopp |
81c285 |
! Scheme_Hash_Table *visited = NULL;
|
|
Karsten Hopp |
81c285 |
! typval_T *vim_result;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(1);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, visited);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! visited = scheme_make_hash_table(SCHEME_hash_ptr);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! expr = SCHEME_STR_VAL(GUARANTEE_STRING(prim->name, 0));
|
|
Karsten Hopp |
81c285 |
! vim_result = eval_expr((char_u *)expr, NULL);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! if (vim_result == NULL)
|
|
Karsten Hopp |
81c285 |
raise_vim_exn(_("invalid expression"));
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! result = vim_to_mzscheme(vim_result, 1, visited);
|
|
Karsten Hopp |
81c285 |
! free_tv(vim_result);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
return result;
|
|
Karsten Hopp |
81c285 |
#else
|
|
Karsten Hopp |
81c285 |
raise_vim_exn(_("expressions disabled at compile time"));
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1318,1324 ****
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
char_u *name;
|
|
Karsten Hopp |
81c285 |
long value;
|
|
Karsten Hopp |
81c285 |
! char_u *strval;
|
|
Karsten Hopp |
81c285 |
int rc;
|
|
Karsten Hopp |
81c285 |
Scheme_Object *rval;
|
|
Karsten Hopp |
81c285 |
int opt_flags = 0;
|
|
Karsten Hopp |
81c285 |
--- 1509,1515 ----
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
char_u *name;
|
|
Karsten Hopp |
81c285 |
long value;
|
|
Karsten Hopp |
81c285 |
! char *strval;
|
|
Karsten Hopp |
81c285 |
int rc;
|
|
Karsten Hopp |
81c285 |
Scheme_Object *rval;
|
|
Karsten Hopp |
81c285 |
int opt_flags = 0;
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1333,1338 ****
|
|
Karsten Hopp |
81c285 |
--- 1524,1530 ----
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(M_global);
|
|
Karsten Hopp |
81c285 |
M_global = scheme_intern_symbol("global");
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (argv[1] == M_global)
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1354,1360 ****
|
|
Karsten Hopp |
81c285 |
scheme_wrong_type(prim->name, "vim-buffer/window", 1, argc, argv);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! rc = get_option_value(name, &value, &strval, opt_flags);
|
|
Karsten Hopp |
81c285 |
curbuf = save_curb;
|
|
Karsten Hopp |
81c285 |
curwin = save_curw;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 1546,1552 ----
|
|
Karsten Hopp |
81c285 |
scheme_wrong_type(prim->name, "vim-buffer/window", 1, argc, argv);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! rc = get_option_value(name, &value, (char_u **)&strval, opt_flags);
|
|
Karsten Hopp |
81c285 |
curbuf = save_curb;
|
|
Karsten Hopp |
81c285 |
curwin = save_curw;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1364,1369 ****
|
|
Karsten Hopp |
81c285 |
--- 1556,1562 ----
|
|
Karsten Hopp |
81c285 |
return scheme_make_integer_value(value);
|
|
Karsten Hopp |
81c285 |
case 0:
|
|
Karsten Hopp |
81c285 |
rval = scheme_make_string(strval);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
vim_free(strval);
|
|
Karsten Hopp |
81c285 |
return rval;
|
|
Karsten Hopp |
81c285 |
case -1:
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1393,1398 ****
|
|
Karsten Hopp |
81c285 |
--- 1586,1592 ----
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(M_global);
|
|
Karsten Hopp |
81c285 |
M_global = scheme_intern_symbol("global");
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (argv[1] == M_global)
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1463,1469 ****
|
|
Karsten Hopp |
81c285 |
--- 1657,1666 ----
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
for (w = firstwin; w != NULL; w = w->w_next)
|
|
Karsten Hopp |
81c285 |
if (w->w_buffer == buf->buf)
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
list = scheme_make_pair(window_new(w), list);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
return list;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1471,1477 ****
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *
|
|
Karsten Hopp |
81c285 |
window_new(win_T *win)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! vim_mz_window *self;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* We need to handle deletion of windows underneath us.
|
|
Karsten Hopp |
81c285 |
* If we add a "w_mzscheme_ref" field to the win_T structure,
|
|
Karsten Hopp |
81c285 |
--- 1668,1678 ----
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *
|
|
Karsten Hopp |
81c285 |
window_new(win_T *win)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! vim_mz_window *self = NULL;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(1);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, self);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* We need to handle deletion of windows underneath us.
|
|
Karsten Hopp |
81c285 |
* If we add a "w_mzscheme_ref" field to the win_T structure,
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1485,1497 ****
|
|
Karsten Hopp |
81c285 |
return win->w_mzscheme_ref;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
self = scheme_malloc_fail_ok(scheme_malloc, sizeof(vim_mz_window));
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
vim_memset(self, 0, sizeof(vim_mz_window));
|
|
Karsten Hopp |
81c285 |
scheme_dont_gc_ptr(self); /* because win isn't visible to GC */
|
|
Karsten Hopp |
81c285 |
win->w_mzscheme_ref = self;
|
|
Karsten Hopp |
81c285 |
self->win = win;
|
|
Karsten Hopp |
81c285 |
! self->tag = mz_window_type;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
return (Scheme_Object *)(self);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 1686,1699 ----
|
|
Karsten Hopp |
81c285 |
return win->w_mzscheme_ref;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
self = scheme_malloc_fail_ok(scheme_malloc, sizeof(vim_mz_window));
|
|
Karsten Hopp |
81c285 |
vim_memset(self, 0, sizeof(vim_mz_window));
|
|
Karsten Hopp |
81c285 |
scheme_dont_gc_ptr(self); /* because win isn't visible to GC */
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
win->w_mzscheme_ref = self;
|
|
Karsten Hopp |
81c285 |
self->win = win;
|
|
Karsten Hopp |
81c285 |
! self->so.type = mz_window_type;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
return (Scheme_Object *)(self);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1660,1666 ****
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
*===========================================================================
|
|
Karsten Hopp |
81c285 |
* 6. Vim Buffer-related Manipulation Functions
|
|
Karsten Hopp |
81c285 |
- * Note that each buffer should have its own private namespace.
|
|
Karsten Hopp |
81c285 |
*===========================================================================
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 1862,1867 ----
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1669,1682 ****
|
|
Karsten Hopp |
81c285 |
mzscheme_open_buffer(void *data, int argc, Scheme_Object **argv)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
! char *fname;
|
|
Karsten Hopp |
81c285 |
int num = 0;
|
|
Karsten Hopp |
81c285 |
Scheme_Object *onum;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#ifdef HAVE_SANDBOX
|
|
Karsten Hopp |
81c285 |
sandbox_check();
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
! fname = SCHEME_STR_VAL(GUARANTEE_STRING(prim->name, 0));
|
|
Karsten Hopp |
81c285 |
/* TODO make open existing file */
|
|
Karsten Hopp |
81c285 |
num = buflist_add(fname, BLN_LISTED | BLN_CURBUF);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 1870,1883 ----
|
|
Karsten Hopp |
81c285 |
mzscheme_open_buffer(void *data, int argc, Scheme_Object **argv)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
! char_u *fname;
|
|
Karsten Hopp |
81c285 |
int num = 0;
|
|
Karsten Hopp |
81c285 |
Scheme_Object *onum;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#ifdef HAVE_SANDBOX
|
|
Karsten Hopp |
81c285 |
sandbox_check();
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
! fname = (char_u *)SCHEME_STR_VAL(GUARANTEE_STRING(prim->name, 0));
|
|
Karsten Hopp |
81c285 |
/* TODO make open existing file */
|
|
Karsten Hopp |
81c285 |
num = buflist_add(fname, BLN_LISTED | BLN_CURBUF);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1712,1718 ****
|
|
Karsten Hopp |
81c285 |
buf_T *buf;
|
|
Karsten Hopp |
81c285 |
char_u *fname;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! fname = SCHEME_STR_VAL(GUARANTEE_STRING(prim->name, 0));
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
for (buf = firstbuf; buf; buf = buf->b_next)
|
|
Karsten Hopp |
81c285 |
if (buf->b_ffname == NULL || buf->b_sfname == NULL)
|
|
Karsten Hopp |
81c285 |
--- 1913,1919 ----
|
|
Karsten Hopp |
81c285 |
buf_T *buf;
|
|
Karsten Hopp |
81c285 |
char_u *fname;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! fname = (char_u *)SCHEME_STR_VAL(GUARANTEE_STRING(prim->name, 0));
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
for (buf = firstbuf; buf; buf = buf->b_next)
|
|
Karsten Hopp |
81c285 |
if (buf->b_ffname == NULL || buf->b_sfname == NULL)
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1783,1789 ****
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
vim_mz_buffer *buf = get_buffer_arg(prim->name, 0, argc, argv);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! return scheme_make_string(buf->buf->b_ffname);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* (curr-buff) */
|
|
Karsten Hopp |
81c285 |
--- 1984,1990 ----
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
vim_mz_buffer *buf = get_buffer_arg(prim->name, 0, argc, argv);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! return scheme_make_string((char *)buf->buf->b_ffname);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* (curr-buff) */
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1796,1802 ****
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *
|
|
Karsten Hopp |
81c285 |
buffer_new(buf_T *buf)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! vim_mz_buffer *self;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* We need to handle deletion of buffers underneath us.
|
|
Karsten Hopp |
81c285 |
* If we add a "b_mzscheme_ref" field to the buf_T structure,
|
|
Karsten Hopp |
81c285 |
--- 1997,2007 ----
|
|
Karsten Hopp |
81c285 |
static Scheme_Object *
|
|
Karsten Hopp |
81c285 |
buffer_new(buf_T *buf)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! vim_mz_buffer *self = NULL;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(1);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, self);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* We need to handle deletion of buffers underneath us.
|
|
Karsten Hopp |
81c285 |
* If we add a "b_mzscheme_ref" field to the buf_T structure,
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1806,1820 ****
|
|
Karsten Hopp |
81c285 |
return buf->b_mzscheme_ref;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
self = scheme_malloc_fail_ok(scheme_malloc, sizeof(vim_mz_buffer));
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
vim_memset(self, 0, sizeof(vim_mz_buffer));
|
|
Karsten Hopp |
81c285 |
! scheme_dont_gc_ptr(self); /* because buf isn't visible to GC */
|
|
Karsten Hopp |
81c285 |
buf->b_mzscheme_ref = self;
|
|
Karsten Hopp |
81c285 |
self->buf = buf;
|
|
Karsten Hopp |
81c285 |
! self->tag = mz_buffer_type;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! mzscheme_interface_init(self); /* Set up namespace */
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
return (Scheme_Object *)(self);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 2011,2024 ----
|
|
Karsten Hopp |
81c285 |
return buf->b_mzscheme_ref;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
self = scheme_malloc_fail_ok(scheme_malloc, sizeof(vim_mz_buffer));
|
|
Karsten Hopp |
81c285 |
vim_memset(self, 0, sizeof(vim_mz_buffer));
|
|
Karsten Hopp |
81c285 |
! scheme_dont_gc_ptr(self); /* because buf isn't visible to GC */
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
buf->b_mzscheme_ref = self;
|
|
Karsten Hopp |
81c285 |
self->buf = buf;
|
|
Karsten Hopp |
81c285 |
! self->so.type = mz_buffer_type;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
return (Scheme_Object *)(self);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1845,1858 ****
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
vim_mz_buffer *buf;
|
|
Karsten Hopp |
81c285 |
int linenr;
|
|
Karsten Hopp |
81c285 |
! char *line;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
buf = get_buffer_arg(prim->name, 1, argc, argv);
|
|
Karsten Hopp |
81c285 |
linenr = SCHEME_INT_VAL(GUARANTEE_INTEGER(prim->name, 0));
|
|
Karsten Hopp |
81c285 |
line = ml_get_buf(buf->buf, (linenr_T)linenr, FALSE);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
raise_if_error();
|
|
Karsten Hopp |
81c285 |
! return scheme_make_string(line);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 2049,2062 ----
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
vim_mz_buffer *buf;
|
|
Karsten Hopp |
81c285 |
int linenr;
|
|
Karsten Hopp |
81c285 |
! char_u *line;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
buf = get_buffer_arg(prim->name, 1, argc, argv);
|
|
Karsten Hopp |
81c285 |
linenr = SCHEME_INT_VAL(GUARANTEE_INTEGER(prim->name, 0));
|
|
Karsten Hopp |
81c285 |
line = ml_get_buf(buf->buf, (linenr_T)linenr, FALSE);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
raise_if_error();
|
|
Karsten Hopp |
81c285 |
! return scheme_make_string((char *)line);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1869,1875 ****
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
vim_mz_buffer *buf;
|
|
Karsten Hopp |
81c285 |
int i, hi, lo, n;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *list;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
buf = get_buffer_arg(prim->name, 2, argc, argv);
|
|
Karsten Hopp |
81c285 |
list = scheme_null;
|
|
Karsten Hopp |
81c285 |
--- 2073,2083 ----
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
vim_mz_buffer *buf;
|
|
Karsten Hopp |
81c285 |
int i, hi, lo, n;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *list = NULL;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(1);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, list);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
buf = get_buffer_arg(prim->name, 2, argc, argv);
|
|
Karsten Hopp |
81c285 |
list = scheme_null;
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1897,1904 ****
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* Set the list item */
|
|
Karsten Hopp |
81c285 |
list = scheme_make_pair(str, list);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
return list;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--- 2105,2113 ----
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* Set the list item */
|
|
Karsten Hopp |
81c285 |
list = scheme_make_pair(str, list);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
! MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
return list;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1925,1935 ****
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
vim_mz_buffer *buf;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *line;
|
|
Karsten Hopp |
81c285 |
char *save;
|
|
Karsten Hopp |
81c285 |
- buf_T *savebuf;
|
|
Karsten Hopp |
81c285 |
int n;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#ifdef HAVE_SANDBOX
|
|
Karsten Hopp |
81c285 |
sandbox_check();
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
--- 2134,2147 ----
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
vim_mz_buffer *buf;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *line = NULL;
|
|
Karsten Hopp |
81c285 |
char *save;
|
|
Karsten Hopp |
81c285 |
int n;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_DECL_REG(1);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_VAR_IN_REG(0, line);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
#ifdef HAVE_SANDBOX
|
|
Karsten Hopp |
81c285 |
sandbox_check();
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1943,1949 ****
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (SCHEME_FALSEP(line))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! savebuf = curbuf;
|
|
Karsten Hopp |
81c285 |
curbuf = buf->buf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (u_savedel((linenr_T)n, 1L) == FAIL)
|
|
Karsten Hopp |
81c285 |
--- 2155,2162 ----
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (SCHEME_FALSEP(line))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! buf_T *savebuf = curbuf;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
curbuf = buf->buf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (u_savedel((linenr_T)n, 1L) == FAIL)
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 1962,1994 ****
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
raise_if_error();
|
|
Karsten Hopp |
81c285 |
return scheme_void;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /* Otherwise it's a line */
|
|
Karsten Hopp |
81c285 |
! save = string_to_line(line);
|
|
Karsten Hopp |
81c285 |
! savebuf = curbuf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! curbuf = buf->buf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
- if (u_savesub((linenr_T)n) == FAIL)
|
|
Karsten Hopp |
81c285 |
- {
|
|
Karsten Hopp |
81c285 |
- curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
- raise_vim_exn(_("cannot save undo information"));
|
|
Karsten Hopp |
81c285 |
- }
|
|
Karsten Hopp |
81c285 |
- else if (ml_replace((linenr_T)n, (char_u *)save, TRUE) == FAIL)
|
|
Karsten Hopp |
81c285 |
- {
|
|
Karsten Hopp |
81c285 |
curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
- raise_vim_exn(_("cannot replace line"));
|
|
Karsten Hopp |
81c285 |
- }
|
|
Karsten Hopp |
81c285 |
- else
|
|
Karsten Hopp |
81c285 |
- changed_bytes((linenr_T)n, 0);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! raise_if_error();
|
|
Karsten Hopp |
81c285 |
! return scheme_void;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
--- 2175,2230 ----
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
raise_if_error();
|
|
Karsten Hopp |
81c285 |
return scheme_void;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
+ else
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ /* Otherwise it's a line */
|
|
Karsten Hopp |
81c285 |
+ buf_T *savebuf = curbuf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! save = string_to_line(line);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! curbuf = buf->buf;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! if (u_savesub((linenr_T)n) == FAIL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! vim_free(save);
|
|
Karsten Hopp |
81c285 |
! raise_vim_exn(_("cannot save undo information"));
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! else if (ml_replace((linenr_T)n, (char_u *)save, TRUE) == FAIL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! vim_free(save);
|
|
Karsten Hopp |
81c285 |
! raise_vim_exn(_("cannot replace line"));
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! else
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! vim_free(save);
|
|
Karsten Hopp |
81c285 |
! changed_bytes((linenr_T)n, 0);
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /* Check that the cursor is not beyond the end of the line now. */
|
|
Karsten Hopp |
81c285 |
! if (buf->buf == curwin->w_buffer)
|
|
Karsten Hopp |
81c285 |
! check_cursor_col();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
! raise_if_error();
|
|
Karsten Hopp |
81c285 |
! return scheme_void;
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! static void
|
|
Karsten Hopp |
81c285 |
! free_array(char **array)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! char **curr = array;
|
|
Karsten Hopp |
81c285 |
! while (*curr != NULL)
|
|
Karsten Hopp |
81c285 |
! vim_free(*curr++);
|
|
Karsten Hopp |
81c285 |
! vim_free(array);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2013,2027 ****
|
|
Karsten Hopp |
81c285 |
* 3. Anything else - this is an error.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
! vim_mz_buffer *buf;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *line_list;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *line;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *rest;
|
|
Karsten Hopp |
81c285 |
! char **array;
|
|
Karsten Hopp |
81c285 |
! buf_T *savebuf;
|
|
Karsten Hopp |
81c285 |
int i, old_len, new_len, hi, lo;
|
|
Karsten Hopp |
81c285 |
long extra;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#ifdef HAVE_SANDBOX
|
|
Karsten Hopp |
81c285 |
sandbox_check();
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
--- 2249,2263 ----
|
|
Karsten Hopp |
81c285 |
* 3. Anything else - this is an error.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
! vim_mz_buffer *buf = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *line_list = NULL;
|
|
Karsten Hopp |
81c285 |
int i, old_len, new_len, hi, lo;
|
|
Karsten Hopp |
81c285 |
long extra;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_DECL_REG(1);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_VAR_IN_REG(0, line_list);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
#ifdef HAVE_SANDBOX
|
|
Karsten Hopp |
81c285 |
sandbox_check();
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2047,2053 ****
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (SCHEME_FALSEP(line_list) || SCHEME_NULLP(line_list))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! savebuf = curbuf;
|
|
Karsten Hopp |
81c285 |
curbuf = buf->buf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (u_savedel((linenr_T)lo, (long)old_len) == FAIL)
|
|
Karsten Hopp |
81c285 |
--- 2283,2289 ----
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (SCHEME_FALSEP(line_list) || SCHEME_NULLP(line_list))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! buf_T *savebuf = curbuf;
|
|
Karsten Hopp |
81c285 |
curbuf = buf->buf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (u_savedel((linenr_T)lo, (long)old_len) == FAIL)
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2070,2167 ****
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
raise_if_error();
|
|
Karsten Hopp |
81c285 |
return scheme_void;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /* List */
|
|
Karsten Hopp |
81c285 |
! new_len = scheme_proper_list_length(line_list);
|
|
Karsten Hopp |
81c285 |
! if (new_len < 0) /* improper or cyclic list */
|
|
Karsten Hopp |
81c285 |
! scheme_wrong_type(prim->name, "proper list",
|
|
Karsten Hopp |
81c285 |
! 2, argc, argv);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /* Using MzScheme allocator, so we don't need to free this and
|
|
Karsten Hopp |
81c285 |
! * can safely keep pointers to GC collected strings
|
|
Karsten Hopp |
81c285 |
! */
|
|
Karsten Hopp |
81c285 |
! array = (char **)scheme_malloc_fail_ok(scheme_malloc,
|
|
Karsten Hopp |
81c285 |
! (unsigned)(new_len * sizeof(char *)));
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! rest = line_list;
|
|
Karsten Hopp |
81c285 |
! for (i = 0; i < new_len; ++i)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! line = SCHEME_CAR(rest);
|
|
Karsten Hopp |
81c285 |
! rest = SCHEME_CDR(rest);
|
|
Karsten Hopp |
81c285 |
! if (!SCHEME_STRINGP(line))
|
|
Karsten Hopp |
81c285 |
! scheme_wrong_type(prim->name, "string-list", 2, argc, argv);
|
|
Karsten Hopp |
81c285 |
! array[i] = string_to_line(line);
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! savebuf = curbuf;
|
|
Karsten Hopp |
81c285 |
! curbuf = buf->buf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! raise_vim_exn(_("cannot save undo information"));
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /*
|
|
Karsten Hopp |
81c285 |
! * If the size of the range is reducing (ie, new_len < old_len) we
|
|
Karsten Hopp |
81c285 |
! * need to delete some old_len. We do this at the start, by
|
|
Karsten Hopp |
81c285 |
! * repeatedly deleting line "lo".
|
|
Karsten Hopp |
81c285 |
! */
|
|
Karsten Hopp |
81c285 |
! for (i = 0; i < old_len - new_len; ++i)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! if (ml_delete((linenr_T)lo, FALSE) == FAIL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! raise_vim_exn(_("cannot delete line"));
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! extra--;
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /*
|
|
Karsten Hopp |
81c285 |
! * For as long as possible, replace the existing old_len with the
|
|
Karsten Hopp |
81c285 |
! * new old_len. This is a more efficient operation, as it requires
|
|
Karsten Hopp |
81c285 |
! * less memory allocation and freeing.
|
|
Karsten Hopp |
81c285 |
! */
|
|
Karsten Hopp |
81c285 |
! for (i = 0; i < old_len && i < new_len; i++)
|
|
Karsten Hopp |
81c285 |
! if (ml_replace((linenr_T)(lo+i), (char_u *)array[i], TRUE) == FAIL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! raise_vim_exn(_("cannot replace line"));
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /*
|
|
Karsten Hopp |
81c285 |
! * Now we may need to insert the remaining new_len. We don't need to
|
|
Karsten Hopp |
81c285 |
! * free the string passed back because MzScheme has control of that
|
|
Karsten Hopp |
81c285 |
! * memory.
|
|
Karsten Hopp |
81c285 |
! */
|
|
Karsten Hopp |
81c285 |
! while (i < new_len)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! if (ml_append((linenr_T)(lo + i - 1),
|
|
Karsten Hopp |
81c285 |
! (char_u *)array[i], 0, FALSE) == FAIL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! raise_vim_exn(_("cannot insert line"));
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
- ++i;
|
|
Karsten Hopp |
81c285 |
- ++extra;
|
|
Karsten Hopp |
81c285 |
- }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /*
|
|
Karsten Hopp |
81c285 |
! * Adjust marks. Invalidate any which lie in the
|
|
Karsten Hopp |
81c285 |
! * changed range, and move any in the remainder of the buffer.
|
|
Karsten Hopp |
81c285 |
! */
|
|
Karsten Hopp |
81c285 |
! mark_adjust((linenr_T)lo, (linenr_T)(hi - 1), (long)MAXLNUM, (long)extra);
|
|
Karsten Hopp |
81c285 |
! changed_lines((linenr_T)lo, 0, (linenr_T)hi, (long)extra);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! if (buf->buf == curwin->w_buffer)
|
|
Karsten Hopp |
81c285 |
! mz_fix_cursor(lo, hi, extra);
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! raise_if_error();
|
|
Karsten Hopp |
81c285 |
! return scheme_void;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
--- 2306,2426 ----
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
raise_if_error();
|
|
Karsten Hopp |
81c285 |
return scheme_void;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
+ else
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ buf_T *savebuf = curbuf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /* List */
|
|
Karsten Hopp |
81c285 |
! new_len = scheme_proper_list_length(line_list);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! if (new_len < 0) /* improper or cyclic list */
|
|
Karsten Hopp |
81c285 |
! scheme_wrong_type(prim->name, "proper list",
|
|
Karsten Hopp |
81c285 |
! 2, argc, argv);
|
|
Karsten Hopp |
81c285 |
! else
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! char **array = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *line = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *rest = NULL;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(2);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, line);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(1, rest);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! array = (char **)alloc(new_len * sizeof(char *));
|
|
Karsten Hopp |
81c285 |
! vim_memset(array, 0, new_len * sizeof(char *));
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! rest = line_list;
|
|
Karsten Hopp |
81c285 |
! for (i = 0; i < new_len; ++i)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! line = SCHEME_CAR(rest);
|
|
Karsten Hopp |
81c285 |
! rest = SCHEME_CDR(rest);
|
|
Karsten Hopp |
81c285 |
! if (!SCHEME_STRINGP(line))
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! free_array(array);
|
|
Karsten Hopp |
81c285 |
! scheme_wrong_type(prim->name, "string-list", 2, argc, argv);
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! array[i] = string_to_line(line);
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! curbuf = buf->buf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! free_array(array);
|
|
Karsten Hopp |
81c285 |
! raise_vim_exn(_("cannot save undo information"));
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /*
|
|
Karsten Hopp |
81c285 |
! * If the size of the range is reducing (ie, new_len < old_len) we
|
|
Karsten Hopp |
81c285 |
! * need to delete some old_len. We do this at the start, by
|
|
Karsten Hopp |
81c285 |
! * repeatedly deleting line "lo".
|
|
Karsten Hopp |
81c285 |
! */
|
|
Karsten Hopp |
81c285 |
! for (i = 0; i < old_len - new_len; ++i)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! if (ml_delete((linenr_T)lo, FALSE) == FAIL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! free_array(array);
|
|
Karsten Hopp |
81c285 |
! raise_vim_exn(_("cannot delete line"));
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! extra--;
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /*
|
|
Karsten Hopp |
81c285 |
! * For as long as possible, replace the existing old_len with the
|
|
Karsten Hopp |
81c285 |
! * new old_len. This is a more efficient operation, as it requires
|
|
Karsten Hopp |
81c285 |
! * less memory allocation and freeing.
|
|
Karsten Hopp |
81c285 |
! */
|
|
Karsten Hopp |
81c285 |
! for (i = 0; i < old_len && i < new_len; i++)
|
|
Karsten Hopp |
81c285 |
! if (ml_replace((linenr_T)(lo+i), (char_u *)array[i], TRUE) == FAIL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! free_array(array);
|
|
Karsten Hopp |
81c285 |
! raise_vim_exn(_("cannot replace line"));
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /*
|
|
Karsten Hopp |
81c285 |
! * Now we may need to insert the remaining new_len. We don't need to
|
|
Karsten Hopp |
81c285 |
! * free the string passed back because MzScheme has control of that
|
|
Karsten Hopp |
81c285 |
! * memory.
|
|
Karsten Hopp |
81c285 |
! */
|
|
Karsten Hopp |
81c285 |
! while (i < new_len)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! if (ml_append((linenr_T)(lo + i - 1),
|
|
Karsten Hopp |
81c285 |
! (char_u *)array[i], 0, FALSE) == FAIL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! free_array(array);
|
|
Karsten Hopp |
81c285 |
! raise_vim_exn(_("cannot insert line"));
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! ++i;
|
|
Karsten Hopp |
81c285 |
! ++extra;
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
! free_array(array);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! /*
|
|
Karsten Hopp |
81c285 |
! * Adjust marks. Invalidate any which lie in the
|
|
Karsten Hopp |
81c285 |
! * changed range, and move any in the remainder of the buffer.
|
|
Karsten Hopp |
81c285 |
! */
|
|
Karsten Hopp |
81c285 |
! mark_adjust((linenr_T)lo, (linenr_T)(hi - 1), (long)MAXLNUM, (long)extra);
|
|
Karsten Hopp |
81c285 |
! changed_lines((linenr_T)lo, 0, (linenr_T)hi, (long)extra);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! if (buf->buf == curwin->w_buffer)
|
|
Karsten Hopp |
81c285 |
! mz_fix_cursor(lo, hi, extra);
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
! raise_if_error();
|
|
Karsten Hopp |
81c285 |
! return scheme_void;
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2179,2193 ****
|
|
Karsten Hopp |
81c285 |
insert_buffer_line_list(void *data, int argc, Scheme_Object **argv)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
! vim_mz_buffer *buf;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *list;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *line;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *rest;
|
|
Karsten Hopp |
81c285 |
! char **array;
|
|
Karsten Hopp |
81c285 |
! char *str;
|
|
Karsten Hopp |
81c285 |
! buf_T *savebuf;
|
|
Karsten Hopp |
81c285 |
int i, n, size;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#ifdef HAVE_SANDBOX
|
|
Karsten Hopp |
81c285 |
sandbox_check();
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
--- 2438,2452 ----
|
|
Karsten Hopp |
81c285 |
insert_buffer_line_list(void *data, int argc, Scheme_Object **argv)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
! vim_mz_buffer *buf = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *list = NULL;
|
|
Karsten Hopp |
81c285 |
! char *str = NULL;
|
|
Karsten Hopp |
81c285 |
int i, n, size;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_DECL_REG(1);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_VAR_IN_REG(0, list);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
#ifdef HAVE_SANDBOX
|
|
Karsten Hopp |
81c285 |
sandbox_check();
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2206,2294 ****
|
|
Karsten Hopp |
81c285 |
check_line_range(n, buf->buf);
|
|
Karsten Hopp |
81c285 |
if (SCHEME_STRINGP(list))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! str = string_to_line(list);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! savebuf = curbuf;
|
|
Karsten Hopp |
81c285 |
curbuf = buf->buf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (u_save((linenr_T)n, (linenr_T)(n+1)) == FAIL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
raise_vim_exn(_("cannot save undo information"));
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
else if (ml_append((linenr_T)n, (char_u *)str, 0, FALSE) == FAIL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
raise_vim_exn(_("cannot insert line"));
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
appended_lines_mark((linenr_T)n, 1L);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
update_screen(VALID);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
raise_if_error();
|
|
Karsten Hopp |
81c285 |
return scheme_void;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* List */
|
|
Karsten Hopp |
81c285 |
size = scheme_proper_list_length(list);
|
|
Karsten Hopp |
81c285 |
if (size < 0) /* improper or cyclic list */
|
|
Karsten Hopp |
81c285 |
scheme_wrong_type(prim->name, "proper list",
|
|
Karsten Hopp |
81c285 |
2, argc, argv);
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! /* Using MzScheme allocator, so we don't need to free this and
|
|
Karsten Hopp |
81c285 |
! * can safely keep pointers to GC collected strings
|
|
Karsten Hopp |
81c285 |
! */
|
|
Karsten Hopp |
81c285 |
! array = (char **)scheme_malloc_fail_ok(
|
|
Karsten Hopp |
81c285 |
! scheme_malloc, (unsigned)(size * sizeof(char *)));
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! rest = list;
|
|
Karsten Hopp |
81c285 |
! for (i = 0; i < size; ++i)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! line = SCHEME_CAR(rest);
|
|
Karsten Hopp |
81c285 |
! rest = SCHEME_CDR(rest);
|
|
Karsten Hopp |
81c285 |
! array[i] = string_to_line(line);
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! savebuf = curbuf;
|
|
Karsten Hopp |
81c285 |
! curbuf = buf->buf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! raise_vim_exn(_("cannot save undo information"));
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! else
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
for (i = 0; i < size; ++i)
|
|
Karsten Hopp |
81c285 |
! if (ml_append((linenr_T)(n + i), (char_u *)array[i],
|
|
Karsten Hopp |
81c285 |
! 0, FALSE) == FAIL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! raise_vim_exn(_("cannot insert line"));
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! if (i > 0)
|
|
Karsten Hopp |
81c285 |
! appended_lines_mark((linenr_T)n, (long)i);
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! update_screen(VALID);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
raise_if_error();
|
|
Karsten Hopp |
81c285 |
return scheme_void;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
- /* (get-buff-namespace [buffer]) */
|
|
Karsten Hopp |
81c285 |
- static Scheme_Object *
|
|
Karsten Hopp |
81c285 |
- get_buffer_namespace(void *data, int argc, Scheme_Object **argv)
|
|
Karsten Hopp |
81c285 |
- {
|
|
Karsten Hopp |
81c285 |
- Vim_Prim *prim = (Vim_Prim *)data;
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
- return (Scheme_Object *)get_buffer_arg(prim->name, 0, argc, argv)->env;
|
|
Karsten Hopp |
81c285 |
- }
|
|
Karsten Hopp |
81c285 |
-
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* Predicates
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
--- 2465,2563 ----
|
|
Karsten Hopp |
81c285 |
check_line_range(n, buf->buf);
|
|
Karsten Hopp |
81c285 |
if (SCHEME_STRINGP(list))
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! buf_T *savebuf = curbuf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! str = string_to_line(list);
|
|
Karsten Hopp |
81c285 |
curbuf = buf->buf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (u_save((linenr_T)n, (linenr_T)(n+1)) == FAIL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
+ vim_free(str);
|
|
Karsten Hopp |
81c285 |
raise_vim_exn(_("cannot save undo information"));
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
else if (ml_append((linenr_T)n, (char_u *)str, 0, FALSE) == FAIL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
+ vim_free(str);
|
|
Karsten Hopp |
81c285 |
raise_vim_exn(_("cannot insert line"));
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ vim_free(str);
|
|
Karsten Hopp |
81c285 |
appended_lines_mark((linenr_T)n, 1L);
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
update_screen(VALID);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
raise_if_error();
|
|
Karsten Hopp |
81c285 |
return scheme_void;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* List */
|
|
Karsten Hopp |
81c285 |
size = scheme_proper_list_length(list);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
if (size < 0) /* improper or cyclic list */
|
|
Karsten Hopp |
81c285 |
scheme_wrong_type(prim->name, "proper list",
|
|
Karsten Hopp |
81c285 |
2, argc, argv);
|
|
Karsten Hopp |
81c285 |
! else
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *line = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *rest = NULL;
|
|
Karsten Hopp |
81c285 |
! char **array;
|
|
Karsten Hopp |
81c285 |
! buf_T *savebuf = curbuf;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(2);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, line);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(1, rest);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! array = (char **)alloc(size * sizeof(char *));
|
|
Karsten Hopp |
81c285 |
! vim_memset(array, 0, size * sizeof(char *));
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! rest = list;
|
|
Karsten Hopp |
81c285 |
for (i = 0; i < size; ++i)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! line = SCHEME_CAR(rest);
|
|
Karsten Hopp |
81c285 |
! rest = SCHEME_CDR(rest);
|
|
Karsten Hopp |
81c285 |
! array[i] = string_to_line(line);
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! curbuf = buf->buf;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! free_array(array);
|
|
Karsten Hopp |
81c285 |
! raise_vim_exn(_("cannot save undo information"));
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! else
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! for (i = 0; i < size; ++i)
|
|
Karsten Hopp |
81c285 |
! if (ml_append((linenr_T)(n + i), (char_u *)array[i],
|
|
Karsten Hopp |
81c285 |
! 0, FALSE) == FAIL)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! free_array(array);
|
|
Karsten Hopp |
81c285 |
! raise_vim_exn(_("cannot insert line"));
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! if (i > 0)
|
|
Karsten Hopp |
81c285 |
! appended_lines_mark((linenr_T)n, (long)i);
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! free_array(array);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
! curbuf = savebuf;
|
|
Karsten Hopp |
81c285 |
! update_screen(VALID);
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
raise_if_error();
|
|
Karsten Hopp |
81c285 |
return scheme_void;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* Predicates
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2343,2383 ****
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* Convert an MzScheme string into a Vim line.
|
|
Karsten Hopp |
81c285 |
*
|
|
Karsten Hopp |
81c285 |
! * The result is in allocated memory. All internal nulls are replaced by
|
|
Karsten Hopp |
81c285 |
! * newline characters. It is an error for the string to contain newline
|
|
Karsten Hopp |
81c285 |
! * characters.
|
|
Karsten Hopp |
81c285 |
*
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
static char *
|
|
Karsten Hopp |
81c285 |
string_to_line(Scheme_Object *obj)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! char *str;
|
|
Karsten Hopp |
81c285 |
long len;
|
|
Karsten Hopp |
81c285 |
int i;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! str = scheme_display_to_string(obj, &len;;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* Error checking: String must not contain newlines, as we
|
|
Karsten Hopp |
81c285 |
* are replacing a single line, and we must replace it with
|
|
Karsten Hopp |
81c285 |
* a single line.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
! if (memchr(str, '\n', len))
|
|
Karsten Hopp |
81c285 |
scheme_signal_error(_("string cannot contain newlines"));
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* Create a copy of the string, with internal nulls replaced by
|
|
Karsten Hopp |
81c285 |
* newline characters, as is the vim convention.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
for (i = 0; i < len; ++i)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! if (str[i] == '\0')
|
|
Karsten Hopp |
81c285 |
! str[i] = '\n';
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! str[i] = '\0';
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! return str;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* Check to see whether a Vim error has been reported, or a keyboard
|
|
Karsten Hopp |
81c285 |
* interrupt (from vim --> got_int) has been detected.
|
|
Karsten Hopp |
81c285 |
--- 2612,2784 ----
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* Convert an MzScheme string into a Vim line.
|
|
Karsten Hopp |
81c285 |
*
|
|
Karsten Hopp |
81c285 |
! * All internal nulls are replaced by newline characters.
|
|
Karsten Hopp |
81c285 |
! * It is an error for the string to contain newline characters.
|
|
Karsten Hopp |
81c285 |
*
|
|
Karsten Hopp |
81c285 |
+ * Returns pointer to Vim allocated memory
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
static char *
|
|
Karsten Hopp |
81c285 |
string_to_line(Scheme_Object *obj)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! char *scheme_str = NULL;
|
|
Karsten Hopp |
81c285 |
! char *vim_str = NULL;
|
|
Karsten Hopp |
81c285 |
long len;
|
|
Karsten Hopp |
81c285 |
int i;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! scheme_str = scheme_display_to_string(obj, &len;;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* Error checking: String must not contain newlines, as we
|
|
Karsten Hopp |
81c285 |
* are replacing a single line, and we must replace it with
|
|
Karsten Hopp |
81c285 |
* a single line.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
! if (memchr(scheme_str, '\n', len))
|
|
Karsten Hopp |
81c285 |
scheme_signal_error(_("string cannot contain newlines"));
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ vim_str = (char *)alloc(len + 1);
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
/* Create a copy of the string, with internal nulls replaced by
|
|
Karsten Hopp |
81c285 |
* newline characters, as is the vim convention.
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
for (i = 0; i < len; ++i)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! if (scheme_str[i] == '\0')
|
|
Karsten Hopp |
81c285 |
! vim_str[i] = '\n';
|
|
Karsten Hopp |
81c285 |
! else
|
|
Karsten Hopp |
81c285 |
! vim_str[i] = scheme_str[i];
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! vim_str[i] = '\0';
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! return vim_str;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ #ifdef FEAT_EVAL
|
|
Karsten Hopp |
81c285 |
+ /*
|
|
Karsten Hopp |
81c285 |
+ * Convert Vim value into MzScheme, adopted from if_python.c
|
|
Karsten Hopp |
81c285 |
+ */
|
|
Karsten Hopp |
81c285 |
+ static Scheme_Object *
|
|
Karsten Hopp |
81c285 |
+ vim_to_mzscheme(typval_T *vim_value, int depth, Scheme_Hash_Table *visited)
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ Scheme_Object *result = NULL;
|
|
Karsten Hopp |
81c285 |
+ int new_value = TRUE;
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_DECL_REG(1);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_VAR_IN_REG(0, result);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ /* Avoid infinite recursion */
|
|
Karsten Hopp |
81c285 |
+ if (depth > 100)
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
+ return scheme_void;
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ /* Check if we run into a recursive loop. The item must be in visited
|
|
Karsten Hopp |
81c285 |
+ * then and we can use it again.
|
|
Karsten Hopp |
81c285 |
+ */
|
|
Karsten Hopp |
81c285 |
+ result = scheme_hash_get(visited, (Scheme_Object *)vim_value);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ if (result != NULL) /* found, do nothing */
|
|
Karsten Hopp |
81c285 |
+ new_value = FALSE;
|
|
Karsten Hopp |
81c285 |
+ else if (vim_value->v_type == VAR_STRING)
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ result = scheme_make_string((char *)vim_value->vval.v_string);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+ else if (vim_value->v_type == VAR_NUMBER)
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ result = scheme_make_integer((long)vim_value->vval.v_number);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+ # ifdef FEAT_FLOAT
|
|
Karsten Hopp |
81c285 |
+ else if (vim_value->v_type == VAR_FLOAT)
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ result = scheme_make_double((double)vim_value->vval.v_float);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+ # endif
|
|
Karsten Hopp |
81c285 |
+ else if (vim_value->v_type == VAR_LIST)
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ list_T *list = vim_value->vval.v_list;
|
|
Karsten Hopp |
81c285 |
+ listitem_T *curr;
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ if (list == NULL || list->lv_first == NULL)
|
|
Karsten Hopp |
81c285 |
+ result = scheme_null;
|
|
Karsten Hopp |
81c285 |
+ else
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ Scheme_Object *obj = NULL;
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_DECL_REG(1);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_VAR_IN_REG(0, obj);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ curr = list->lv_last;
|
|
Karsten Hopp |
81c285 |
+ obj = vim_to_mzscheme(&curr->li_tv, depth + 1, visited);
|
|
Karsten Hopp |
81c285 |
+ result = scheme_make_pair(obj, scheme_null);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ while (curr != list->lv_first)
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ curr = curr->li_prev;
|
|
Karsten Hopp |
81c285 |
+ obj = vim_to_mzscheme(&curr->li_tv, depth + 1, visited);
|
|
Karsten Hopp |
81c285 |
+ result = scheme_make_pair(obj, result);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+ else if (vim_value->v_type == VAR_DICT)
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ Scheme_Object *key = NULL;
|
|
Karsten Hopp |
81c285 |
+ Scheme_Object *obj = NULL;
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_DECL_REG(2);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_VAR_IN_REG(0, key);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_VAR_IN_REG(1, obj);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ result = (Scheme_Object *)scheme_make_hash_table(SCHEME_hash_ptr);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ if (vim_value->vval.v_dict != NULL)
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ hashtab_T *ht = &vim_value->vval.v_dict->dv_hashtab;
|
|
Karsten Hopp |
81c285 |
+ long_u todo = ht->ht_used;
|
|
Karsten Hopp |
81c285 |
+ hashitem_T *hi;
|
|
Karsten Hopp |
81c285 |
+ dictitem_T *di;
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ for (hi = ht->ht_array; todo > 0; ++hi)
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ if (!HASHITEM_EMPTY(hi))
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ --todo;
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ di = dict_lookup(hi);
|
|
Karsten Hopp |
81c285 |
+ obj = vim_to_mzscheme(&di->di_tv, depth + 1, visited);
|
|
Karsten Hopp |
81c285 |
+ key = scheme_make_string((char *)hi->hi_key);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ scheme_hash_set((Scheme_Hash_Table *)result, key, obj);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+ else
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ result = scheme_void;
|
|
Karsten Hopp |
81c285 |
+ new_value = FALSE;
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+ if (new_value)
|
|
Karsten Hopp |
81c285 |
+ {
|
|
Karsten Hopp |
81c285 |
+ scheme_hash_set(visited, (Scheme_Object *)vim_value, result);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
+ return result;
|
|
Karsten Hopp |
81c285 |
+ }
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* Check to see whether a Vim error has been reported, or a keyboard
|
|
Karsten Hopp |
81c285 |
* interrupt (from vim --> got_int) has been detected.
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2392,2441 ****
|
|
Karsten Hopp |
81c285 |
* register Scheme exn:vim
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
static void
|
|
Karsten Hopp |
81c285 |
! register_vim_exn(Scheme_Env *env)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *exn_name = scheme_intern_symbol("exn:vim");
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (vim_exn == NULL)
|
|
Karsten Hopp |
81c285 |
vim_exn = scheme_make_struct_type(exn_name,
|
|
Karsten Hopp |
81c285 |
! scheme_builtin_value("struct:exn"), NULL, 0, 0, NULL, NULL
|
|
Karsten Hopp |
81c285 |
#if MZSCHEME_VERSION_MAJOR >= 299
|
|
Karsten Hopp |
81c285 |
, NULL
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
- if (vim_exn_values == NULL)
|
|
Karsten Hopp |
81c285 |
- {
|
|
Karsten Hopp |
81c285 |
- int nc = 0;
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! Scheme_Object **exn_names = scheme_make_struct_names(
|
|
Karsten Hopp |
81c285 |
! exn_name, scheme_null, 0, &nc);
|
|
Karsten Hopp |
81c285 |
! Scheme_Object **exn_values = scheme_make_struct_values(
|
|
Karsten Hopp |
81c285 |
! vim_exn, exn_names, nc, 0);
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! vim_exn_names = scheme_make_vector(nc, scheme_false);
|
|
Karsten Hopp |
81c285 |
! vim_exn_values = scheme_make_vector(nc, scheme_false);
|
|
Karsten Hopp |
81c285 |
! /* remember names and values */
|
|
Karsten Hopp |
81c285 |
! mch_memmove(SCHEME_VEC_ELS(vim_exn_names), exn_names,
|
|
Karsten Hopp |
81c285 |
! nc * sizeof(Scheme_Object *));
|
|
Karsten Hopp |
81c285 |
! mch_memmove(SCHEME_VEC_ELS(vim_exn_values), exn_values,
|
|
Karsten Hopp |
81c285 |
! nc * sizeof(Scheme_Object *));
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! add_vim_exn(env);
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! /*
|
|
Karsten Hopp |
81c285 |
! * Add stuff of exn:vim to env
|
|
Karsten Hopp |
81c285 |
! */
|
|
Karsten Hopp |
81c285 |
! static void
|
|
Karsten Hopp |
81c285 |
! add_vim_exn(Scheme_Env *env)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! int i;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! for (i = 0; i < SCHEME_VEC_SIZE(vim_exn_values); i++)
|
|
Karsten Hopp |
81c285 |
! scheme_add_global_symbol(SCHEME_VEC_ELS(vim_exn_names)[i],
|
|
Karsten Hopp |
81c285 |
! SCHEME_VEC_ELS(vim_exn_values)[i], env);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
--- 2793,2851 ----
|
|
Karsten Hopp |
81c285 |
* register Scheme exn:vim
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
static void
|
|
Karsten Hopp |
81c285 |
! register_vim_exn(void)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! int nc = 0;
|
|
Karsten Hopp |
81c285 |
! int i;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *struct_exn = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *exn_name = NULL;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(2);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, struct_exn);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(1, exn_name);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! exn_name = scheme_intern_symbol("exn:vim");
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! struct_exn = scheme_builtin_value("struct:exn");
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (vim_exn == NULL)
|
|
Karsten Hopp |
81c285 |
vim_exn = scheme_make_struct_type(exn_name,
|
|
Karsten Hopp |
81c285 |
! struct_exn, NULL, 0, 0, NULL, NULL
|
|
Karsten Hopp |
81c285 |
#if MZSCHEME_VERSION_MAJOR >= 299
|
|
Karsten Hopp |
81c285 |
, NULL
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
);
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! Scheme_Object **tmp = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *exn_names[5] = {NULL, NULL, NULL, NULL, NULL};
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *exn_values[5] = {NULL, NULL, NULL, NULL, NULL};
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(6);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_ARRAY_VAR_IN_REG(0, exn_names, 5);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_ARRAY_VAR_IN_REG(3, exn_values, 5);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! tmp = scheme_make_struct_names(exn_name, scheme_null, 0, &nc);
|
|
Karsten Hopp |
81c285 |
! assert(nc <= 5);
|
|
Karsten Hopp |
81c285 |
! mch_memmove(exn_names, tmp, nc * sizeof(Scheme_Object *));
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! tmp = scheme_make_struct_values(vim_exn, exn_names, nc, 0);
|
|
Karsten Hopp |
81c285 |
! mch_memmove(exn_values, tmp, nc * sizeof(Scheme_Object *));
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! for (i = 0; i < nc; i++)
|
|
Karsten Hopp |
81c285 |
! {
|
|
Karsten Hopp |
81c285 |
! scheme_add_global_symbol(exn_names[i],
|
|
Karsten Hopp |
81c285 |
! exn_values[i], environment);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! }
|
|
Karsten Hopp |
81c285 |
! MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
! MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2444,2469 ****
|
|
Karsten Hopp |
81c285 |
void
|
|
Karsten Hopp |
81c285 |
raise_vim_exn(const char *add_info)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *argv[2];
|
|
Karsten Hopp |
81c285 |
! char_u *fmt = _("Vim error: ~a");
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (add_info != NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *info = scheme_make_string(add_info);
|
|
Karsten Hopp |
81c285 |
! argv[0] = scheme_byte_string_to_char_string(scheme_make_string(
|
|
Karsten Hopp |
81c285 |
! scheme_format(fmt, strlen(fmt), 1, &info, NULL)));
|
|
Karsten Hopp |
81c285 |
SCHEME_SET_IMMUTABLE(argv[0]);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
argv[0] = scheme_make_string(_("Vim error"));
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#if MZSCHEME_VERSION_MAJOR < 360
|
|
Karsten Hopp |
81c285 |
argv[1] = scheme_current_continuation_marks();
|
|
Karsten Hopp |
81c285 |
#else
|
|
Karsten Hopp |
81c285 |
argv[1] = scheme_current_continuation_marks(NULL);
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! scheme_raise(scheme_make_struct_instance(vim_exn, 2, argv));
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
void
|
|
Karsten Hopp |
81c285 |
--- 2854,2907 ----
|
|
Karsten Hopp |
81c285 |
void
|
|
Karsten Hopp |
81c285 |
raise_vim_exn(const char *add_info)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! char *fmt = _("Vim error: ~a");
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *argv[2] = {NULL, NULL};
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *exn = NULL;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(4);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_ARRAY_VAR_IN_REG(0, argv, 2);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(3, exn);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
if (add_info != NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! char *c_string = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *byte_string = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *info = NULL;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(3);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, c_string);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(1, byte_string);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(2, info);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! info = scheme_make_string(add_info);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! c_string = scheme_format(fmt, STRLEN(fmt), 1, &info, NULL);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! byte_string = scheme_make_string(c_string);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! argv[0] = scheme_byte_string_to_char_string(byte_string);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
SCHEME_SET_IMMUTABLE(argv[0]);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
else
|
|
Karsten Hopp |
81c285 |
argv[0] = scheme_make_string(_("Vim error"));
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#if MZSCHEME_VERSION_MAJOR < 360
|
|
Karsten Hopp |
81c285 |
argv[1] = scheme_current_continuation_marks();
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
#else
|
|
Karsten Hopp |
81c285 |
argv[1] = scheme_current_continuation_marks(NULL);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
! exn = scheme_make_struct_instance(vim_exn, 2, argv);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! scheme_raise(exn);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
void
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2570,2575 ****
|
|
Karsten Hopp |
81c285 |
--- 3008,3015 ----
|
|
Karsten Hopp |
81c285 |
curwin->w_cursor.lnum = lo;
|
|
Karsten Hopp |
81c285 |
check_cursor();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
+ else
|
|
Karsten Hopp |
81c285 |
+ check_cursor_col();
|
|
Karsten Hopp |
81c285 |
changed_cline_bef_curs();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
invalidate_botline();
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2595,2601 ****
|
|
Karsten Hopp |
81c285 |
{mzscheme_open_buffer, "open-buff", 1, 1},
|
|
Karsten Hopp |
81c285 |
{get_buffer_by_name, "get-buff-by-name", 1, 1},
|
|
Karsten Hopp |
81c285 |
{get_buffer_by_num, "get-buff-by-num", 1, 1},
|
|
Karsten Hopp |
81c285 |
- {get_buffer_namespace, "get-buff-namespace", 0, 1},
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* Window-related commands
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
--- 3035,3040 ----
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2653,2675 ****
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
static void
|
|
Karsten Hopp |
81c285 |
! make_modules(Scheme_Env *env)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! int i;
|
|
Karsten Hopp |
81c285 |
! Scheme_Env *mod;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! mod = scheme_primitive_module(scheme_intern_symbol("vimext"), env);
|
|
Karsten Hopp |
81c285 |
/* all prims made closed so they can access their own names */
|
|
Karsten Hopp |
81c285 |
! for (i = 0; i < sizeof(prims)/sizeof(prims[0]); i++)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = prims + i;
|
|
Karsten Hopp |
81c285 |
! scheme_add_global(prim->name,
|
|
Karsten Hopp |
81c285 |
! scheme_make_closed_prim_w_arity(prim->prim, prim, prim->name,
|
|
Karsten Hopp |
81c285 |
! prim->mina, prim->maxa),
|
|
Karsten Hopp |
81c285 |
! mod);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
- scheme_add_global("global-namespace", (Scheme_Object *)environment, mod);
|
|
Karsten Hopp |
81c285 |
scheme_finish_primitive_module(mod);
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#ifdef HAVE_SANDBOX
|
|
Karsten Hopp |
81c285 |
--- 3092,3126 ----
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
static void
|
|
Karsten Hopp |
81c285 |
! make_modules()
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
! int i;
|
|
Karsten Hopp |
81c285 |
! Scheme_Env *mod = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *vimext_symbol = NULL;
|
|
Karsten Hopp |
81c285 |
! Scheme_Object *closed_prim = NULL;
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! MZ_GC_DECL_REG(3);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(0, mod);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(1, vimext_symbol);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_VAR_IN_REG(2, closed_prim);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_REG();
|
|
Karsten Hopp |
81c285 |
!
|
|
Karsten Hopp |
81c285 |
! vimext_symbol = scheme_intern_symbol("vimext");
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
! mod = scheme_primitive_module(vimext_symbol, environment);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
/* all prims made closed so they can access their own names */
|
|
Karsten Hopp |
81c285 |
! for (i = 0; i < (int)(sizeof(prims)/sizeof(prims[0])); i++)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
Vim_Prim *prim = prims + i;
|
|
Karsten Hopp |
81c285 |
! closed_prim = scheme_make_closed_prim_w_arity(prim->prim, prim, prim->name,
|
|
Karsten Hopp |
81c285 |
! prim->mina, prim->maxa);
|
|
Karsten Hopp |
81c285 |
! scheme_add_global(prim->name, closed_prim, mod);
|
|
Karsten Hopp |
81c285 |
! MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
scheme_finish_primitive_module(mod);
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
#ifdef HAVE_SANDBOX
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 2697,2717 ****
|
|
Karsten Hopp |
81c285 |
--- 3148,3172 ----
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(M_write);
|
|
Karsten Hopp |
81c285 |
M_write = scheme_intern_symbol("write");
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
if (M_read == NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(M_read);
|
|
Karsten Hopp |
81c285 |
M_read = scheme_intern_symbol("read");
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
if (M_execute == NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(M_execute);
|
|
Karsten Hopp |
81c285 |
M_execute = scheme_intern_symbol("execute");
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
if (M_delete == NULL)
|
|
Karsten Hopp |
81c285 |
{
|
|
Karsten Hopp |
81c285 |
MZ_REGISTER_STATIC(M_delete);
|
|
Karsten Hopp |
81c285 |
M_delete = scheme_intern_symbol("delete");
|
|
Karsten Hopp |
81c285 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
while (!SCHEME_NULLP(requested_access))
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.190/src/if_mzsch.h 2006-03-24 23:43:11.000000000 +0100
|
|
Karsten Hopp |
81c285 |
--- src/if_mzsch.h 2009-05-26 19:08:21.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 11,16 ****
|
|
Karsten Hopp |
81c285 |
--- 11,17 ----
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/* #ifdef needed for "make depend" */
|
|
Karsten Hopp |
81c285 |
#ifdef FEAT_MZSCHEME
|
|
Karsten Hopp |
81c285 |
+ # include <schvers.h>
|
|
Karsten Hopp |
81c285 |
# include <scheme.h>
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 46,49 ****
|
|
Karsten Hopp |
81c285 |
--- 47,77 ----
|
|
Karsten Hopp |
81c285 |
# define scheme_byte_string_to_char_string(obj) (obj)
|
|
Karsten Hopp |
81c285 |
#endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
+ /* Precise GC macros */
|
|
Karsten Hopp |
81c285 |
+ #ifndef MZ_GC_DECL_REG
|
|
Karsten Hopp |
81c285 |
+ # define MZ_GC_DECL_REG(size) /* empty */
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
+ #ifndef MZ_GC_VAR_IN_REG
|
|
Karsten Hopp |
81c285 |
+ # define MZ_GC_VAR_IN_REG(x, v) /* empty */
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
+ #ifndef MZ_GC_ARRAY_VAR_IN_REG
|
|
Karsten Hopp |
81c285 |
+ # define MZ_GC_ARRAY_VAR_IN_REG(x, v, l) /* empty */
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
+ #ifndef MZ_GC_REG
|
|
Karsten Hopp |
81c285 |
+ # define MZ_GC_REG() /* empty */
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
+ #ifndef MZ_GC_UNREG
|
|
Karsten Hopp |
81c285 |
+ # define MZ_GC_UNREG() /* empty */
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
+ #ifdef MZSCHEME_FORCE_GC
|
|
Karsten Hopp |
81c285 |
+ /*
|
|
Karsten Hopp |
81c285 |
+ * force garbage collection to check all references are registered
|
|
Karsten Hopp |
81c285 |
+ * seg faults will indicate not registered refs
|
|
Karsten Hopp |
81c285 |
+ */
|
|
Karsten Hopp |
81c285 |
+ # define MZ_GC_CHECK() scheme_collect_garbage();
|
|
Karsten Hopp |
81c285 |
+ #else
|
|
Karsten Hopp |
81c285 |
+ # define MZ_GC_CHECK() /* empty */
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
+
|
|
Karsten Hopp |
81c285 |
#endif /* _IF_MZSCH_H_ */
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.190/src/main.c 2009-05-17 13:30:58.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/main.c 2009-05-26 19:09:01.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 935,942 ****
|
|
Karsten Hopp |
81c285 |
--- 935,948 ----
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/*
|
|
Karsten Hopp |
81c285 |
* Call the main command loop. This never returns.
|
|
Karsten Hopp |
81c285 |
+ * For embedded MzScheme the main_loop will be called by Scheme
|
|
Karsten Hopp |
81c285 |
+ * for proper stack tracking
|
|
Karsten Hopp |
81c285 |
*/
|
|
Karsten Hopp |
81c285 |
+ #ifndef FEAT_MZSCHEME
|
|
Karsten Hopp |
81c285 |
main_loop(FALSE, FALSE);
|
|
Karsten Hopp |
81c285 |
+ #else
|
|
Karsten Hopp |
81c285 |
+ mzscheme_main();
|
|
Karsten Hopp |
81c285 |
+ #endif
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
return 0;
|
|
Karsten Hopp |
81c285 |
}
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.190/src/proto/if_mzsch.pro 2004-07-12 17:51:52.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/proto/if_mzsch.pro 2009-05-26 19:09:55.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 15,24 ****
|
|
Karsten Hopp |
81c285 |
void *mzvim_eval_string __ARGS((char_u *str));
|
|
Karsten Hopp |
81c285 |
struct Scheme_Object *mzvim_apply __ARGS((struct Scheme_Object *, int argc,
|
|
Karsten Hopp |
81c285 |
struct Scheme_Object **));
|
|
Karsten Hopp |
81c285 |
! int mzthreads_allowed (void);
|
|
Karsten Hopp |
81c285 |
! #ifdef FEAT_GUI_KDE
|
|
Karsten Hopp |
81c285 |
! void timer_proc (void);
|
|
Karsten Hopp |
81c285 |
! void mzscheme_kde_start_timer (void);
|
|
Karsten Hopp |
81c285 |
! void mzscheme_kde_stop_timer (void);
|
|
Karsten Hopp |
81c285 |
! #endif
|
|
Karsten Hopp |
81c285 |
/* vim: set ft=c : */
|
|
Karsten Hopp |
81c285 |
--- 15,20 ----
|
|
Karsten Hopp |
81c285 |
void *mzvim_eval_string __ARGS((char_u *str));
|
|
Karsten Hopp |
81c285 |
struct Scheme_Object *mzvim_apply __ARGS((struct Scheme_Object *, int argc,
|
|
Karsten Hopp |
81c285 |
struct Scheme_Object **));
|
|
Karsten Hopp |
81c285 |
! int mzthreads_allowed __ARGS((void));
|
|
Karsten Hopp |
81c285 |
! void mzscheme_main __ARGS((void));
|
|
Karsten Hopp |
81c285 |
/* vim: set ft=c : */
|
|
Karsten Hopp |
81c285 |
*** ../vim-7.2.190/src/version.c 2009-05-26 18:12:13.000000000 +0200
|
|
Karsten Hopp |
81c285 |
--- src/version.c 2009-05-26 22:52:53.000000000 +0200
|
|
Karsten Hopp |
81c285 |
***************
|
|
Karsten Hopp |
81c285 |
*** 678,679 ****
|
|
Karsten Hopp |
81c285 |
--- 678,681 ----
|
|
Karsten Hopp |
81c285 |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
81c285 |
+ /**/
|
|
Karsten Hopp |
81c285 |
+ 191,
|
|
Karsten Hopp |
81c285 |
/**/
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
--
|
|
Karsten Hopp |
81c285 |
Scientists decoded the first message from an alien civilization:
|
|
Karsten Hopp |
81c285 |
SIMPLY SEND 6 TIMES 10 TO THE 50 ATOMS OF HYDROGEN TO THE STAR
|
|
Karsten Hopp |
81c285 |
SYSTEM AT THE TOP OF THE LIST, CROSS OFF THAT STAR SYSTEM, THEN PUT
|
|
Karsten Hopp |
81c285 |
YOUR STAR SYSTEM AT THE BOTTOM OF THE LIST AND SEND IT TO 100 OTHER
|
|
Karsten Hopp |
81c285 |
STAR SYSTEMS. WITHIN ONE TENTH GALACTIC ROTATION YOU WILL RECEIVE
|
|
Karsten Hopp |
81c285 |
ENOUGH HYDROGREN TO POWER YOUR CIVILIZATION UNTIL ENTROPY REACHES ITS
|
|
Karsten Hopp |
81c285 |
MAXIMUM! IT REALLY WORKS!
|
|
Karsten Hopp |
81c285 |
|
|
Karsten Hopp |
81c285 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
81c285 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
81c285 |
\\\ download, build and distribute -- http://www.A-A-P.org ///
|
|
Karsten Hopp |
81c285 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|