Changeset 3163 in project


Ignore:
Timestamp:
02/27/07 17:30:42 (14 years ago)
Author:
Tony Sidaway
Message:

Add more functions, and make others more Scheme-like.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • slang/trunk/slang.scm

    r3150 r3163  
    3333(define-macro (defvalue name type)
    3434  `(define ,name (foreign-value ,(->string name) ,type)))
     35
     36(defvalue SLSMG_HLINE_CHAR int)
     37(defvalue SLSMG_VLINE_CHAR int)
     38(defvalue SLSMG_ULCORN_CHAR int)
     39(defvalue SLSMG_URCORN_CHAR int)
     40(defvalue SLSMG_LLCORN_CHAR int)
     41(defvalue SLSMG_LRCORN_CHAR int)
     42(defvalue SLSMG_RTEE_CHAR int)
     43(defvalue SLSMG_LTEE_CHAR int)
     44(defvalue SLSMG_UTEE_CHAR int)
     45(defvalue SLSMG_DTEE_CHAR int)
     46(defvalue SLSMG_PLUS_CHAR int)
     47(defvalue SLSMG_CKBRD_CHAR int)
     48(defvalue SLSMG_DIAMOND_CHAR int)
     49(defvalue SLSMG_DEGREE_CHAR int)
     50(defvalue SLSMG_PLMINUS_CHAR int)
     51(defvalue SLSMG_BULLET_CHAR int)
     52(defvalue SLSMG_LARROW_CHAR int)
     53(defvalue SLSMG_RARROW_CHAR int)
     54(defvalue SLSMG_DARROW_CHAR int)
     55(defvalue SLSMG_UARROW_CHAR int)
     56(defvalue SLSMG_BOARD_CHAR int)
     57(defvalue SLSMG_BLOCK_CHAR int)
     58
    3559
    3660(deferr SL_Any_Error)
     
    131155(def int SLinterp_utf8_enable int)
    132156(def int SLinterp_is_utf8_mode)
     157(def int SLutf8_is_utf8_mode)
    133158
    134159; Interpreter
     
    214239(def void SLsmg_gotorc int int)
    215240
     241; Some slang functions use C pointers instead of value arguments and we approach this by producing a
     242; wrapping of the original C function under NAME_c, and then we produce a wrapper than conceals all
     243; the pointy stuff and presents a nicer, cleaner interface that uses value arguments.
    216244(defc void SLsmg_set_screen_start c-pointer c-pointer)
    217245(define (SLsmg_set_screen_start row col)
    218246#>
    219 int screen_start_row;
    220 int *p_screen_start_row = &screen_start_row;
    221 int screen_start_col;
    222 int *p_screen_start_col = &screen_start_col;
     247static int screen_start_row;
     248static int *p_screen_start_row = &screen_start_row;
     249static int screen_start_col;
     250static int *p_screen_start_col = &screen_start_col;
    223251<#
    224252  (define-foreign-variable screen_start_row int "screen_start_row")
     
    278306(define (SLrline_read_line rline prompt)
    279307#>
    280 static int n;
    281 static int *p=&n;
    282 <#
    283   (define-foreign-variable p c-pointer "p")
    284   (SLrline_read_line_c rline prompt p))
     308static int n_readline;
     309static int *p_n_readline=&n_readline;
     310<#
     311  (define-foreign-variable p_n_readline c-pointer "p_n_readline")
     312  (SLrline_read_line_c rline prompt p_n_readline))
    285313   
    286314
     
    412440(def int SLscroll_pagedown c-pointer)
    413441(def void SLtt_beep)
     442(def int SLtt_set_mouse_mode int int)
     443(def void SLsmg_write_wrapped_string c-string int int unsigned-int unsigned-int int)
     444(def void SLsmg_set_color_in_region int int int unsigned-int unsigned-int)
     445
Note: See TracChangeset for help on using the changeset viewer.