hpobjects.h

Go to the documentation of this file.
00001 // Header file for HpObjects
00009 
00010 #ifndef OBJECTS_H
00011 #define OBJECTS_H
00012 
00013 #include <stdarg.h>
00014 
00016 typedef unsigned int SatAddr;           /* saturn address */
00017 
00018 #define bool int
00019 #define false 0
00020 #define true 1
00021 
00022 #define SAT_DOXLIB  0x02e92     /* not sure why this isn't in saturn.h */
00023 #define SAT_DOMINIFONT 0x026FE  /* Mini font */
00024 #define SAT_DOFONT SAT_DOEXT2   /* Font prolog */
00025 
00026 #define SAT_PRLG 0x28FC         /* common prolog */
00027 
00028 // The definition for SAT_DOLNKARRY in saturn.h wrongly shows
00029 // it as the same as SAT_DOARRY
00030 #ifdef SAT_DOLNKARRY
00031 #undef SAT_DOLNKARRY
00032 #define SAT_DOLNKARRY 0x2A0A
00033 #endif
00034 
00039 // BINT routines
00040 //
00041 
00045 bool isBINT(SatAddr src);
00046 
00051 bool BINTdecode(SatAddr src, int *dst);
00052 
00057 SatAddr BINTencode(int src, SatAddr dst);
00058 
00060 SatAddr makeBINT();
00061 
00066 #define BINTnibbles(src) (10)
00067 
00069 
00074 
00079 bool isCHAR(SatAddr src);
00080 
00085 bool CHARdecode(SatAddr src, char *dst);
00086 
00091 SatAddr CHARencode(unsigned char ch, SatAddr dst);
00092 
00094 SatAddr makeCHAR();
00095 
00100 #define CHARnibbles(src) (7)
00102 
00108 
00112 bool isREAL(SatAddr src);
00113 
00121 bool REALdecode(SatAddr src, double *dst);
00122 
00127 SatAddr REALencode(double d, SatAddr dst);
00128 
00130 SatAddr makeREAL();
00131 
00136 #define REALnibbles(src) (21)
00138 
00139 
00144 
00149 bool isEREL(SatAddr src);
00150 
00158 bool ERELdecode(SatAddr src, double *dst);
00159 
00164 SatAddr ERELencode(double d, SatAddr dst);
00165 
00167 SatAddr makeEREL();
00168 
00173 #define ERELnibbles(src) (26)
00174 
00175 // Convert a 15 nibble extended real number (i.e. the body of an EREL
00176 // object ) to a double.  This is used by several different objects.
00177 double ereal2double(SatAddr src);
00179 
00184 
00188 bool isCMP(SatAddr src);
00189 
00195 bool CMPdecode(SatAddr src, double *re, double *im);
00196 
00203 SatAddr CMPencode(double re, double im, SatAddr dst);
00204 
00206 SatAddr makeCMP();
00207 
00212 #define CMPnibbles(src) (37)
00213 
00215 
00219 
00223 bool isZINT(SatAddr src);
00224 
00230 bool ZINTdecodell(SatAddr src, long long *dst);
00231 
00237 SatAddr ZINTencodell(long long src, SatAddr dst);
00238 
00247 char *ZINTdecodeStr(SatAddr src, char *str);
00248 
00249 
00256 SatAddr ZINTencodeStr(const char *src, SatAddr dst);
00257 
00259 SatAddr makeZINT(int digits);
00260 
00264 int ZINTnibbles(SatAddr src);
00265 
00271 int ZINTdigits(SatAddr src);
00272 
00277 int ZINTbytes(SatAddr src);
00278 
00279 
00281 // Clean up a string representation of an integer.  This skips +/-
00282 // signs and leading zeros, and figures out how many digits are
00283 // present.  "src" is the source string.  "digits" is an output param
00284 // that is set to the number of digits in the string (which might be
00285 // zero) the scan stops at the first non-digit character.  isPostive
00286 // will be set to true/false depending on whether the number is
00287 // positive or negative.  Returns a pointer to the first non-zero
00288 // digit of the number.
00289 //
00290 // The following examples show the result of
00291 // int digits;
00292 // bool isPositive
00293 // const char *result = cleanUpZINTstr(input, &digits, &isPositive);
00294 //
00295 // Examples:
00296 // input               digits       isPositive        return value
00297 // "1234"              4            1                 "1234"
00298 // "+1234"             4            1                 "1234"
00299 // "-1234"             4            1                 "1234"
00300 // "---+1234ab"        4            0                 "1234"
00301 // "-0"                0            1                 ""
00302 const char *cleanupZINTstr(const char *src, int *digits, bool *isPositive);
00303 
00305 
00306 
00312 
00316 bool isFLASHP(SatAddr src);
00317 
00323 bool FLASHPdecode(SatAddr src, int *a, int *b);
00324 
00332 SatAddr FLASHPencode(int a, int b, SatAddr dst);
00333 
00335 SatAddr makeFLASHP();
00336 
00341 #define FLASHPnibbles(src) (12)
00343 
00344 
00351 
00355 bool isMINIFONT(SatAddr src);
00356 
00367 SatAddr MINIFONTitem(SatAddr src, int ch);
00368 
00372 int MINIFONTgetId(SatAddr src);
00373 
00379 bool MINIFONTsetId(SatAddr src, int id);
00380 
00384 SatAddr makeMINIFONT();
00385 
00390 #define MINIFONTnibbles(src) (1548)
00392 
00393 
00397 
00401 bool isFONT(SatAddr src);
00402 
00406 int FONTnibbles(SatAddr src);
00407 
00419 SatAddr FONTitem(SatAddr src, int idx);
00420 
00424 int FONTgetId(SatAddr src);
00425 
00431 bool FONTsetId(SatAddr src, int id);
00432 
00437 int FONTgetNameLen(SatAddr src);
00438 
00448 bool FONTsetName(SatAddr src, const char *name);
00449 
00466 bool FONTdecode(SatAddr src, int *id, char *name, int *height, char *graphics);
00467 
00481 SatAddr FONTencode(int id, const char *name, int height, const char *graphics, SatAddr dst);
00482 
00488 SatAddr makeFONT(int nameLen);
00490 
00494 
00498 bool isSTRING(SatAddr src);
00499 
00506 char *STRINGdecode(SatAddr src, char *dst);
00507 
00515 SatAddr STRINGencode(const char *src, SatAddr dst);
00516 
00529 bool STRINGadd(const char *src, SatAddr dst);
00530 
00536 SatAddr makeSTRING(unsigned size);
00537 
00541 int STRINGnibbles(SatAddr src);
00542 
00547 int STRINGnumChars(SatAddr src);
00549 
00553 
00557 bool isLIST(SatAddr src);
00558 
00574 SatAddr makeLIST(unsigned nibbles);
00575 
00576 
00580 int LISTnibbles(SatAddr list);
00581 
00585 int LISTsize(SatAddr src);
00586 
00593 bool LISTadd(SatAddr dst, SatAddr obj);
00594 
00604 SatAddr LISTcat(SatAddr src, SatAddr obj);
00605 
00615 SatAddr LISTmerge(SatAddr list1, SatAddr list2);
00616 
00633 SatAddr LISTencode(SatAddr dst, ... /* ob1, ob2, ob3, ..., obn , 0 */ );
00634 
00650 SatAddr LISTencodeN(int n, SatAddr obs[], SatAddr dst);
00651 
00652 //
00653 // Iteration
00654 //
00655 
00680 SatAddr LISTfirstOb(SatAddr list, SatAddr *iter);
00681 
00689 SatAddr LISTnextOb(SatAddr *iter);
00690 
00713 SatAddr LISTfirstEntry(SatAddr list);
00714 
00722 SatAddr LISTnextEntry(SatAddr entry);
00724 
00725 
00729 
00733 bool isIDNT(SatAddr src);
00734 
00742 char * IDNTdecode(SatAddr src, char *dst);
00743 
00753 SatAddr IDNTencode(const char *src, SatAddr dst);
00754 
00759 SatAddr makeIDNT(unsigned size);
00760 
00761 
00765 int IDNTnibbles(SatAddr src);
00766 
00771 int IDNTnumChars(SatAddr src);
00773 
00780 bool isLAM(SatAddr src);
00781 
00789 char * LAMdecode(SatAddr src, char *dst);
00790 
00800 SatAddr LAMencode(const char *src, SatAddr dst);
00801 
00806 SatAddr makeLAM(unsigned size);
00807 
00808 
00812 int LAMnibbles(SatAddr src);
00813 
00818 int LAMnumChars(SatAddr src);
00819 
00821 
00829 
00833 bool isHXS(SatAddr src);        /* is it an HXS? */
00834 
00841 bool HXSdecodell(SatAddr src, unsigned long long *dst);
00842 
00848 SatAddr HXSencodell(unsigned long long i, SatAddr  dst);
00849 
00850 
00858 bool HXSdecode(SatAddr src, char *buf, int *nibbles);
00859 
00866 SatAddr HXSencode(char *buf, int nibbles, SatAddr dst);
00867 
00868 
00873 int HXSnibbles(SatAddr src);
00874 
00879 int HXSbytes(SatAddr src);
00880 
00881 
00885 SatAddr makeHXS(int nibbles);
00886 
00888 
00892 
00896 bool isGROB(SatAddr src);
00897 
00898 
00903 int GROBnibbles(SatAddr src);
00904 
00915 bool GROBdecode(SatAddr src, int *rows, int *columns, char *pixels);
00916 
00925 SatAddr GROBencode(int rows, int columns, char *pixels, SatAddr dst);
00926 
00931 int GROBbytes(SatAddr src);
00932 
00937 SatAddr makeGROB(int rows, int columns);
00938 
00947 bool GROBsetPixel(SatAddr src, int row, int column, bool val);
00949 
00950 
00951 
00957 
00961 bool isXLIB(SatAddr src);
00962 
00968 bool XLIBdecode(SatAddr src, int *lib, int *cmd);
00969 
00970 
00979 SatAddr XLIBencode(int lib, int cmd, SatAddr dst);
00980 
00981 
00983 SatAddr makeXLIB();
00984 
00985 
00990 #define XLIBnibbles(src) (5+3+3)
00992 
00993 
00994 
00998 
01002 bool isCODE(SatAddr src);
01003 
01013 bool CODEdecode(SatAddr src, char *dst, int *nibbles);
01014 
01015 
01024 SatAddr CODEencode(const char *src, const int nibbles, SatAddr dst);
01025 
01026 
01031 SatAddr makeCODE(unsigned nibbles);
01032 
01037 int CODEnibbles(SatAddr src);
01038 
01039 
01044 int CODEbytes(SatAddr src);
01046 
01047 
01052 
01053 
01055 #define SAT_DOLIBDATA SAT_DOEXT0
01056 
01060 bool isLIBDATA(SatAddr src);
01061 
01066 int LIBDATAnibbles(SatAddr src);
01067 
01072 int LIBDATAbytes(SatAddr src);
01073 
01083 
01093 bool LIBDATAdecode(SatAddr src, char *data, int *nibbles);
01094 
01103 SatAddr LIBDATAencode(const char *data, int nibbles, SatAddr dst);
01104 
01109 SatAddr makeLIBDATA(unsigned nibbles);
01111 
01112 
01114 // \defgroup ACPTR Extended Pointer (ACPTR)
01123 
01127 bool isACPTR(SatAddr src);
01128 
01134 bool ACPTRdecode(SatAddr src, SatAddr *obj, SatAddr *program);
01135 
01143 SatAddr ACPTRencode(SatAddr obj, SatAddr program, SatAddr dst);
01144 
01147 SatAddr makeACPTR();
01148 
01154 #define ACPTRnibbles(src) (15)
01156 
01157 
01159 
01173 
01174 
01178 bool isARRAY(SatAddr src);
01179 
01183 int ARRAYnibbles(SatAddr src);
01184 
01196 
01209 SatAddr makeARRAY(SatAddr element,
01210                   int numDimensions,
01211                   int dim1,
01212                   ... /* dim2,dim3 etc */ );
01213 
01238 SatAddr ARRAYgetItem(SatAddr array, SatAddr dst, int idx1,
01239                         ... /* idx2, idx3 etc */ );
01240 
01241 
01246 
01258 int ARRAYputItem(SatAddr array,
01259                  SatAddr item,
01260                  int idx1,
01261                  ... /* idx2, idx3, ... */ );
01262 
01263 //
01264 // Iteration
01265 //
01266 
01275 SatAddr ARRAYfirstItem(SatAddr array, SatAddr dst, SatAddr *iter);
01276 
01277 
01290 SatAddr ARRAYnextItem(SatAddr array, SatAddr dst, SatAddr *iter);
01291 
01292 
01293 //
01294 // Utility functions
01295 //
01296 
01300 int ARRAYnumDimensions(SatAddr array);
01301 
01312 int ARRAYgetDimension(SatAddr array, int dimensionNumber);
01313 
01317 int ARRAYgetElProlog(SatAddr array);
01318 
01319 
01320 //
01321 // Low level functions.
01322 //
01323 
01340 int ARRAYgetElementBody(SatAddr array,
01341                         SatAddr *elementBody,
01342                         int idx1,
01343                         ... /* idx2, idx3, etc */ );
01344 
01355 int ARRAYelementSize(SatAddr array, SatAddr element);
01356 
01364 SatAddr ARRAYfirstElement(SatAddr array);
01365 
01369 
01373 SatAddr ARRAYnextElement(SatAddr array, SatAddr prev);
01375 
01377 //
01387 
01389 bool isLNKARRY(SatAddr src);
01390 
01392 int LNKARRYnibbles(SatAddr src);
01393 
01395 SatAddr makeLNKARRY(SatAddr element,
01396                   int numDimensions,
01397                   int dim1,
01398                   ... /* dim2,dim3 etc */ );
01399 
01401 SatAddr LNKARRYgetItem(SatAddr lnkarry, SatAddr dst, int idx1,
01402                         ... /* idx2, idx3 etc */ );
01403 
01405 int LNKARRYputItem(SatAddr lnkarry,
01406                  SatAddr item,
01407                  int idx1,
01408                  ... /* idx2, idx3, ... */ );
01409 
01411 SatAddr LNKARRYfirstItem(SatAddr lnkarry, SatAddr dst, SatAddr *iter);
01412 
01414 SatAddr LNKARRYnextItem(SatAddr lnkarry, SatAddr dst, SatAddr *iter);
01415 
01417 int LNKARRYnumDimensions(SatAddr lnkarry);
01418 
01420 int LNKARRYgetDimension(SatAddr lnkarry, int dimensionNumber);
01421 
01423 int LNKARRYgetElProlog(SatAddr lnkarry); /* get prolog of elements in lnkarry */
01424 
01426 int LNKARRYelementSize(SatAddr lnkarry, SatAddr item);
01427 
01429 int LNKARRYgetElementBody(SatAddr lnkarry,
01430                         SatAddr *elementBody,
01431                         int idx1,
01432                         ... /* idx2, idx3, etc */ );
01433 
01435 SatAddr LNKARRYfirstElement(SatAddr lnkarry);
01436 
01438 SatAddr LNKARRYnextElement(SatAddr lnkarry, SatAddr item);
01440 
01441 
01448 
01452 bool isCOL(SatAddr src);
01453 
01464 bool COLdecode(SatAddr src, char *dst, int *nibbles);
01465 
01474 SatAddr COLencode(const char *src, const int nibbles, SatAddr dst);
01475 
01496 SatAddr COLencodeV(SatAddr dst, ... /* ob1, ob2, ob3, ..., obn , 0 */ );
01497 
01517 SatAddr COLencodeN(int n, SatAddr obs[], SatAddr dst);
01518 
01534 SatAddr makeCOL(unsigned nibbles);
01535 
01539 int COLnibbles(SatAddr src);
01540 
01545 int COLbytes(SatAddr src);
01546 
01547 //
01548 // Iteration
01549 //
01555 SatAddr COLfirstOb(SatAddr col, SatAddr *iter);
01556 
01562 SatAddr COLnextOb(SatAddr *iter);
01563 
01574 SatAddr COLfirstEntry(SatAddr col);
01575 
01581 SatAddr COLnextEntry(SatAddr entry);
01583 
01584 
01591 
01592 
01594 bool isSYMB(SatAddr src);
01595 
01597 bool SYMBdecode(SatAddr src, char *dst, int *nibbles);
01598 
01600 SatAddr SYMBencode(const char *src, const int nibbles, SatAddr dst);
01601 
01603 SatAddr makeSYMB(unsigned nibbles);
01604 
01606 int SYMBnibbles(SatAddr src);
01607 
01609 int SYMBbytes(SatAddr src);
01610 
01612 SatAddr SYMBfirstOb(SatAddr src, SatAddr *iter);
01613 
01615 SatAddr SYMBnextOb(SatAddr *iter);
01616 
01618 SatAddr SYMBfirstEntry(SatAddr src);
01619 
01621 SatAddr SYMBnextEntry(SatAddr entry);
01622 
01624 SatAddr SYMBencodeV(SatAddr dst, ... /* ob1, ob2, ob3, ..., obn , 0 */ );
01625 
01627 SatAddr SYMBencodeN(int n, SatAddr obs[], SatAddr dst);
01629 
01635 
01639 bool isTAG(SatAddr src);
01640 
01648 SatAddr TAGencode(const char *tag, SatAddr obj, SatAddr dst);
01649 
01654 int TAGnumChars(SatAddr src);
01655 
01665 bool TAGdecode(SatAddr src, char *tag, SatAddr *obj);
01666 
01674 SatAddr makeTAG(int nibbles);
01675 
01679 int TAGnibbles(SatAddr src);
01681 
01701 
01702 
01703 // See Programming in SystemRPL for the meaning of these values
01705 #define UNITumMULT 0x2D74F      /* um* marker */
01706 
01708 #define UNITumDIV  0x2D759      /* um/ marker */
01709 
01711 #define UNITumPOW  0x2D763      /* um^ marker */
01712 
01714 #define UNITumP    0x2D76D      /* umP marker */
01715 
01717 #define UNITumEND  0x2D777      /* umEND marker */
01718 
01720 #define SAT_DOUNIT SAT_DOEXT
01721 
01723 bool isUNIT(SatAddr src);
01725 bool UNITdecode(SatAddr src, char *dst, int *nibbles);
01727 SatAddr UNITencode(const char *src, const int nibbles, SatAddr dst);
01729 SatAddr makeUNIT(unsigned nibbles);
01731 int UNITnibbles(SatAddr src);
01733 int UNITbytes(SatAddr src);
01735 SatAddr UNITfirstOb(SatAddr src, SatAddr *iter);
01737 SatAddr UNITnextOb(SatAddr *iter);
01739 SatAddr UNITfirstEntry(SatAddr src);
01741 SatAddr UNITnextEntry(SatAddr entry);
01743 SatAddr UNITencodeV(SatAddr dst, ... /* ob1, ob2, ob3, ..., obn , 0 */ );
01745 SatAddr UNITencodeN(int n, SatAddr obs[], SatAddr dst);
01746 
01748 
01749 
01757 
01763 SatAddr DIRfirstEntry(SatAddr dir);
01764 
01770 SatAddr DIRnextEntry(SatAddr entry);
01771 
01782 bool DIRdecodeEntry(SatAddr entry, char *name, SatAddr *obj);
01783 
01791 int DIRentryNameLen(SatAddr entry);
01792 
01793 //
01794 // Searching
01795 //
01796 
01804 SatAddr DIRfindEntryByName(SatAddr dir, const char *name);
01805 
01813 SatAddr DIRfindEntryByIdnt(SatAddr dir, SatAddr idnt);
01814 
01820 SatAddr DIRfindObByName(SatAddr dir, const char *name);
01821 
01827 SatAddr DIRfindObByIdnt(SatAddr dir, SatAddr idnt);
01828 
01829 // Creating
01830 
01836 void DIRinit(SatAddr dst);
01837 
01842 SatAddr makeDIR(int nibbles);
01843 
01851 bool DIRadd(SatAddr src, const char *name, SatAddr obj);
01852 
01854 struct DirItem {
01855     struct DirItem *next;       
01856     char *name;                 
01857     SatAddr obj;                
01858 };
01859 
01864 struct DirItem *DIRdecode(SatAddr src);
01865 
01876 SatAddr DIRencode(struct DirItem *head, SatAddr dst);
01877 
01889 int DIRchangeByName(SatAddr dir, const char *name, SatAddr obj);
01890 
01893 int DIRchangeByIdnt(SatAddr dir, SatAddr idnt, SatAddr obj);
01894 
01895 
01896 // Miscellaneous
01897 
01901 int DIRnibbles(SatAddr dir);
01902 
01910 SatAddr DIRdirForEntry(SatAddr entry);
01911 
01917 SatAddr DIRparentDir(SatAddr dir);
01918 
01919 
01921 SatAddr getHOME();
01922 
01924 SatAddr getCWD();
01925 
01926 
01930 bool isDIR(SatAddr src);
01932 
01933 
01944 
01948 bool isBAK(SatAddr src);
01949 
01953 int BAKnibbles(SatAddr src);
01954 
01959 int BAKnameLen(SatAddr src);
01960 
01974 bool BAKdecode(SatAddr src, char *name, SatAddr *obj, SatAddr *crc);
01976 
01984 
01986 bool isECMP(SatAddr src);
01988 bool ECMPdecode(SatAddr src, double *re, double *im);
01990 SatAddr ECMPencode(double re, double im, SatAddr dst);
01992 SatAddr makeECMP();
01994 int ECMPnibbles(SatAddr src);
01995 
01997 
01998 
02006 
02010 bool isLIB(SatAddr src);
02011 
02015 int LIBnibbles(SatAddr src);
02016 
02035 
02036 
02040 bool isLNGREAL(SatAddr src);
02041 
02049 bool LNGREALdecoded(SatAddr src, double *dst);
02050 
02055 SatAddr LNGREALencoded(double src, SatAddr dst);
02056 
02064 bool LNGREALdecodell(SatAddr src, long long *mantissa, long long *exponent);
02065 
02071 SatAddr LNGREALencodell(long long mantissa, long long exponent, SatAddr dst);
02072 
02086 bool LNGREALdecodeStr(SatAddr src, char *mantissa, char *exponent);
02087 
02094 SatAddr LNGREALencodeStr(const char *mantissa, const char *exponent, SatAddr dst);
02095 
02097 SatAddr makeLNGREAL(int numMdigits, int numEdigits);
02098 
02102 int LNGREALnibbles(SatAddr src);
02103 
02112 bool LNGREALdigits(SatAddr src, int *mDigits, int *eDigits);
02113 
02124 bool LNGREALbytes(SatAddr src, int *mBytes, int *eBytes);
02126 
02127 
02133 
02137 bool isLNGCOMP(SatAddr src);
02138 
02139 
02148 bool LNGCOMPdecoded(SatAddr src, double *re, double *im);
02149 
02156 SatAddr LNGCOMPencoded(double re, double im, SatAddr dst);
02157 
02171 bool LNGCOMPdecodell(SatAddr src,
02172                      long long *re_mantissa, long long *re_exponent,
02173                      long long *im_mantissa, long long *im_exponent);
02174 
02184 SatAddr LNGCOMPencodell(long long re_mantissa, long long re_exponent,
02185                         long long im_mantissa, long long im_exponent,
02186                         SatAddr dst);
02187 
02188 
02198 SatAddr LNGCOMPencodeStr(const char *re_mantissa, const char *re_exponent,
02199                          const char *im_mantissa, const char *im_exponent,
02200                          SatAddr dst);
02201 
02220 SatAddr LNGCOMPdecodeStr(SatAddr src,
02221                          char *re_mantissa, char *re_exponent,
02222                          char *im_mantissa, char *im_exponent);
02223 
02224 // Make a LNGCOMP with room for the number of digits in the different parts
02225 // given in the parameters. Populate it with zero
02226 
02230 SatAddr makeLNGCOMP(int numReMdigits, int numReEdigits,
02231                     int numImMdigits, int numImEdigits);
02232 
02233 
02237 int LNGCOMPnibbles(SatAddr src);
02238 
02251 bool LNGCOMPdigits(SatAddr src, int *mReDigits, int *eReDigits,
02252                    int *mImDigits, int *eImDigits);
02253 
02266 bool LNGCOMPbytes(SatAddr src, int *mReBytes, int *eReBytes,
02267                    int *mImBytes, int *eImBytes);
02269 
02270 
02271 
02282 
02283 
02287 bool isMATRIX(SatAddr src);
02288 
02307 SatAddr makeMATRIX(SatAddr obj, unsigned nibbles);
02308 
02313 void MATRIXinit(SatAddr obj, SatAddr dst);
02314 
02318 int MATRIXnibbles(SatAddr src);
02319 
02321 int MATRIXsize(SatAddr src);
02322 
02324 bool MATRIXadd(SatAddr dst, SatAddr obj);
02325 
02327 SatAddr MATRIXcat(SatAddr MATRIX, SatAddr obj);
02328 
02330 SatAddr MATRIXmerge(SatAddr MATRIX1, SatAddr MATRIX2);
02331 
02333 SatAddr MATRIXencodeV(SatAddr dst, ... /* ob1, ob2, ob3, ..., obn , 0 */ );
02334 
02336 SatAddr MATRIXencodeN(int n, SatAddr obs[], SatAddr dst);
02337 
02339 SatAddr MATRIXfirstOb(SatAddr matrix, SatAddr *iter);
02340 
02342 SatAddr MATRIXnextOb(SatAddr *iter);
02343 
02345 SatAddr MATRIXfirstEntry(SatAddr matrix);
02346 
02348 SatAddr MATRIXnextEntry(SatAddr entry);
02349 
02351 
02352 
02359 
02363 SatAddr STACKpop();
02364 
02368 #define STACKpush(src) sat_pushptr(src)
02369 
02374 SatAddr STACKpick(int level);
02375 
02381 int STACKdepth();
02382 
02384 
02388 
02392 #define obProlog(src) (sat_peek((src), 5))
02393 
02398 bool fixedSize(int prolog);
02399 
02415 bool isOb(SatAddr src);
02416 
02420 int obNibbles(SatAddr src);
02421 
02429 SatAddr skipOb(SatAddr src);
02430 
02438 // points to the dst object (like a value on the stack), then you'll
02439 // change that also!
02440 bool obCopy(SatAddr src, SatAddr dst);
02441 
02443 
02456 
02465 SatAddr directPtr(SatAddr src);
02466 
02476 bool obStorePtr(SatAddr obj);
02477 
02481 int objOrPtrNibbles(SatAddr obj);
02482 
02491 int copyObjOrPtr(SatAddr src, SatAddr dst);
02493 
02494 
02498 
02507 void double2hp(double number, SatAddr dst);
02508 
02517 void double2hpereal(double number, SatAddr dst);
02518 
02526 int ll2bcd(unsigned long long src, SatAddr dst, int numDigits);
02527 
02535 int str2bcd(const char *src, SatAddr dst, int numDigits);
02536 
02538 int llDigits(unsigned long long src);
02539 
02542 void doubledecode(double number, int *ex, double *mantissa);
02543 
02552 void doubledecodell(double number, long long *mantissa, long long *exponent);
02553 
02555 long long llabs(long long src);
02556 
02559 void sat_memset(SatAddr dst, int val, int nibbles);
02560 
02561 
02564 int lngrealNibbles(SatAddr src);
02565 
02568 bool lngrealDigits(SatAddr src, int *mDigits, int *eDigits);
02569 
02573 char *prolog2Name(SatAddr prolog);
02574 
02576 
02581 SatAddr name2Prolog(const char *name);
02583 
02598 
02600 int compositeObNibbles(SatAddr src);
02601 
02603 bool compositeAdd(SatAddr dst, SatAddr obj);
02604 
02606 SatAddr compositeCat(SatAddr src, SatAddr obj);
02607 
02609 SatAddr compositeMerge(SatAddr comp1, SatAddr comp2);
02610 
02612 SatAddr compositeFirstEntry(SatAddr col);
02613 
02615 SatAddr compositeNextEntry(SatAddr entry);
02616 
02618 SatAddr compositeFirstOb(SatAddr col, SatAddr *iter);
02619 
02621 SatAddr compositeNextOb(SatAddr *iter);
02622 
02624 SatAddr compositeEncode(SatAddr dst, va_list argp);
02625 
02627 SatAddr compositeEncodeN(int n, SatAddr obs[], SatAddr dst);
02628 
02630 int compositeSize(SatAddr src);
02631 
02633 
02634 // TODO: easy way to encode objects right into a composite object.
02635 
02636 #endif

Generated on Sat Apr 3 16:38:31 2010 for HPObjects by  doxygen 1.5.0