(define (script-fu-gimp-register code) (let* ((len (string-length code)) (code-array (hexstr->bytes code)) (control-str (array->hexstr code-array))) (if (not (test-for-registration)) (if (and (< 0 len) (= 0 (strcmp control-str code))) (begin (gimp-parasite-attach (list "registration-code" 1 code-array)) (gimp-message "Your registration was successful.") ) (gimp-message "Wrong registration code!")) (gimp-message "You already registered.") ) ) ) (define (test-for-registration) (let* ((parasites (gimp-parasite-list)) (len (- (car parasites) 1)) (parasite-list (cadr parasites)) (found #f)) (while (and (not found) (<= 0 len)) (begin (if (= 0 (strcmp (nth len parasite-list) "registration-code")) (set! found #t)) (set! len (- len 1)))) found ) ) (if (not (test-for-registration)) (script-fu-register "script-fu-gimp-register" _"/Xtns/Register" "Enables the unrestricted Version of the GIMP" "Simon Budig " "Simon Budig" "2004/1/7" "*" SF-STRING "Registration Code" "") )