#!/bin/sh #| -*- Scheme -*- if test x"$CSC" == x""; then CSC=csc fi exec $CSC -X easyffi $0 -t -c++ -o tests -debug F |# (use tinyclos) ;;================================================================================ #>? class ScmStkFrames : public StkFrames { public: ScmStkFrames( unsigned int nFrames, unsigned int nChannels, bool interleaved ) : StkFrames(nFrames, nChannels, interleaved) {} }; <# ;;================================================================================ #>! struct My_struct { int x; ___mutable float y; }; typedef struct My_struct My_struct; My_struct *make_struct(int x, float y) { My_struct *s = (My_struct *)malloc(sizeof(My_struct)); s->x = x; s->y = y; return s; } <# (define s (make_struct 3 4)) (set! (My_struct-y s) 99) (pp (list (My_struct-x s) (My_struct-y s))) ;;================================================================================ ;; Test number pattern #>? #define GLU_TESS_MAX_COORD 1.0e+150 #define X1_1 1.0e+150 #define X1_2 -1.0e+150 #define X1_3 -1.0e-150 #define X1_4 1.0E+150 #define X1_5 -1.0E+150 #define X1_6 -1.0E-150 #define X2_1 1.e150 #define X2_2 -1.e150 #define X2_3 -1.e-150 #define X2_4 1E+150 #define X2_5 -1e+150 #define X2_6 -1E-150 #define X3_1 1 #define X3_2 12 #define X3_3 -1 #define X3_4 -12 #define X4_1 1. #define X4_2 12. #define X4_3 -1. #define X4_4 -12. #define X5_1 1.0 #define X5_2 12.0 #define X5_3 -1.0 #define X5_4 -12.0 <# ;;================================================================================ ;; Test '.' operator #>! static ___bool getlimit(int limit, ___bool hard, ___out long *result) { struct rlimit limits; rlim_t r; getrlimit(limit, &limits); if(hard) r = limits.rlim_max; else r = limits.rlim_cur; if(r == RLIM_INFINITY) return 0; else { *result = r; return 1; } } static ___bool setlimit(int limit, ___bool hard, long value, ___bool inf) { struct rlimit limits; getrlimit(limit, &limits); if(hard) limits.rlim_max = inf ? RLIM_INFINITY : (rlim_t)value; else limits.rlim_cur = inf ? RLIM_INFINITY : (rlim_t)value; return setrlimit(limit, &limits) == 0; } <#