145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#ifndef YASM_BITVECT_H
245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#define YASM_BITVECT_H
345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  MODULE NAME:  BitVector.h                           MODULE TYPE:  (adt)  */
545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  MODULE IMPORTS:                                                          */
745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ToolBox.h */
1045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
1145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  NOTE: The type names that have been chosen here are somewhat weird on    */
1245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*        purpose, in order to avoid name clashes with system header files   */
1345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*        and your own application(s) which might - directly or indirectly - */
1445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*        include this definitions file.                                     */
1545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
1645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#ifndef YASM_LIB_DECL
1745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#define YASM_LIB_DECL
1845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#endif
1945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
2045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  unsigned   char    N_char;
2145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  unsigned   char    N_byte;
2245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  unsigned   short   N_short;
2345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  unsigned   short   N_shortword;
2445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  unsigned   int     N_int;
2545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  unsigned   int     N_word;
2645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  unsigned   long    N_long;
2745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  unsigned   long    N_longword;
2845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
2945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  Mnemonic 1:  The natural numbers,  N = { 0, 1, 2, 3, ... }               */
3045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  Mnemonic 2:  Nnnn = u_N_signed,  _N_ot signed                            */
3145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
3245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  signed     char    Z_char;
3345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  signed     char    Z_byte;
3445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  signed     short   Z_short;
3545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  signed     short   Z_shortword;
3645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  signed     int     Z_int;
3745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  signed     int     Z_word;
3845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  signed     long    Z_long;
3945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  signed     long    Z_longword;
4045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
4145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  Mnemonic 1:  The whole numbers,  Z = { 0, -1, 1, -2, 2, -3, 3, ... }     */
4245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  Mnemonic 2:  Zzzz = Ssss_igned                                           */
4345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
4445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  void               *voidptr;
4545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_char             *charptr;
4645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_byte             *byteptr;
4745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_short            *shortptr;
4845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_shortword        *shortwordptr;
4945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_int              *intptr;
5045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_word             *wordptr;
5145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_long             *longptr;
5245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_longword         *longwordptr;
5345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
5445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_char             *N_charptr;
5545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_byte             *N_byteptr;
5645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_short            *N_shortptr;
5745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_shortword        *N_shortwordptr;
5845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_int              *N_intptr;
5945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_word             *N_wordptr;
6045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_long             *N_longptr;
6145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  N_longword         *N_longwordptr;
6245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
6345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  Z_char             *Z_charptr;
6445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  Z_byte             *Z_byteptr;
6545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  Z_short            *Z_shortptr;
6645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  Z_shortword        *Z_shortwordptr;
6745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  Z_int              *Z_intptr;
6845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  Z_word             *Z_wordptr;
6945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  Z_long             *Z_longptr;
7045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef  Z_longword         *Z_longwordptr;
7145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
7245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#ifndef FALSE
7345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#define FALSE       (0!=0)
7445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#endif
7545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
7645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#ifndef TRUE
7745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#define TRUE        (0==0)
7845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#endif
7945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
8045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#ifdef __cplusplus
8145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    typedef bool boolean;
8245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#else
8345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    #ifdef MACOS_TRADITIONAL
8445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        #define boolean Boolean
8545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    #else
8645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        typedef enum boolean { false = FALSE, true = TRUE } boolean;
8745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    #endif
8845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#endif
8945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
9045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
9145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  MODULE INTERFACE:                                                        */
9245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
9345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
9445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef enum ErrCode
9545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    {
9645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Ok = 0,    /* everything went allright                       */
9745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
9845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Type,      /* types word and size_t have incompatible sizes  */
9945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Bits,      /* bits of word and sizeof(word) are inconsistent */
10045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Word,      /* size of word is less than 16 bits              */
10145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Long,      /* size of word is greater than size of long      */
10245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Powr,      /* number of bits of word is not a power of two   */
10345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Loga,      /* error in calculation of logarithm              */
10445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
10545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Null,      /* unable to allocate memory                      */
10645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
10745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Indx,      /* index out of range                             */
10845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Ordr,      /* minimum > maximum index                        */
10945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Size,      /* bit vector size mismatch                       */
11045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Pars,      /* input string syntax error                      */
11145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Ovfl,      /* numeric overflow error                         */
11245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Same,      /* operands must be distinct                      */
11345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Expo,      /* exponent must be positive                      */
11445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        ErrCode_Zero       /* division by zero error                         */
11545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    } ErrCode;
11645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
11745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef wordptr *listptr;
11845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
11945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> MISCELLANEOUS BASIC FUNCTIONS: <=== */
12045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
12145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
12245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgconst char * BitVector_Error      (ErrCode error);  /* return string for err code */
12345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
12445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
12545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgErrCode BitVector_Boot       (void);                 /* 0 = ok, 1..7 = error */
12645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
12745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Shutdown   (void);                            /* undo Boot */
12845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
12945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
13045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgN_word  BitVector_Size       (N_int bits);  /* bit vector size (# of words)  */
13145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
13245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgN_word  BitVector_Mask       (N_int bits);  /* bit vector mask (unused bits) */
13345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
13445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> CLASS METHODS: <=== */
13545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
13645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
13745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgconst char * BitVector_Version    (void);          /* returns version string */
13845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
13945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
14045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgN_int   BitVector_Word_Bits  (void);     /* return # of bits in machine word */
14145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
14245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgN_int   BitVector_Long_Bits  (void);    /* return # of bits in unsigned long */
14345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
14445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> CONSTRUCTOR METHODS: <=== */
14545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
14645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
14745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*@only@*/ wordptr BitVector_Create     (N_int bits, boolean clear);          /* malloc */
14845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
14945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orglistptr BitVector_Create_List(N_int bits, boolean clear, N_int count);
15045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
15145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
15245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgwordptr BitVector_Resize     (wordptr oldaddr, N_int bits);       /* realloc */
15345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
15445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
15545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgwordptr BitVector_Shadow     (wordptr addr); /* make new same size but empty */
15645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
15745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgwordptr BitVector_Clone      (wordptr addr);         /* make exact duplicate */
15845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
15945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
16045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgwordptr BitVector_Concat     (wordptr X, wordptr Y); /* return concatenation */
16145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
16245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> DESTRUCTOR METHODS: <=== */
16345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
16445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
16545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Dispose            (/*@only@*/ /*@out@*/ charptr string);             /* string */
16645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
16745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Destroy            (/*@only@*/ wordptr addr);               /* bitvec */
16845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
16945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Destroy_List       (listptr list, N_int count);  /* list   */
17045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
17145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> OBJECT METHODS: <=== */
17245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
17345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> bit vector copy function: */
17445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
17545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
17645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Copy       (wordptr X, wordptr Y);              /* X = Y   */
17745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
17845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> bit vector initialization: */
17945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
18045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
18145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Empty      (wordptr addr);                      /* X = {}  */
18245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
18345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Fill       (wordptr addr);                      /* X = ~{} */
18445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
18545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Flip       (wordptr addr);                      /* X = ~X  */
18645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
18745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
18845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Primes     (wordptr addr);
18945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
19045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> miscellaneous functions: */
19145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
19245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
19345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Reverse    (wordptr X, wordptr Y);
19445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
19545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> bit vector interval operations and functions: */
19645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
19745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
19845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Interval_Empty     (/*@out@*/ wordptr addr, N_int lower, N_int upper);
19945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
20045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Interval_Fill      (/*@out@*/ wordptr addr, N_int lower, N_int upper);
20145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
20245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Interval_Flip      (/*@out@*/ wordptr addr, N_int lower, N_int upper);
20345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
20445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Interval_Reverse   (/*@out@*/ wordptr addr, N_int lower, N_int upper);
20545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
20645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
20745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean BitVector_interval_scan_inc  (wordptr addr, N_int start,
20845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                                      N_intptr min, N_intptr max);
20945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
21045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean BitVector_interval_scan_dec  (wordptr addr, N_int start,
21145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                                      N_intptr min, N_intptr max);
21245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
21345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
21445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Interval_Copy      (/*@out@*/ wordptr X, wordptr Y, N_int Xoffset,
21545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                                      N_int Yoffset, N_int length);
21645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
21745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
21845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgwordptr BitVector_Interval_Substitute(/*@out@*/ wordptr X, wordptr Y,
21945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                                      N_int Xoffset, N_int Xlength,
22045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                                      N_int Yoffset, N_int Ylength);
22145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
22245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> bit vector test functions: */
22345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
22445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
22545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean BitVector_is_empty   (wordptr addr);                  /* X == {} ?   */
22645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
22745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean BitVector_is_full    (wordptr addr);                  /* X == ~{} ?  */
22845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
22945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
23045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean BitVector_equal      (wordptr X, wordptr Y);          /* X == Y ?    */
23145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
23245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgZ_int   BitVector_Lexicompare(wordptr X, wordptr Y);          /* X <,=,> Y ? */
23345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
23445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgZ_int   BitVector_Compare    (wordptr X, wordptr Y);          /* X <,=,> Y ? */
23545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
23645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> bit vector string conversion functions: */
23745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
23845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
23945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*@only@*/ charptr BitVector_to_Hex     (wordptr addr);
24045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
24145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgErrCode BitVector_from_Hex   (/*@out@*/wordptr addr, charptr string);
24245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
24345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
24445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgErrCode BitVector_from_Oct(/*@out@*/ wordptr addr, charptr string);
24545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
24645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
24745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*@only@*/ charptr BitVector_to_Bin     (wordptr addr);
24845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
24945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgErrCode BitVector_from_Bin   (/*@out@*/ wordptr addr, charptr string);
25045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
25145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
25245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*@only@*/ charptr BitVector_to_Dec     (wordptr addr);
25345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
25445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgErrCode BitVector_from_Dec   (/*@out@*/ wordptr addr, charptr string);
25545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
25645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgtypedef struct BitVector_from_Dec_static_data BitVector_from_Dec_static_data;
25745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
25845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgBitVector_from_Dec_static_data *BitVector_from_Dec_static_Boot(N_word bits);
25945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
26045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid BitVector_from_Dec_static_Shutdown(/*@null@*/ BitVector_from_Dec_static_data *data);
26145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
26245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgErrCode BitVector_from_Dec_static(BitVector_from_Dec_static_data *data,
26345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                                  /*@out@*/ wordptr addr, charptr string);
26445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
26545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
26645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*@only@*/ charptr BitVector_to_Enum    (wordptr addr);
26745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
26845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgErrCode BitVector_from_Enum  (/*@out@*/ wordptr addr, charptr string);
26945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
27045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> bit vector bit operations, functions & tests: */
27145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
27245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
27345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Bit_Off    (/*@out@*/ wordptr addr, N_int indx); /*  X = X \ {x}    */
27445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
27545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Bit_On     (/*@out@*/ wordptr addr, N_int indx); /*  X = X + {x}    */
27645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
27745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean BitVector_bit_flip   (/*@out@*/ wordptr addr, N_int indx); /* (X+{x})\(X*{x}) */
27845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
27945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
28045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean BitVector_bit_test   (wordptr addr, N_int indx); /*  {x} in X ?     */
28145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
28245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
28345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Bit_Copy   (/*@out@*/ wordptr addr, N_int indx, boolean bit);
28445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
28545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> bit vector bit shift & rotate functions: */
28645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
28745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
28845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_LSB                (/*@out@*/ wordptr addr, boolean bit);
28945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
29045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_MSB                (/*@out@*/ wordptr addr, boolean bit);
29145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
29245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean BitVector_lsb_               (wordptr addr);
29345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
29445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean BitVector_msb_               (wordptr addr);
29545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
29645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean /*@alt void@*/ BitVector_rotate_left        (wordptr addr);
29745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
29845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean /*@alt void@*/ BitVector_rotate_right       (wordptr addr);
29945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
30045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean /*@alt void@*/ BitVector_shift_left         (wordptr addr, boolean carry_in);
30145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
30245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean /*@alt void@*/ BitVector_shift_right        (wordptr addr, boolean carry_in);
30345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
30445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Move_Left          (wordptr addr, N_int bits);
30545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
30645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Move_Right         (wordptr addr, N_int bits);
30745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
30845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> bit vector insert/delete bits: */
30945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
31045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
31145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Insert     (wordptr addr, N_int offset, N_int count,
31245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                              boolean clear);
31345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
31445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Delete     (wordptr addr, N_int offset, N_int count,
31545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                              boolean clear);
31645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
31745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> bit vector arithmetic: */
31845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
31945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
32045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean /*@alt void@*/ BitVector_increment  (wordptr addr);                        /*  X++  */
32145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
32245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean /*@alt void@*/ BitVector_decrement  (wordptr addr);                        /*  X--  */
32345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
32445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
32545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean /*@alt void@*/ BitVector_compute    (wordptr X, wordptr Y, wordptr Z, boolean minus,
32645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                                                               boolean *carry);
32745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
32845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean /*@alt void@*/ BitVector_add        (wordptr X, wordptr Y, wordptr Z, boolean *carry);
32945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
33045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean /*@alt void@*/ BitVector_sub        (wordptr X, wordptr Y, wordptr Z, boolean *carry);
33145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
33245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean /*@alt void@*/ BitVector_inc        (wordptr X, wordptr Y);
33345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
33445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean /*@alt void@*/ BitVector_dec        (wordptr X, wordptr Y);
33545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
33645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
33745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Negate     (wordptr X, wordptr Y);
33845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
33945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Absolute   (wordptr X, wordptr Y);
34045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
34145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgZ_int   BitVector_Sign       (wordptr addr);
34245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
34345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgErrCode BitVector_Mul_Pos    (wordptr X, wordptr Y, wordptr Z, boolean strict);
34445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
34545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgErrCode BitVector_Multiply   (wordptr X, wordptr Y, wordptr Z);
34645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
34745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgErrCode BitVector_Div_Pos    (wordptr Q, wordptr X, wordptr Y, wordptr R);
34845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
34945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgErrCode BitVector_Divide     (wordptr Q, wordptr X, wordptr Y, wordptr R);
35045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
35145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgErrCode BitVector_GCD        (wordptr X, wordptr Y, wordptr Z);
35245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
35345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgErrCode BitVector_GCD2       (wordptr U, wordptr V, wordptr W,      /*   O   */
35445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                                         wordptr X, wordptr Y);     /*   I   */
35545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
35645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgErrCode BitVector_Power      (wordptr X, wordptr Y, wordptr Z);
35745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
35845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> direct memory access functions: */
35945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
36045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
36145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Block_Store(wordptr addr, charptr buffer, N_int length);
36245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
36345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgcharptr BitVector_Block_Read (wordptr addr, /*@out@*/ N_intptr length);
36445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
36545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> word array functions: */
36645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
36745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
36845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Word_Store (wordptr addr, N_int offset, N_int value);
36945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
37045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgN_int   BitVector_Word_Read  (wordptr addr, N_int offset);
37145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
37245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
37345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Word_Insert(wordptr addr, N_int offset, N_int count,
37445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                              boolean clear);
37545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
37645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Word_Delete(wordptr addr, N_int offset, N_int count,
37745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                              boolean clear);
37845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
37945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> arbitrary size chunk functions: */
38045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
38145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
38245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    BitVector_Chunk_Store(wordptr addr, N_int chunksize,
38345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                              N_int offset, N_long value);
38445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
38545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgN_long  BitVector_Chunk_Read (wordptr addr, N_int chunksize,
38645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                              N_int offset);
38745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
38845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> set operations: */
38945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
39045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
39145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    Set_Union            (wordptr X, wordptr Y, wordptr Z); /* X = Y + Z */
39245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
39345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    Set_Intersection     (wordptr X, wordptr Y, wordptr Z); /* X = Y * Z */
39445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
39545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    Set_Difference       (wordptr X, wordptr Y, wordptr Z); /* X = Y \ Z */
39645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
39745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    Set_ExclusiveOr      (wordptr X, wordptr Y, wordptr Z); /*(Y+Z)\(Y*Z)*/
39845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
39945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    Set_Complement       (wordptr X, wordptr Y);            /* X = ~Y    */
40045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
40145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> set functions: */
40245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
40345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
40445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgboolean Set_subset           (wordptr X, wordptr Y);            /* X in Y ?  */
40545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
40645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
40745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgN_int   Set_Norm             (wordptr addr);                    /* = | X |   */
40845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
40945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgN_int   Set_Norm2            (wordptr addr);                    /* = | X |   */
41045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
41145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgN_int   Set_Norm3            (wordptr addr);                    /* = | X |   */
41245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
41345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgZ_long  Set_Min              (wordptr addr);                    /* = min(X)  */
41445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
41545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgZ_long  Set_Max              (wordptr addr);                    /* = max(X)  */
41645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
41745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* ===> matrix-of-booleans operations: */
41845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
41945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
42045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    Matrix_Multiplication(wordptr X, N_int rowsX, N_int colsX,
42145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                              wordptr Y, N_int rowsY, N_int colsY,
42245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                              wordptr Z, N_int rowsZ, N_int colsZ);
42345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
42445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
42545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    Matrix_Product       (wordptr X, N_int rowsX, N_int colsX,
42645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                              wordptr Y, N_int rowsY, N_int colsY,
42745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                              wordptr Z, N_int rowsZ, N_int colsZ);
42845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
42945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
43045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    Matrix_Closure       (wordptr addr, N_int rows, N_int cols);
43145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
43245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgYASM_LIB_DECL
43345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgvoid    Matrix_Transpose     (wordptr X, N_int rowsX, N_int colsX,
43445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                              wordptr Y, N_int rowsY, N_int colsY);
43545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
43645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
43745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  VERSION:  6.4                                                            */
43845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
43945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  VERSION HISTORY:                                                         */
44045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
44145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
44245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 6.4  03.10.04  Added C++ comp. directives. Improved "Norm()".  */
44345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 6.3  28.09.02  Added "Create_List()" and "GCD2()".             */
44445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 6.2  15.09.02  Overhauled error handling. Fixed "GCD()".       */
44545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 6.1  08.10.01  Make VMS linker happy: _lsb,_msb => _lsb_,_msb_ */
44645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 6.0  08.10.00  Corrected overflow handling.                    */
44745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 5.8  14.07.00  Added "Power()". Changed "Copy()".              */
44845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 5.7  19.05.99  Quickened "Div_Pos()". Added "Product()".       */
44945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 5.6  02.11.98  Leading zeros eliminated in "to_Hex()".         */
45045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 5.5  21.09.98  Fixed bug of uninitialized "error" in Multiply. */
45145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 5.4  07.09.98  Fixed bug of uninitialized "error" in Divide.   */
45245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 5.3  12.05.98  Improved Norm. Completed history.               */
45345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 5.2  31.03.98  Improved Norm.                                  */
45445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 5.1  09.03.98  No changes.                                     */
45545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 5.0  01.03.98  Major additions and rewrite.                    */
45645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 4.2  16.07.97  Added is_empty, is_full.                        */
45745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 4.1  30.06.97  Added word-ins/del, move-left/right, inc/dec.   */
45845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 4.0  23.04.97  Rewrite. Added bit shift and bool. matrix ops.  */
45945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 3.2  04.02.97  Added interval methods.                         */
46045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 3.1  21.01.97  Fixed bug on 64 bit machines.                   */
46145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 3.0  12.01.97  Added flip.                                     */
46245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 2.0  14.12.96  Efficiency and consistency improvements.        */
46345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 1.1  08.01.96  Added Resize and ExclusiveOr.                   */
46445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 1.0  14.12.95  First version under UNIX (with Perl module).    */
46545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 0.9  01.11.93  First version of C library under MS-DOS.        */
46645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Version 0.1  ??.??.89  First version in Turbo Pascal under CP/M.       */
46745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
46845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
46945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  AUTHOR:                                                                  */
47045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
47145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
47245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Steffen Beyer                                                          */
47345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    mailto:sb@engelschall.com                                              */
47445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    http://www.engelschall.com/u/sb/download/                              */
47545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
47645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
47745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  COPYRIGHT:                                                               */
47845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
47945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
48045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Copyright (c) 1995 - 2004 by Steffen Beyer.                            */
48145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    All rights reserved.                                                   */
48245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
48345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
48445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  LICENSE:                                                                 */
48545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
48645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* This package is free software; you can use, modify and redistribute       */
48745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* it under the same terms as Perl itself, i.e., under the terms of          */
48845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* the "Artistic License" or the "GNU General Public License".               */
48945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
49045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* The C library at the core of this Perl module can additionally            */
49145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* be used, modified and redistributed under the terms of the                */
49245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* "GNU Library General Public License".                                     */
49345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
49445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
49545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  ARTISTIC LICENSE:                                                        */
49645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
49745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*
49845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                         The "Artistic License"
49945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
50045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                                Preamble
50145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
50245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgThe intent of this document is to state the conditions under which a
50345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgPackage may be copied, such that the Copyright Holder maintains some
50445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgsemblance of artistic control over the development of the package,
50545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgwhile giving the users of the package the right to use and distribute
50645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgthe Package in a more-or-less customary fashion, plus the right to make
50745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgreasonable modifications.
50845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
50945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgDefinitions:
51045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
51145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        "Package" refers to the collection of files distributed by the
51245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        Copyright Holder, and derivatives of that collection of files
51345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        created through textual modification.
51445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
51545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        "Standard Version" refers to such a Package if it has not been
51645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        modified, or has been modified in accordance with the wishes
51745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        of the Copyright Holder as specified below.
51845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
51945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        "Copyright Holder" is whoever is named in the copyright or
52045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        copyrights for the package.
52145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
52245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        "You" is you, if you're thinking about copying or distributing
52345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        this Package.
52445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
52545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        "Reasonable copying fee" is whatever you can justify on the
52645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        basis of media cost, duplication charges, time of people involved,
52745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        and so on.  (You will not be required to justify it to the
52845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        Copyright Holder, but only to the computing community at large
52945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        as a market that must bear the fee.)
53045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
53145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        "Freely Available" means that no fee is charged for the item
53245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        itself, though there may be fees involved in handling the item.
53345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        It also means that recipients of the item may redistribute it
53445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org        under the same conditions they received it.
53545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
53645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org1. You may make and give away verbatim copies of the source form of the
53745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgStandard Version of this Package without restriction, provided that you
53845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgduplicate all of the original copyright notices and associated disclaimers.
53945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
54045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org2. You may apply bug fixes, portability fixes and other modifications
54145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgderived from the Public Domain or from the Copyright Holder.  A Package
54245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgmodified in such a way shall still be considered the Standard Version.
54345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
54445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org3. You may otherwise modify your copy of this Package in any way, provided
54545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgthat you insert a prominent notice in each changed file stating how and
54645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgwhen you changed that file, and provided that you do at least ONE of the
54745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgfollowing:
54845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
54945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    a) place your modifications in the Public Domain or otherwise make them
55045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    Freely Available, such as by posting said modifications to Usenet or
55145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    an equivalent medium, or placing the modifications on a major archive
55245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    site such as uunet.uu.net, or by allowing the Copyright Holder to include
55345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    your modifications in the Standard Version of the Package.
55445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
55545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    b) use the modified Package only within your corporation or organization.
55645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
55745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    c) rename any non-standard executables so the names do not conflict
55845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    with standard executables, which must also be provided, and provide
55945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    a separate manual page for each non-standard executable that clearly
56045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    documents how it differs from the Standard Version.
56145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
56245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    d) make other distribution arrangements with the Copyright Holder.
56345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
56445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org4. You may distribute the programs of this Package in object code or
56545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgexecutable form, provided that you do at least ONE of the following:
56645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
56745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    a) distribute a Standard Version of the executables and library files,
56845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    together with instructions (in the manual page or equivalent) on where
56945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    to get the Standard Version.
57045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
57145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    b) accompany the distribution with the machine-readable source of
57245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    the Package with your modifications.
57345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
57445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    c) give non-standard executables non-standard names, and clearly
57545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    document the differences in manual pages (or equivalent), together
57645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    with instructions on where to get the Standard Version.
57745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
57845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org    d) make other distribution arrangements with the Copyright Holder.
57945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
58045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org5. You may charge a reasonable copying fee for any distribution of this
58145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgPackage.  You may charge any fee you choose for support of this
58245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgPackage.  You may not charge a fee for this Package itself.  However,
58345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgyou may distribute this Package in aggregate with other (possibly
58445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgcommercial) programs as part of a larger (possibly commercial) software
58545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgdistribution provided that you do not advertise this Package as a
58645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgproduct of your own.  You may embed this Package's interpreter within
58745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.organ executable of yours (by linking); this shall be construed as a mere
58845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgform of aggregation, provided that the complete Standard Version of the
58945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orginterpreter is so embedded.
59045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
59145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org6. The scripts and library files supplied as input to or produced as
59245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgoutput from the programs of this Package do not automatically fall
59345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgunder the copyright of this Package, but belong to whoever generated
59445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgthem, and may be sold commercially, and may be aggregated with this
59545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgPackage.  If such scripts or library files are aggregated with this
59645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgPackage via the so-called "undump" or "unexec" methods of producing a
59745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgbinary executable image, then distribution of such an image shall
59845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgneither be construed as a distribution of this Package nor shall it
59945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgfall under the restrictions of Paragraphs 3 and 4, provided that you do
60045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgnot represent such an executable image as a Standard Version of this
60145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgPackage.
60245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
60345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org7. C subroutines (or comparably compiled subroutines in other
60445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orglanguages) supplied by you and linked into this Package in order to
60545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgemulate subroutines and variables of the language defined by this
60645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgPackage shall not be considered part of this Package, but are the
60745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgequivalent of input as in Paragraph 6, provided these subroutines do
60845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgnot change the language in any way that would cause it to fail the
60945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgregression tests for the language.
61045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
61145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org8. Aggregation of this Package with a commercial distribution is always
61245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgpermitted provided that the use of this Package is embedded; that is,
61345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgwhen no overt attempt is made to make this Package's interfaces visible
61445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgto the end user of the commercial distribution.  Such use shall not be
61545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgconstrued as a distribution of this Package.
61645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
61745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org9. The name of the Copyright Holder may not be used to endorse or promote
61845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgproducts derived from this software without specific prior written permission.
61945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
62045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
62145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgIMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
62245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgWARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
62345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org
62445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org                                The End
62545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org*/
62645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
62745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  GNU GENERAL PUBLIC LICENSE:                                              */
62845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
62945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* This program is free software; you can redistribute it and/or             */
63045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* modify it under the terms of the GNU General Public License               */
63145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* as published by the Free Software Foundation; either version 2            */
63245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* of the License, or (at your option) any later version.                    */
63345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
63445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* This program is distributed in the hope that it will be useful,           */
63545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* but WITHOUT ANY WARRANTY; without even the implied warranty of            */
63645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             */
63745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* GNU General Public License for more details.                              */
63845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
63945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* You should have received a copy of the GNU General Public License         */
64045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* along with this program; if not, write to the                             */
64145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* Free Software Foundation, Inc.,                                           */
64245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/* 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.                 */
64345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
64445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
64545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*  GNU LIBRARY GENERAL PUBLIC LICENSE:                                      */
64645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
64745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
64845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    This library is free software; you can redistribute it and/or          */
64945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    modify it under the terms of the GNU Library General Public            */
65045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    License as published by the Free Software Foundation; either           */
65145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    version 2 of the License, or (at your option) any later version.       */
65245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
65345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    This library is distributed in the hope that it will be useful,        */
65445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    but WITHOUT ANY WARRANTY; without even the implied warranty of         */
65545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU       */
65645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Library General Public License for more details.                       */
65745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
65845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    You should have received a copy of the GNU Library General Public      */
65945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    License along with this library; if not, write to the                  */
66045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    Free Software Foundation, Inc.,                                        */
66145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    59 Temple Place, Suite 330, Boston, MA 02111-1307 USA                  */
66245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
66345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*    or download a copy from ftp://ftp.gnu.org/pub/gnu/COPYING.LIB-2.0      */
66445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*                                                                           */
66545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org/*****************************************************************************/
66645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org#endif
667