Category | Native procedure | ||||||||||||||||||
Format | (battery-info) | ||||||||||||||||||
Parameters | none | ||||||||||||||||||
Description | battery-info returns detailed information about the
Palm's battery status as a list of seven items:
|
||||||||||||||||||
R4RS Compliance | LispMe extension | ||||||||||||||||||
Examples |
|
Category | Special form | |||
Format | (begin expr1 expr2 ...) | |||
Parameters |
|
|||
Description | begin evaluates each expri in sequence
from left to right. The value of the last
expri is returned. A second use of begin is to group mutually recursive define expressions entered into the command line. | |||
R4RS Compliance | Full | |||
Examples |
|
Category | Primitive procedure | |||||||||||||||
Format | (bit-and ni ...) | |||||||||||||||
Parameters |
|
|||||||||||||||
Description | bit-and ands the bit pattern of any number of
integer numbers. The arguments are interpreted as
2's complement signed binary integers.
The truth table for this operation is
|
|||||||||||||||
R4RS Compliance | LispMe extension | |||||||||||||||
Examples |
|
Category | Primitive procedure | |||||||||
Format | (bit-not n) | |||||||||
Parameters |
|
|||||||||
Description | bit-not inverts every bit in its argument. The
argument is interpreted a signed binary integer.
The truth table for this operation is
|
|||||||||
R4RS Compliance | LispMe extension | |||||||||
Examples |
|
Category | Primitive procedure | |||||||||||||||
Format | (bit-or ni ...) | |||||||||||||||
Parameters |
|
|||||||||||||||
Description | bit-or inclusively ors the bit pattern of any number of
integer numbers. The arguments are interpreted as
2'complement signed binary integers. The truth table for this operation is
|
|||||||||||||||
R4RS Compliance | LispMe extension | |||||||||||||||
Examples |
|
Category | Primitive procedure | ||||||||||||
Format | (bit-shift n k) | ||||||||||||
Parameters |
|
||||||||||||
Description | bit-shift shifts n by
k bits to the left (if k is
positive) or to the right (if k is negative).
All shifts are signed, i.e. they preserve the most significant
bit in the standard two's-complement representation of integers.
|
||||||||||||
R4RS Compliance | LispMe extension | ||||||||||||
Examples |
|
Category | Primitive procedure | |||||||||||||||
Format | (bit-xor ni ...) | |||||||||||||||
Parameters |
|
|||||||||||||||
Description | bit-xor exclusively ors the bit pattern of any number of
integer numbers. The arguments are interpreted as 2's complement
signed binary integers. The truth table for this operation is
|
|||||||||||||||
R4RS Compliance | LispMe extension | |||||||||||||||
Examples |
|
Category | Native procedure | |||
Format | (bitmap bmap) | |||
Parameters |
|
|||
Description | bitmap draws a bitmap at the current point stored in
*gstate* extending
to the right and the bottom. The current point is not changed.
The return value is #n to
avoid trashing the graphics. See here for details on the graphic state. The string describing the bitmap uses the standard Pilot bitmap format adn supports colored and multiple bitmaps (OS 3.5), It's exactly the format stored in a bitmap resource (ResType Tbmp). This format corresponds to this C structure definition (from the 3.5 header Core/System/Bitmap.h) typedef struct BitmapFlagsType { UInt16 compressed:1; // Data format: 0=raw; 1=compressed UInt16 hasColorTable:1; // if true, color table stored before bits[] UInt16 hasTransparency:1; // true if transparency is used UInt16 indirect:1; // true if bits are stored indirectly UInt16 forScreen:1; // system use only UInt16 reserved:11; } BitmapFlagsType; typedef struct BitmapType { Int16 width; Int16 height; UInt16 rowBytes; BitmapFlagsType flags; UInt8 pixelSize; // bits/pixel UInt8 version; // version of bitmap. This is vers 2 UInt16 nextDepthOffset; // # of DWords to next BitmapType // from beginnning of this one UInt8 transparentIndex; // v2 only, if flags.hasTransparency is true, // index number of transparent color UInt8 compressionType; // v2 only, if flags.compressed is true, this is // the type, see BitmapCompressionType UInt16 reserved; // for future use, must be zero! // [colorTableType] pixels | pixels* // If hasColorTable != 0, we have: // ColorTableType followed by pixels. // If hasColorTable == 0: // this is the start of the pixels // if indirect != 0 bits are stored indirectly. // the address of bits is stored here // In some cases the ColorTableType will // have 0 entries and be 2 bytes long. } BitmapType;Caution: The Pilot API is very sensitive to the right initialization of these fields, especially that rowBytes must be even. Though LispMe checks some of these conditions, an invalid bitmap can cause a Fatal exception, so you should stick to bitmaps read from resources and be careful when assembling bitmaps on the fly. You can retrieve the width and height of a bitmap with (define (width bitmap) (+ (* 256 (char->integer (string-ref bitmap 0))) (char->integer (string-ref bitmap 1)))) (define (height bitmap) (+ (* 256 (char->integer (string-ref bitmap 2))) (char->integer (string-ref bitmap 3))))As most bitmaps are smaller than 256 pixels, you can ignore the high-order byte: (define (width bitmap) (char->integer (string-ref bitmap 1))) (define (height bitmap) (char->integer (string-ref bitmap 3))) |
|||
R4RS Compliance | LispMe extension | |||
Examples |
|
Category | Primitive procedure | ||||||||||||
Format | (boolean? obj) | ||||||||||||
Parameters |
|
||||||||||||
Description | boolean? returns #t for the boolean values #t and #f and returns #f for any other object. Remember that in LispMe () and #f are distinct objects. | ||||||||||||
R4RS Compliance | Full | ||||||||||||
Examples |
|
Category | Native procedure | ||||
Format | (buf-get-cstr buf offset) | ||||
Parameters |
|
||||
Description | buf-get-cstr starts reading bytes from the string buf starting at offset offset until a NUL byte is encountered. All characters read (without the NUL terminator) are returned as a string. | ||||
R4RS Compliance | LispMe extension | ||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-get-date buf offset) | ||||||
Parameters |
|
||||||
Description | buf-get-date reads 2 bytes from the string buf starting at offset offset and interprets them as a PalmOS date which is returned as a LispMe date (foreign type). | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||
Format | (buf-get-f32 buf offset) | ||||
Parameters |
|
||||
Description | buf-get-f32 reads 4 bytes from the string buf starting at offset offset and interprets them as a 32 bit IEEE-754 single precision floating point real. Since all floating point calculation in LispMe is done in double precision, the result is extended accordingly. | ||||
R4RS Compliance | LispMe extension | ||||
Examples |
|
Category | Native procedure | ||||
Format | (buf-get-f64 buf offset) | ||||
Parameters |
|
||||
Description | buf-get-f64 reads 8 bytes from the string buf starting at offset offset and interprets them as a 64 bit IEEE-754 double precision floating point real which is returned. | ||||
R4RS Compliance | LispMe extension | ||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-get-s16 buf offset) | ||||||
Parameters |
|
||||||
Description | buf-get-s16 reads 2 bytes from the string buf starting at offset offset and interprets them as a signed 16 bit integer (big endian) which is returned. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-get-s32 buf offset) | ||||||
Parameters |
|
||||||
Description | buf-get-s32 reads 4 bytes from the string buf starting at offset offset and interprets them as a signed 32 bit integer (big endian) which is returned. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-get-s8 buf offset) | ||||||
Parameters |
|
||||||
Description | buf-get-s8 reads 1 byte from the string buf from offset offset and interprets it as a signed 8 bit integer which is returned. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-get-time buf offset) | ||||||
Parameters |
|
||||||
Description | buf-get-time reads 2 bytes from the string buf starting at offset offset and interprets them as a PalmOS time which is returned as a LispMe time (foreign type). | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-get-ts buf offset) | ||||||
Parameters |
|
||||||
Description | buf-get-ts reads 4 bytes from the string buf starting at offset offset and interprets them as a PalmOS timestamp which is returned as a LispMe timestamp (foreign type). | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-get-u16 buf offset) | ||||||
Parameters |
|
||||||
Description | buf-get-u16 reads 2 bytes from the string buf starting at offset offset and interprets them as an unsigned 16 bit integer (big endian) which is returned. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-get-u32 buf offset) | ||||||
Parameters |
|
||||||
Description | buf-get-u32 reads 4 bytes from the string buf starting at offset offset and interprets them as an unsigned 32 bit integer (big endian) which is returned. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-get-u8 buf offset) | ||||||
Parameters |
|
||||||
Description | buf-get-u8 reads 1 byte from the string buf from offset offset and interprets it as an unsigned 8 bit integer which is returned. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-set-cstr! buf offset str) | ||||||
Parameters |
|
||||||
Description | buf-set-cstr! writes the string str to the string buf starting at offset offset. A terminating NUL byte is written, too. The return value is the modified buffer. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-set-date! buf offset date) | ||||||
Parameters |
|
||||||
Description | buf-set-date! converts date to a PalmOS date and writes its 2 bytes to the string buf starting at offset offset. The return value is the modified buffer. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-set-f32! buf offset real) | ||||||
Parameters |
|
||||||
Description | buf-set-f32! converts real to a 32 bit IEEE-754 floating point value and writes its 4 bytes to the string buf starting at offset offset. The return value is the modified buffer. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-set-f64! buf offset real) | ||||||
Parameters |
|
||||||
Description | buf-set-f64! converts real to a 64 bit IEEE-754 floating point value and writes its 8 bytes to the string buf starting at offset offset. The return value is the modified buffer. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-set-s16! buf offset int16) | ||||||
Parameters |
|
||||||
Description | buf-set-s16! converts int16 to a signed 16 bit binary integer and writes its 2 bytes to the string buf starting at offset offset. The return value is the modified buffer. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-set-s32! buf offset int32) | ||||||
Parameters |
|
||||||
Description | buf-set-s32! converts int32 to a signed 32 bit binary integer and writes its 4 bytes to the string buf starting at offset offset. The return value is the modified buffer. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-set-s8! buf offset int8) | ||||||
Parameters |
|
||||||
Description | buf-set-s8! converts int8 to a signed 8 bit binary integer and writes the byte to the string buf at offset offset. The return value is the modified buffer. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-set-time! buf offset time) | ||||||
Parameters |
|
||||||
Description | buf-set-time! converts time to a PalmOS time and writes its 2 bytes to the string buf starting at offset offset. The return value is the modified buffer. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-set-ts! buf offset ts) | ||||||
Parameters |
|
||||||
Description | buf-set-ts! converts ts to a PalmOS timestamp and writes its 4 bytes to the string buf starting at offset offset. The return value is the modified buffer. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-set-u16! buf offset uint16) | ||||||
Parameters |
|
||||||
Description | buf-set-u16! converts uint16 to an unsigned 16 bit binary integer and writes its 2 bytes to the string buf starting at offset offset. The return value is the modified buffer. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-set-u32! buf offset uint32) | ||||||
Parameters |
|
||||||
Description | buf-set-u32! converts uint32 to an unsigned 32 bit binary integer and writes its 4 bytes to the string buf starting at offset offset. The return value is the modified buffer. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Category | Native procedure | ||||||
Format | (buf-set-u8! buf offset uint8) | ||||||
Parameters |
|
||||||
Description | buf-set-u8! converts uint8 to an unsigned 8 bit binary integer and writes the byte to the string buf at offset offset. The return value is the modified buffer. | ||||||
R4RS Compliance | LispMe extension | ||||||
Examples |
|
Back to index A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Other