Changeset 26855 in project


Ignore:
Timestamp:
06/07/12 04:03:04 (9 years ago)
Author:
Ivan Raikov
Message:

ploticus: added procdebug parameter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/ploticus/trunk/ploticus.scm

    r26803 r26855  
    5151(define procdebug (make-parameter #f))
    5252
     53
    5354(define cinit (foreign-lambda int "ploticus_init" nonnull-c-string nonnull-c-string))
     55
    5456
    5557(define (init devicesym pathname)
     
    6163    (cinit device pathname)))
    6264
     65
    6366(define carg (foreign-lambda int "ploticus_arg" nonnull-c-string nonnull-c-string))
     67
    6468
    6569(define (arg name . rest)
    6670  (let-optionals rest ((value ""))
    6771                 (carg name value)))
     72
    6873
    6974(define execline (foreign-lambda int "ploticus_execline" nonnull-c-string))
     
    7277(define cexecscript (foreign-lambda int "ploticus_execscript" nonnull-c-string int))
    7378
     79
    7480(define (execscript filename)
    7581  (cexecscript filename 0))
    7682
     83
    7784(define (execprefab prefab)
    7885  (cexecscript prefab 1))
     86
    7987
    8088(define end (foreign-lambda int "ploticus_end" ))
     
    9098))                               
    9199
     100
    92101(define (getvar name)
    93102  (let ((value (make-string 257)))
     
    96105           (if end (substring value 0 end) value)))))
    97106
     107
    98108(define setvar (foreign-lambda int "ploticus_setvar" nonnull-c-string nonnull-c-string))
    99109
    100110
    101111(define (proc name fields)
    102   (assert (zero? (execline (string-append "#proc " (->string name)))))
    103   (for-each (lambda (x)
    104               (if (pair? (cdr x))
    105                   (let ((line (string-append (car x) ": " (->string (cadr x)))))
    106                     (if (procdebug) (print line))
    107                     (assert (zero? (execline line)))
    108                     (if (procdebug)
    109                         (for-each (lambda (ln) (print ln) (assert (zero? (execline ln)))) (cddr x))
    110                         (for-each (lambda (ln) (assert (zero? (execline ln)))) (cddr x)))
    111                     )
    112                   (let ((line (string-append (car x) ": " (->string (cdr x)))))
    113                     (if (procdebug) (print line))
    114                     (assert (zero? (execline line))))))
    115             fields)
    116   (execline "#endproc"))
     112  (assert (zero? (execline (string-append "#proc " (->string name) ))))
     113  (for-each
     114   (lambda (x)
     115     (if (pair? (cdr x))
     116         (let ((line (string-append (car x) ": " (->string (cadr x)))))
     117           (if (procdebug) (print line))
     118           (assert (zero? (execline line)))
     119           (if (procdebug)
     120               (for-each (lambda (ln) (print ln) (assert (zero? (execline ln)))) (cddr x))
     121               (for-each (lambda (ln) (assert (zero? (execline ln)))) (cddr x)))
     122           )
     123         (let ((line (string-append (car x) ": " (->string (cdr x)))))
     124           (if (procdebug) (print line))
     125           (assert (zero? (execline line)))
     126           )))
     127   fields)
     128  (execline "#endproc")
     129  (execline "")
     130  )
    117131
    118132
Note: See TracChangeset for help on using the changeset viewer.