2000.06.12
author: Geoffrey M.
(c) 1999-2000
Ultratech Creations
wildfireZ is a trademark of Ultratech Creations
website: www.UltratechCreations.com
Distributed under
the terms of the GNU Lesser General Public License.
See copyleft.txt for details.
Custom data types
packed
booleans
If you have ever
worked with flags, you ar familiar with packed booleans. Instead
of using 8, 16, or 32 bits to represent a single boolean value,
each bit stores a boolean state. The number of booleans is equal
to the integer's width. Example: a byte (8-bits) contains 8
booleans. Accessing an individual boolean value is the same as
reading/writing a bit. Boolean location numbers also correspond
to bit location numbers, i.e. bit 12 = boolean #12. Remember,
bits are numbered from RIGHT to LEFT regardless of processor
architecture. A packedboolean8 is below.
bit location | bit 7 | bit 6 | bit 5 | bit 4 | bit 3 | bit 2 | bit 1 | bit 0 |
boolean value location | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
HiresDateTime
Hires_datetime is a
custom data type that encodes extra info about a user's
time zone, the day of week, and has a time resolution of 2.328
picoseconds. Length is 12 bytes with the following bit
assignments:
hires clock tick has a resolution of 2.328 picoseconds. Resolution must always be faster than the time to write a file to storage media. Otherwise, files can have identical timestamps.
bits 95 - 64 |
hires clock tick (32 bytes) |
bits 63 - 53 | 52 - 41 | 40 - 37 | 36 - 32 |
reserved (11 bytes) |
year (12 bits) |
month (4 bits) |
day (5 bits) |
bits 31 - 27 | 26 - 21 | 20 - 17 | 16 - 12 | 11 - 06 | 05 - 00 |
IDLOffset (5 bits) |
IDL Minutes Offset (6 bits) |
day of week (4 bits) |
hour (5 bits) |
minutes (6 bits) |
seconds (6 bits) |
All values are literal values for the current date/time. Dates are based on the Gregorian calendar. Valid ranges are:
value | range |
year | 1980 - 4095 |
month | 1 - 12 |
day | 1 - 31 |
IDLOffset | 0 - 24 |
IDLMinutesOffset | 0 - 59 |
day of week | 1 - 7 |
hour | 0 - 23 |
minutes | 0 - 59 |
seconds | 0 - 59 |
tick | 0 - 4294967296 |
day of week starts on sunday( = 1 ) and ends on saturday( = 7 ).
day of week | value |
sunday | 1 |
monday | 2 |
tuesday | 3 |
wednesday | 4 |
thursday | 5 |
friday | 6 |
saturday | 7 |
time zone is based on International Date Line time. Functions for converting from GMT to/from IDL are included in the kernel.
|
|
|