Previous Next TOC Index Feedback

GUM v.1.0.0


SIOD: Scheme in One Defune, reference appendix

A

uthor George J Carret; Copyright 1996-1997

Reference Section for built-in procedures

Note that the arguments to built-in procedures are always optional and default to (). Many of these procedures call a C library function of the same orsimilar name, in the obvious way. Therefore you can refer to the unix manual page for more detailed information about function behavior. Such proceduresare indicated with a bold

U

.

(%%%memref address)

This is a lowlevel routine which should not be invoked in normal code. References a byte of memory at address. Used mostly to cause a core dump fordebugging purposes by referencing address 0 or -1.

(%%closure env code)

This is a lowlevel routine which should not be invoked in normal code. If code is a cons of the form (arlist . body) then env is a list of frames, and the application of the closure will invoke the interpreter. Otherwise code should be of type tc_subr_X and the application of the closure will pass the env as thefirst argument to the C procedure implementing the subr.

(%%closure-code closure)

This is a lowlevel routine which should not be invoked in normal code. Returns the code passed to %%closure.

(%%closure-env closure)

This is a lowlevel routine which should not be invoked in normal code. Returns the env passed to %%closure.

(%%stack-limit amount silent)

If amount is non-null it sets the runtime stack check pointer to allow for that number of bytes. If silent is non-null the resulting (or current) stack size is returned, otherwise a message is printed.

(* x1 x2 ...)

Returns the product of all its arguments, or 1 if no arguments.

*after-gc*

A variable, the value is an express evaluated after the gc has done its work. For example:

(set! *after-gc* '(if (< (gc-info 4) 5000) (allocate-heap)))

*args*

A variable, bound to the list of arguments passed to the main program siod.

(*catch tag body ...)

A special form. Tag is evaluated and kept in a special location while all the forms in the body are evaluated. Normally returns the value of the last form except if a *throw is encountered within the dynamic scope of the evaluations. Errors may be caught by using a tag of 'errorobj.

*env*

A variable, bound to the list of environment values passed to the main program siod.

*eval-history-ptr*

A variable, default (), but if set to a list (possibly circular) then each call to eval will cause the car of the list to receive a pointer to the form being evaluated,and then the variable will be set to the cdr of the list. Useful for writing a retrospective trace debugging capability.

*pi*

A variable, value 3.1416.

*plists*

A variable, internal to the implementation of get and putprop.

(*throw tag value)

Locates an active *catch for which the tag is identical and then forces the *catch form to return the value.

*traced*

A variable, value is a list of procedures that have been traced.

(+ x1 x2 ...)

Returns the sum of its arguments.

(- x1 x2 ...)

With one argument returns the negation, returns the difference of the first argument and the sum of the rest.

(/ x1 x2 ...)

With one argument returns the inverse, otherwise returns the quotiont of the first argument and the product of the rest.

(< x y)

Returns true if x is numerically less than y.

(<= x y)

Returns true if x is numerically less than or equal to y.

(= x y)

Returns true if x is numerically equal to y.

(> x y)

Returns true if x is numerically greater than y.

(>= x y)

Returns true if x is numerically greater than or equal to y.

(F_GETLK fd ltype whence start len)

The fd may be an integer or file. The function fcntl

(U)

is called on the file descriptor and an appropriate struct flock constructed from the ltype, whence,start and len arguments, and the lock operation F_GETLK. The ltype may be F_RDLCK,F_UNLCK, or F_WRLCK. Whence may be SEEK_CUR,

SEEK_END or SEEK_SET.

(F_SETLK fd ltype whence start len)

Same as F_GETLCK but with lock operation F_SETLK.

U

.

F_SETLKW fd ltype whence start len)

Same as F_GETLCK but with lock operation F_SETLKW.

U

. For a good example see the command script cp-build.

(abs x)

Returns the absolute numerical value of x.

(access-problem? filename method)

Invokes the access function

(U)

on the filename and flags created from the method string which should contain one or more of the characters "rwxf"returning non-null if there is a problem with accessing the file in that way. For example:

(if (access-problem? "x.y" "r") (error "can't read x.y"))

(acos x)

Returns the inverse cosine of x.

(alarm seconds flag)

Invokes the alarm function

(U)

. The handling of which will causes an error to be signaled in so many seconds. But if flag is false then the error will not be signaled if the alarm took place inside a system call or other critical code section.

(allocate-heap)

Attempts to allocate (call the C library malloc procedure) to obtain an additional heap. The size of the heap and the maximum number of heaps aredetermined at startup time. Returns non-null if successful.

(and form1 form2 form3 ...)

A special form which causes the evaluation of its subforms in order, from left to right, continuing if and only if the subform returns a non-null value.

(append l1 l2 l3 l4 ...)

Returns a list which the result of appending all of its arguments. Example:

(append '(a b) '(c d)) => (a b c d)
(apply function arglist)

Applies the function to the argument list arglist.

(apropos substring)

Returns a list of all symbols containing the given substring.

(aref array index)

Returns the element of the array at the given index.

(array->hexstr string)

Takes a string or byte array and returns a string in representing the values of the elements in hex.

(aset array index value)

Stores the value at the given index in the array.

(ash value bits)

Arithmetic shift of value a given number of bits to the left (positive) or right (negative).

(asin x)

Returns the inverse sin of x.

(ass key alist function)

Returns the first element of the alist such that the function applied to car of the element and the key returns a non-null value. For example:

(define (assq x alist) (ass x alist eq?))
(assoc key alist)

Same as (ass key alist equal?).

(assq key alist)

Same as (ass key alist eq?).

(assv key alist)

Same as (ass key alist eql?).

(atan x)

Returns the inverse tagent of x.

(atan2 x y)

Returns the inverse tagent of x/y.

(base64decode x)

Given a string X in base64 representation returns a string with bytes computed using the base64 decoding algorithm. See rfc1521.txt.

(base64encode x)

Returns a string computed using the base64 encoding algorithm.

(begin form1 form2 ...)

A special form which evaluates each of its subforms one after another, returning the value of the last subform.

(benchmark-eval nloops exp env)

A zero-overhead way of evaluating the exp n times.

(benchmark-funcall1 nloops f arg1)

A zero-overhead way of calling the function f n times on arg1.

(benchmark-funcall2 nloops f arg1 arg2)

A zero-overhead way of calling the function f n times on arg1 and arg2.

(bit-and x y)

Returns the bitwise logical "and" (C language & operator) of numerical arguments x and y.

(bit-not x)

Returns the bitwise logical complement (C language ~ operator) of numerical argument x.

(bit-or x y)

Returns the bitwise logical "or" (C language | operator) of numerical arguments x and y.

(bit-xor x y)

Returns the bitwise logical "xor" (C language ^ operator) of numerical arguments x and y.

(butlast x)

Returns a new list which has all the elements of the argument x except for the last element.

(bytes-append x1 x2 ...)

Returns a new byte array by appending its arguments which may be strings or byte arrays.

(caaar x)

Same as (car (car (car x))).

(caadr x)

Same as (car (car (cdr x))).

(caar x)

Same as (car (car x)).

(cadar x)

Same as (car (cdr (car x))).

(caddr x)

Same as (car (cdr (cdr x))).

(cadr x)

Same as (car (cdr x)).

(car x)

If x is the result of (cons a b) then (car x) is the same as a.

(cdaar x)

Same as (cdr (car (car x))).

(cdadr x)

Same as (cdr (car (cdr x))).

(cdar x)

Same as (cdr (car x)).

(cddar x)

Same as (cdr (cdr (car x))).

(cdddr x)

Same as (cdr (cdr (cdr x))).

(cddr x)

Same as (cdr (cdr x)).

(cdr x)

If x is the result of (cons a b) then (cdr x) is the same as b.

(chdir path)

Changes default directory to path.

U

.

(chmod path mode)

Changes the file mode of path.

U

. For example, to add execute access permission to the file f:

(chmod f
   (encode-file-mode (append '(XUSR XGRP XOTH)

      (cdr (assq 'mode (stat f))))))
(chown path uid gid)

Changes file ownership.

U

.

(closedir stream)

Closes a directory stream.

U

.

(cond clause1 clause2 ...)

A special form where each clause is processed until the predicate expression of the clause evaluates true. Then each subform in the predicate is evaluatedwith the uments x and y.

To use our new text box script in another script, we could write something like the following:

(set! theResult (script-fu-text-box "Some text" "Charter" "30" '(0 0 0) "35") )

(gimp-image-flatten (car theResult) )

Congratulations, my student, you are on your way to your Black Belt of Script-Fu!


Generated by fmtoweb (v. 2.9c) written by Peter G. Martin <peterm@zeta.org.au> Last modified: 20 May 1998

Previous Next TOC Index Feedback

usr/doc/gimp-manual/html/write_scriptfu_reference.html100644 0 0 163446 6550011726 21723 0ustar rootroot GUM v.1.0.0 Previous Next TOC Index Feedback

GUM v.1.0.0


SIOD: Scheme in One Defune, reference appendix

A

uthor George J Carret; Copyright 1996-1997

Reference Section for built-in procedures

Note that the arguments to built-in procedures are always optional and default to (). Many of these procedures call a C library function of the same orsimilar name, in the obvious way. Therefore you can refer to the unix manual page for more detailed information about function behavior. Such proceduresare indicated with a bold

U

.

(%%%memref address)

This is a lowlevel routine which should not be invoked in normal code. References a byte of memory at address. Used mostly to cause a core dump fordebugging purposes by referencing address 0 or -1.

(%%closure env code)

This is a lowlevel routine which should not be invoked in normal code. If code is a cons of the form (arlist . body) then env is a list of frames, and the application of the closure will invoke the interpreter. Otherwise code should be of type tc_subr_X and the application of the closure will pass the env as thefirst argument to the C procedure implementing the subr.

(%%closure-code closure)

This is a lowlevel routine which should not be invoked in normal code. Returns the code passed to %%closure.

(%%closure-env closure)

This is a lowlevel routine which should not be invoked in normal code. Returns the env passed to %%closure.

(%%stack-limit amount silent)

If amount is non-null it sets the runtime stack check pointer to allow for that number of bytes. If silent is non-null the resulting (or current) stack size is returned, otherwise a message is printed.

(* x1 x2 ...)

Returns the product of all its arguments, or 1 if no arguments.

*after-gc*

A variable, the value is an express evaluated after the gc has done its work. For example:

(set! *after-gc* '(if (< (gc-info 4) 5000) (allocate-heap)))

*args*

A variable, bound to the list of arguments passed to the main program siod.

(*catch tag body ...)

A special form. Tag is evaluated and kept in a special location while all the forms in the body are evaluated. Normally returns the value of the last form except if a *throw is encountered within the dynamic scope of the evaluations. Errors may be caught by using a tag of 'errorobj.

*env*

A variable, bound to the list of environment values passed to the main program siod.

*eval-history-ptr*

A variable, default (), but if set to a list (possibly circular) then each call to eval will cause the car of the list to receive a pointer to the form being evaluated,and then the variable will be set to the cdr of the list. Useful for writing a retrospective trace debugging capability.

*pi*

A variable, value 3.1416.

*plists*

A variable, internal to the implementation of get and putprop.

(*throw tag value)

Locates an active *catch for which the tag is identical and then forces the *catch form to return the value.

*traced*

A variable, value is a list of procedures that have been traced.

(+ x1 x2 ...)

Returns the sum of its arguments.

(- x1 x2 ...)

With one argument returns the negation, returns the difference of the first argument and the sum of the rest.

(/ x1 x2 ...)

With one argument returns the inverse, otherwise returns the quotiont of the first argument and the product of the rest.

(< x y)

Returns true if x is numerically less than y.

(<= x y)

Returns true if x is numerically less than or equal to y.

(= x y)

Returns true if x is numerically equal to y.

(> x y)

Returns true if x is numerically greater than y.

(>= x y)

Returns true if x is numerically greater than or equal to y.

(F_GETLK fd ltype whence start len)

The fd may be an integer or file. The function fcntl

(U)

is called on the file descriptor and an appropriate struct flock constructed from the ltype, whence,start and len arguments, and the lock operation F_GETLK. The ltype may be F_RDLCK,F_UNLCK, or F_WRLCK. Whence may be SEEK_CUR,

SEEK_END or SEEK_SET.

(F_SETLK fd ltype whence start len)

Same as F_GETLCK but with lock operation F_SETLK.

U

.

F_SETLKW fd ltype whence start len)

Same as F_GETLCK but with lock operation F_SETLKW.

U

. For a good example see the command script cp-build.

(abs x)

Returns the absolute numerical value of x.

(access-problem? filename method)

Invokes the access function

(U)

on the filename and flags created from the method string which should contain one or more of the characters "rwxf"returning non-null if there is a problem with accessing the file in that way. For example:

(if (access-problem? "x.y" "r") (error "can't read x.y"))

(acos x)

Returns the inverse cosine of x.

(alarm seconds flag)

Invokes the alarm function

(U)

. The handling of which will causes an error to be signaled in so many seconds. But if flag is false then the error will not be signaled if the alarm took place inside a system call or other critical code section.

(allocate-heap)

Attempts to allocate (call the C library malloc procedure) to obtain an additional heap. The size of the heap and the maximum number of heaps aredetermined at startup time. Returns non-null if successful.

(and form1 form2 form3 ...)

A special form which causes the evaluation of its subforms in order, from left to right, continuing if and only if the subform returns a non-null value.

(append l1 l2 l3 l4 ...)

Returns a list which the result of appending all of its arguments. Example:

(append '(a b) '(c d)) => (a b c d)
(apply function arglist)

Applies the function to the argument list arglist.

(apropos substring)

Returns a list of all symbols containing the given substring.

(aref array index)

Returns the element of the array at the given index.

(array->hexstr string)

Takes a string or byte array and returns a string in representing the values of the elements in hex.

(aset array index value)

Stores the value at the given index in the array.

(ash value bits)

Arithmetic shift of value a given number of bits to the left (positive) or right (negative).

(asin x)

Returns the inverse sin of x.

(ass key alist function)

Returns the first element of the alist such that the function applied to car of the element and the key returns a non-null value. For example:

(define (assq x alist) (ass x alist eq?))
(assoc key alist)

Same as (ass key alist equal?).

(assq key alist)

Same as (ass key alist eq?).

(assv key alist)

Same as (ass key alist eql?).

(atan x)

Returns the inverse tagent of x.

(atan2 x y)

Returns the inverse tagent of x/y.

(base64decode x)

Given a string X in base64 representation returns a string with bytes computed using the base64 decoding algorithm. See rfc1521.txt.

(base64encode x)

Returns a string computed using the base64 encoding algorithm.

(begin form1 form2 ...)

A special form which evaluates each of its subforms one after another, returning the value of the last subform.

(benchmark-eval nloops exp env)

A zero-overhead way of evaluating the exp n times.

(benchmark-funcall1 nloops f arg1)

A zero-overhead way of calling the function f n times on arg1.

(benchmark-funcall2 nloops f arg1 arg2)

A zero-overhead way of calling the function f n times on arg1 and arg2.

(bit-and x y)

Returns the bitwise logical "and" (C language & operator) of numerical arguments x and y.

(bit-not x)

Returns the bitwise logical complement (C language ~ operator) of numerical argument x.

(bit-or x y)

Returns the bitwise logical "or" (C language | operator) of numerical arguments x and y.

(bit-xor x y)

Returns the bitwise logical "xor" (C language ^ operator) of numerical arguments x and y.

(butlast x)

Returns a new list which has all the elements of the argument x except for the last element.

(bytes-append x1 x2 ...)

Returns a new byte array by appending its arguments which may be strings or byte arrays.

(caaar x)

Same as (car (car (car x))).

(caadr x)

Same as (car (car (cdr x))).

(caar x)

Same as (car (car x)).

(cadar x)

Same as (car (cdr (car x))).

(caddr x)

Same as (car (cdr (cdr x))).

(cadr x)

Same as (car (cdr x)).

(car x)

If x is the result of (cons a b) then (car x) is the same as a.

(cdaar x)

Same as (cdr (car (car x))).

(cdadr x)

Same as (cdr (car (cdr x))).

(cdar x)

Same as (cdr (car x)).

(cddar x)

Same as (cdr (cdr (car x))).

(cdddr x)

Same as (cdr (cdr (cdr x))).

(cddr x)

Same as (cdr (cdr x)).

(cdr x)

If x is the result of (cons a b) then (cdr x) is the same as b.

(chdir path)

Changes default directory to path.

U

.

(chmod path mode)

Changes the file mode of path.

U

. For example, to add execute access permission to the file f:

(chmod f
   (encode-file-mode (append '(XUSR XGRP XOTH)

      (cdr (assq 'mode (stat f))))))
(chown path uid gid)

Changes file ownership.

U

.

(closedir stream)

Closes a directory stream.

U

.

(cond clause1 clause2 ...)

A special form where each clause is processed until the predicate expression of the clause evaluates true. Then each subform in the predicate is evaluatedwith the uments x and y.

To use our new text box script in another script, we could write something like the following:

(set! theResult (script-fu-text-box "Some text" "Charter" "30" '(0 0 0) "35") )

(gimp-image-flatten (car theResult) )

Congratulations, my student, you are on your way to your Black Belt of Script-Fu!


Generated by fmtoweb (v. 2.9c) written by Peter G. Martin <peterm@zeta.org.au> Last modified: 20 May 1998

Previous Next TOC Index Feedback

usr/doc/gimp-manual/html/write_scriptfu_reference.html100644 0 0 163446 6550011726 21723 0ustar rootroot GUM v.1.0.0 Previous Next TOC Index Feedback

GUM v.1.0.0


SIOD: Scheme in One Defune, reference appendix

A

uthor George J Carret; Copyright 1996-1997

Reference Section for built-in procedures

Note that the arguments to built-in procedures are always optional and default to (). Many of these procedures call a C library function of the same orsimilar name, in the obvious way. Therefore you can refer to the unix manual page for more detailed information about function behavior. Such proceduresare indicated with a bold

U

.

(%%%memref address)

This is a lowlevel routine which should not be invoked in normal code. References a byte of memory at address. Used mostly to cause a core dump fordebugging purposes by referencing address 0 or -1.

(%%closure env code)

This is a lowlevel routine which should not be invoked in normal code. If code is a cons of the form (arlist . body) then env is a list of frames, and the application of the closure will invoke the interpreter. Otherwise code should be of type tc_subr_X and the application of the closure will pass the env as thefirst argument to the C procedure implementing the subr.

(%%closure-code closure)

This is a lowlevel routine which should not be invoked in normal code. Returns the code passed to %%closure.

(%%closure-env closure)

This is a lowlevel routine which should not be invoked in normal code. Returns the env passed to %%closure.

(%%stack-limit amount silent)

If amount is non-null it sets the runtime stack check pointer to allow for that number of bytes. If silent is non-null the resulting (or current) stack size is returned, otherwise a message is printed.

(* x1 x2 ...)

Returns the product of all its arguments, or 1 if no arguments.

*after-gc*

A variable, the value is an express evaluated after the gc has done its work. For example:

(set! *after-gc* '(if (< (gc-info 4) 5000) (allocate-heap)))

*args*

A variable, bound to the list of arguments passed to the main program siod.

(*catch tag body ...)

A special form. Tag is evaluated and kept in a special location while all the forms in the body are evaluated. Normally returns the value of the last form except if a *throw is encountered within the dynamic scope of the evaluations. Errors may be caught by using a tag of 'errorobj.

*env*

A variable, bound to the list of environment values passed to the main program siod.

*eval-history-ptr*

A variable, default (), but if set to a list (possibly circular) then each call to eval will cause the car of the list to receive a pointer to the form being evaluated,and then the variable will be set to the cdr of the list. Useful for writing a retrospective trace debugging capability.

*pi*

A variable, value 3.1416.

*plists*

A variable, internal to the implementation of get and putprop.

(*throw tag value)

Locates an active *catch for which the tag is identical and then forces the *catch form to return the value.

*traced*

A variable, value is a list of procedures that have been traced.

(+ x1 x2 ...)

Returns the sum of its arguments.

(- x1 x2 ...)

With one argument returns the negation, returns the difference of the first argument and the sum of the rest.

(/ x1 x2 ...)

With one argument returns the inverse, otherwise returns the quotiont of the first argument and the product of the rest.

(< x y)

Returns true if x is numerically less than y.

(<= x y)

Returns true if x is numerically less than or equal to y.

(= x y)

Returns true if x is numerically equal to y.

(> x y)

Returns true if x is numerically greater than y.

(>= x y)

Returns true if x is numerically greater than or equal to y.

(F_GETLK fd ltype whence start len)

The fd may be an integer or file. The function fcntl

(U)

is called on the file descriptor and an appropriate struct flock constructed from the ltype, whence,start and len arguments, and the lock operation F_GETLK. The ltype may be F_RDLCK,F_UNLCK, or F_WRLCK. Whence may be SEEK_CUR,

SEEK_END or SEEK_SET.

(F_SETLK fd ltype whence start len)

Same as F_GETLCK but with lock operation F_SETLK.

U

.

F_SETLKW fd ltype whence start len)

Same as F_GETLCK but with lock operation F_SETLKW.

U

. For a good example see the command script cp-build.

(abs x)

Returns the absolute numerical value of x.

(access-problem? filename method)

Invokes the access function

(U)

on the filename and flags created from the method string which should contain one or more of the characters "rwxf"returning non-null if there is a problem with accessing the file in that way. For example:

(if (access-problem? "x.y" "r") (error "can't read x.y"))

(acos x)

Returns the inverse cosine of x.

(alarm seconds flag)

Invokes the alarm function

(U)

. The handling of which will causes an error to be signaled in so many seconds. But if flag is false then the error will not be signaled if the alarm took place inside a system call or other critical code section.

(allocate-heap)

Attempts to allocate (call the C library malloc procedure) to obtain an additional heap. The size of the heap and the maximum number of heaps aredetermined at startup time. Returns non-null if successful.

(and form1 form2 form3 ...)

A special form which causes the evaluation of its subforms in order, from left to right, continuing if and only if the subform returns a non-null value.

(append l1 l2 l3 l4 ...)

Returns a list which the result of appending all of its arguments. Example:

(append '(a b) '(c d)) => (a b c d)
(apply function arglist)

Applies the function to the argument list arglist.

(apropos substring)

Returns a list of all symbols containing the given substring.

(aref array index)

Returns the element of the array at the given index.

(array->hexstr string)

Takes a string or byte array and returns a string in representing the values of the elements in hex.

(aset array index value)

Stores the value at the given index in the array.

(ash value bits)

Arithmetic shift of value a given number of bits to the left (positive) or right (negative).

(asin x)

Returns the inverse sin of x.

(ass key alist function)

Returns the first element of the alist such that the function applied to car of the element and the key returns a non-null value. For example:

(define (assq x alist) (ass x alist eq?))
(assoc key alist)

Same as (ass key alist equal?).

(assq key alist)

Same as (ass key alist eq?).

(assv key alist)

Same as (ass key alist eql?).

(atan x)

Returns the inverse tagent of x.

(atan2 x y)

Returns the inverse tagent of x/y.

(base64decode x)

Given a string X in base64 representation returns a string with bytes computed using the base64 decoding algorithm. See rfc1521.txt.

(base64encode x)

Returns a string computed using the base64 encoding algorithm.

(begin form1 form2 ...)

A special form which evaluates each of its subforms one after another, returning the value of the last subform.

(benchmark-eval nloops exp env)

A zero-overhead way of evaluating the exp n times.

(benchmark-funcall1 nloops f arg1)

A zero-overhead way of calling the function f n times on arg1.

(benchmark-funcall2 nloops f arg1 arg2)

A zero-overhead way of calling the function f n times on arg1 and arg2.

(bit-and x y)

Returns the bitwise logical "and" (C language & operator) of numerical arguments x and y.

(bit-not x)

Returns the bitwise logical complement (C language ~ operator) of numerical argument x.

(bit-or x y)

Returns the bitwise logical "or" (C language | operator) of numerical arguments x and y.

(bit-xor x y)

Returns the bitwise logical "xor" (C language ^ operator) of numerical arguments x and y.

(butlast x)

Returns a new list which has all the elements of the argument x except for the last element.

(bytes-append x1 x2 ...)

Returns a new byte array by appending its arguments which may be strings or byte arrays.

(caaar x)

Same as (car (car (car x))).

(caadr x)

Same as (car (car (cdr x))).

(caar x)

Same as (car (car x)).

(cadar x)

Same as (car (cdr (car x))).

(caddr x)

Same as (car (cdr (cdr x))).

(cadr x)

Same as (car (cdr x)).

(car x)

If x is the result of (cons a b) then (car x) is the same as a.

(cdaar x)

Same as (cdr (car (car x))).

(cdadr x)

Same as (cdr (car (cdr x))).

(cdar x)

Same as (cdr (car x)).

(cddar x)

Same as (cdr (cdr (car x))).

(cdddr x)

Same as (cdr (cdr (cdr x))).

(cddr x)

Same as (cdr (cdr x)).

(cdr x)

If x is the result of (cons a b) then (cdr x) is the same as b.

(chdir path)

Changes default directory to path.

U

.

(chmod path mode)

Changes the file mode of path.

U

. For example, to add execute access permission to the file f:

(chmod f
   (encode-file-mode (append '(XUSR XGRP XOTH)

      (cdr (assq 'mode (stat f))))))
(chown path uid gid)

Changes file ownership.

U

.

(closedir stream)

Closes a directory stream.

U

.

(cond clause1 clause2 ...)

A special form where each clause is processed until the predicate expression of the clause evaluates true. Then each subform in the predicate is evaluatedwith the uments x and y.

To use our new text box script in another script, we could write something like the following:

(set! theResult (script-fu-text-box "Some text" "Charter" "30" '(0 0 0) "35") )

(gimp-image-flatten (car theResult) )

Congratulations, my student, you are on your way to your Black Belt of Script-Fu!


Generated by fmtoweb (v. 2.9c) written by Peter G. Martin <peterm@zeta.org.au> Last modified: 20 May 1998

Previous Next TOC Index Feedback

usr/doc/gimp-manual/html/write_scriptfu_reference.html100644 0 0 163446 6550011726 21723 0ustar rootroot GUM v.1.0.0 Previous Next TOC Index Feedback

GUM v.1.0.0


SIOD: Scheme in One Defune, reference appendix

A

uthor George J Carret; Copyright 1996-1997

Reference Section for built-in procedures

Note that the arguments to built-in procedures are always optional and default to (). Many of these procedures call a C library function of the same orsimilar name, in the obvious way. Therefore you can refer to the unix manual page for more detailed information about function behavior. Such proceduresare indicated with a bold

U

.

(%%%memref address)

This is a lowlevel routine which should not be invoked in normal code. References a byte of memory at address. Used mostly to cause a core dump fordebugging purposes by referencing address 0 or -1.

(%%closure env code)

This is a lowlevel routine which should not be invoked in normal code. If code is a cons of the form (arlist . body) then env is a list of frames, and the application of the closure will invoke the interpreter. Otherwise code should be of type tc_subr_X and the application of the closure will pass the env as thefirst argument to the C procedure implementing the subr.

(%%closure-code closure)

This is a lowlevel routine which should not be invoked in normal code. Returns the code passed to %%closure.

(%%closure-env closure)

This is a lowlevel routine which should not be invoked in normal code. Returns the env passed to %%closure.

(%%stack-limit amount silent)

If amount is non-null it sets the runtime stack check pointer to allow for that number of bytes. If silent is non-null the resulting (or current) stack size is returned, otherwise a message is printed.

(* x1 x2 ...)

Returns the product of all its arguments, or 1 if no arguments.

*after-gc*

A variable, the value is an express evaluated after the gc has done its work. For example:

(set! *after-gc* '(if (< (gc-info 4) 5000) (allocate-heap)))

*args*

A variable, bound to the list of arguments passed to the main program siod.

(*catch tag body ...)

A special form. Tag is evaluated and kept in a special location while all the forms in the body are evaluated. Normally returns the value of the last form except if a *throw is encountered within the dynamic scope of the evaluations. Errors may be caught by using a tag of 'errorobj.

*env*

A variable, bound to the list of environment values passed to the main program siod.

*eval-history-ptr*

A variable, default (), but if set to a list (possibly circular) then each call to eval will cause the car of the list to receive a pointer to the form being evaluated,and then the variable will be set to the cdr of the list. Useful for writing a retrospective trace debugging capability.

*pi*

A variable, value 3.1416.

*plists*

A variable, internal to the implementation of get and putprop.

(*throw tag value)

Locates an active *catch for which the tag is identical and then forces the *catch form to return the value.

*traced*

A variable, value is a list of procedures that have been traced.

(+ x1 x2 ...)

Returns the sum of its arguments.

(- x1 x2 ...)

With one argument returns the negation, returns the difference of the first argument and the sum of the rest.

(/ x1 x2 ...)

With one argument returns the inverse, otherwise returns the quotiont of the first argument and the product of the rest.

(< x y)

Returns true if x is numerically less than y.

(<= x y)

Returns true if x is numerically less than or equal to y.

(= x y)

Returns true if x is numerically equal to y.

(> x y)

Returns true if x is numerically greater than y.

(>= x y)

Returns true if x is numerically greater than or equal to y.

(F_GETLK fd ltype whence start len)

The fd may be an integer or file. The function fcntl

(U)

is called on the file descriptor and an appropriate struct flock constructed from the ltype, whence,start and len arguments, and the lock operation F_GETLK. The ltype may be F_RDLCK,F_UNLCK, or F_WRLCK. Whence may be SEEK_CUR,

SEEK_END or SEEK_SET.

(F_SETLK fd ltype whence start len)

Same as F_GETLCK but with lock operation F_SETLK.

U

.

F_SETLKW fd ltype whence start len)

Same as F_GETLCK but with lock operation F_SETLKW.

U

. For a good example see the command script cp-build.

(abs x)

Returns the absolute numerical value of x.

(access-problem? filename method)

Invokes the access function

(U)

on the filename and flags created from the method string which should contain one or more of the characters "rwxf"returning non-null if there is a problem with accessing the file in that way. For example:

(if (access-problem? "x.y" "r") (error "can't read x.y"))

(acos x)

Returns the inverse cosine of x.

(alarm seconds flag)

Invokes the alarm function

(U)

. The handling of which will causes an error to be signaled in so many seconds. But if flag is false then the error will not be signaled if the alarm took place inside a system call or other critical code section.

(allocate-heap)

Attempts to allocate (call the C library malloc procedure) to obtain an additional heap. The size of the heap and the maximum number of heaps aredetermined at startup time. Returns non-null if successful.

(and form1 form2 form3 ...)

A special form which causes the evaluation of its subforms in order, from left to right, continuing if and only if the subform returns a non-null value.

(append l1 l2 l3 l4 ...)

Returns a list which the result of appending all of its arguments. Example:

(append '(a b) '(c d)) => (a b c d)
(apply function arglist)

Applies the function to the argument list arglist.

(apropos substring)

Returns a list of all symbols containing the given substring.

(aref array index)

Returns the element of the array at the given index.

(array->hexstr string)

Takes a string or byte array and returns a string in representing the values of the elements in hex.

(aset array index value)

Stores the value at the given index in the array.

(ash value bits)

Arithmetic shift of value a given number of bits to the left (positive) or right (negative).

(asin x)

Returns the inverse sin of x.

(ass key alist function)

Returns the first element of the alist such that the function applied to car of the element and the key returns a non-null value. For example:

(define (assq x alist) (ass x alist eq?))
(assoc key alist)

Same as (ass key alist equal?).

(assq key alist)

Same as (ass key alist eq?).

(assv key alist)

Same as (as