Main Page | Class List | Directories | File List | Class Members | File Members

_slang.h

Go to the documentation of this file.
00001 #ifndef PRIVATE_SLANG_H_
00002 #define PRIVATE_SLANG_H_
00003 /* header file for S-Lang internal structures that users do not (should not)
00004    need.  Use slang.h for that purpose. */
00005 /*
00006 Copyright (C) 2004, 2005, 2006 John E. Davis
00007 
00008 This file is part of the S-Lang Library.
00009 
00010 The S-Lang Library is free software; you can redistribute it and/or
00011 modify it under the terms of the GNU General Public License as
00012 published by the Free Software Foundation; either version 2 of the
00013 License, or (at your option) any later version.
00014 
00015 The S-Lang Library is distributed in the hope that it will be useful,
00016 but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 General Public License for more details.
00019 
00020 You should have received a copy of the GNU General Public License
00021 along with this library; if not, write to the Free Software
00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
00023 USA.  
00024 */
00025 
00026 /* #include "config.h" */
00027 #include "jdmacros.h"
00028 #include "sllimits.h"
00029 
00030 #ifdef VMS
00031 # define SLANG_SYSTEM_NAME "_VMS"
00032 #else
00033 # if defined (IBMPC_SYSTEM)
00034 #  define SLANG_SYSTEM_NAME "_IBMPC"
00035 # else
00036 #  define SLANG_SYSTEM_NAME "_UNIX"
00037 # endif
00038 #endif  /* VMS */
00039 
00040 /* These quantities are main_types for byte-compiled code.  They are used
00041  * by the inner_interp routine.  The _BC_ means byte-code.
00042  */
00043 
00044 /* Nametype byte-codes --- these must correspond to those in slang.h */
00045 typedef enum
00046 {
00047    SLANG_BC_LAST_BLOCK          = 0,
00048    SLANG_BC_LVARIABLE           = SLANG_LVARIABLE,   /* 0x01 */
00049    SLANG_BC_GVARIABLE           = SLANG_GVARIABLE,   /* 0x02 */
00050    SLANG_BC_IVARIABLE           = SLANG_IVARIABLE,   /* 0x03 */
00051    SLANG_BC_RVARIABLE           = SLANG_RVARIABLE,   /* 0x04 */
00052    SLANG_BC_INTRINSIC           = SLANG_INTRINSIC,   /* 0x05 */
00053    SLANG_BC_FUNCTION            = SLANG_FUNCTION,   /* 0x06 */
00054    SLANG_BC_MATH_UNARY          = SLANG_MATH_UNARY,   /* 0x07 */
00055    SLANG_BC_APP_UNARY           = SLANG_APP_UNARY,   /* 0x08 */
00056    SLANG_BC_ARITH_UNARY         = SLANG_ARITH_UNARY,   /* 0x09 */
00057    SLANG_BC_ARITH_BINARY        = SLANG_ARITH_BINARY,   /* 0x0A */
00058    SLANG_BC_ICONST              = SLANG_ICONSTANT,   /* 0x0B */
00059    SLANG_BC_DCONST              = SLANG_DCONSTANT,   /* 0x0C */
00060    SLANG_BC_FCONST              = SLANG_FCONSTANT,   /* 0x0D */
00061    SLANG_BC_LLCONST             = SLANG_LLCONSTANT,   /* 0x0E */
00062    SLANG_BC_PVARIABLE           = SLANG_PVARIABLE,   /* 0x0F */
00063    SLANG_BC_PFUNCTION           = SLANG_PFUNCTION,   /* 0x10 */
00064    SLANG_BC_HCONST              = SLANG_HCONSTANT,   /* 0x11 */
00065    SLANG_BC_LCONST              = SLANG_LCONSTANT,   /* 0x12 */
00066    SLANG_BC_UNUSED_0x12         = 0x12,
00067    SLANG_BC_UNUSED_0x13         = 0x13,
00068    SLANG_BC_UNUSED_0x14         = 0x14,
00069    SLANG_BC_UNUSED_0x15         = 0x15,
00070    SLANG_BC_UNUSED_0x16         = 0x16,
00071    SLANG_BC_UNUSED_0x17         = 0x17,
00072    SLANG_BC_UNUSED_0x18         = 0x18,
00073    SLANG_BC_UNUSED_0x19         = 0x19,
00074    SLANG_BC_UNUSED_0x1A         = 0x1A,
00075    SLANG_BC_UNUSED_0x1B         = 0x1B,
00076    SLANG_BC_UNUSED_0x1C         = 0x1C,
00077    SLANG_BC_UNUSED_0x1D         = 0x1D,
00078    SLANG_BC_UNUSED_0x1E         = 0x1E,
00079    SLANG_BC_UNUSED_0x1F         = 0x1F,
00080 
00081    /* bytes codes for setting/assigning variables/arrays/structures/refs */
00082    SLANG_BC_SET_LOCAL_LVALUE    = 0x20,
00083    SLANG_BC_SET_GLOBAL_LVALUE   = 0x21,
00084    SLANG_BC_SET_INTRIN_LVALUE   = 0x22,
00085    SLANG_BC_SET_STRUCT_LVALUE   = 0x23,
00086    SLANG_BC_SET_ARRAY_LVALUE    = 0x24,
00087    SLANG_BC_SET_DEREF_LVALUE    = 0x25,
00088    SLANG_BC_FIELD               = 0x26,
00089    SLANG_BC_METHOD              = 0x27,
00090    SLANG_BC_LVARIABLE_AGET      = 0x28,
00091    SLANG_BC_LVARIABLE_APUT      = 0x29,
00092    SLANG_BC_LOBJPTR             = 0x2A,
00093    SLANG_BC_GOBJPTR             = 0x2B,
00094    SLANG_BC_UNUSED_0x2C         = 0x2C,
00095    SLANG_BC_UNUSED_0x2D         = 0x2D,
00096    SLANG_BC_UNUSED_0x2E         = 0x2E,
00097    SLANG_BC_UNUSED_0x2F         = 0x2F,
00098    SLANG_BC_UNUSED_0x30         = 0x30,
00099    SLANG_BC_UNUSED_0x31         = 0x31,
00100    SLANG_BC_UNUSED_0x32         = 0x32,
00101    SLANG_BC_UNUSED_0x33         = 0x33,
00102    SLANG_BC_UNUSED_0x34         = 0x34,
00103    SLANG_BC_UNUSED_0x35         = 0x35,
00104    SLANG_BC_UNUSED_0x36         = 0x36,
00105    SLANG_BC_UNUSED_0x37         = 0x37,
00106    SLANG_BC_UNUSED_0x38         = 0x38,
00107    SLANG_BC_UNUSED_0x39         = 0x39,
00108    SLANG_BC_UNUSED_0x3A         = 0x3A,
00109    SLANG_BC_UNUSED_0x3B         = 0x3B,
00110    SLANG_BC_UNUSED_0x3C         = 0x3C,
00111    SLANG_BC_UNUSED_0x3D         = 0x3D,
00112    SLANG_BC_UNUSED_0x3E         = 0x3E,
00113    SLANG_BC_UNUSED_0x3F         = 0x3F,
00114    
00115    /* byte codes for literals */
00116    SLANG_BC_LITERAL             = 0x40,           /* constant objects */
00117    SLANG_BC_LITERAL_INT         = 0x41,
00118    SLANG_BC_LITERAL_DBL         = 0x42,
00119    SLANG_BC_LITERAL_STR         = 0x43,
00120    SLANG_BC_DOLLAR_STR          = 0x44,
00121    SLANG_BC_LITERAL_SHORT       = 0x45,
00122    SLANG_BC_LITERAL_LONG        = 0x46,
00123    SLANG_BC_UNUSED_0x45         = 0x45,
00124    SLANG_BC_UNUSED_0x46         = 0x46,
00125    SLANG_BC_UNUSED_0x47         = 0x47,
00126    SLANG_BC_UNUSED_0x48         = 0x48,
00127    SLANG_BC_UNUSED_0x49         = 0x49,
00128    SLANG_BC_UNUSED_0x4A         = 0x4A,
00129    SLANG_BC_UNUSED_0x4B         = 0x4B,
00130    SLANG_BC_UNUSED_0x4C         = 0x4C,
00131    SLANG_BC_UNUSED_0x4D         = 0x4D,
00132    SLANG_BC_UNUSED_0x4E         = 0x4E,
00133    SLANG_BC_UNUSED_0x4F         = 0x4F,
00134    
00135    /* Unary/Binary operation codes */
00136    SLANG_BC_UNARY               = 0x50,
00137    SLANG_BC_BINARY              = 0x51,
00138    SLANG_BC_INTEGER_PLUS        = 0x52,
00139    SLANG_BC_INTEGER_MINUS       = 0x53,
00140    SLANG_BC_UNUSED_0x54         = 0x54,
00141    SLANG_BC_UNUSED_0x55         = 0x55,
00142    SLANG_BC_UNUSED_0x56         = 0x56,
00143    SLANG_BC_UNUSED_0x57         = 0x57,
00144    SLANG_BC_UNUSED_0x58         = 0x58,
00145    SLANG_BC_UNUSED_0x59         = 0x59,
00146    SLANG_BC_UNUSED_0x5A         = 0x5A,
00147    SLANG_BC_UNUSED_0x5B         = 0x5B,
00148    SLANG_BC_UNUSED_0x5C         = 0x5C,
00149    SLANG_BC_UNUSED_0x5D         = 0x5D,
00150    SLANG_BC_UNUSED_0x5E         = 0x5E,
00151    SLANG_BC_UNUSED_0x5F         = 0x5F,
00152    
00153    /* byte codes associated with keywords and blocks */
00154    SLANG_BC_TMP                 = 0x60,
00155    SLANG_BC_EXCH                = 0x61,
00156    SLANG_BC_LABEL               = 0x62,
00157    SLANG_BC_BLOCK               = 0x63,
00158    SLANG_BC_RETURN              = 0x64,
00159    SLANG_BC_BREAK               = 0x65,
00160    SLANG_BC_CONTINUE            = 0x66,
00161    SLANG_BC_IF_BLOCK            = 0x67,   /* optimized code */
00162    SLANG_BC_UNUSED_0x68         = 0x68,
00163    SLANG_BC_UNUSED_0x69         = 0x69,
00164    SLANG_BC_X_ERROR             = 0x6A,
00165    SLANG_BC_X_USER0             = 0x6B,
00166    SLANG_BC_X_USER1             = 0x6C,
00167    SLANG_BC_X_USER2             = 0x6D,
00168    SLANG_BC_X_USER3             = 0x6E,
00169    SLANG_BC_X_USER4             = 0x6F,
00170    
00171    /* byte codes for dealing with the frame pointer and arg list */
00172    SLANG_BC_CALL_DIRECT         = 0x70,
00173    SLANG_BC_CALL_DIRECT_FRAME   = 0x71,
00174    /* SLANG_BC_ARG_LVARIABLE    = 0x72, */
00175    SLANG_BC_UNUSED_0x72         = 0x72,
00176    SLANG_BC_EARG_LVARIABLE      = 0x73,
00177    SLANG_BC_LINE_NUM            = 0x74,
00178    SLANG_BC_BOS                 = 0x75,
00179    SLANG_BC_EOS                 = 0x76,
00180    SLANG_BC_UNUSED_0x77         = 0x77,
00181    SLANG_BC_UNUSED_0x78         = 0x78,
00182    SLANG_BC_UNUSED_0x79         = 0x79,
00183    SLANG_BC_UNUSED_0x7A         = 0x7A,
00184    SLANG_BC_UNUSED_0x7B         = 0x7B,
00185    SLANG_BC_UNUSED_0x7C         = 0x7C,
00186    SLANG_BC_UNUSED_0x7D         = 0x7D,
00187    SLANG_BC_UNUSED_0x7E         = 0x7E,
00188    SLANG_BC_UNUSED_0x7F         = 0x7F,
00189    
00190    /* These are used only when compiled with USE_COMBINED_BYTECODES */
00191    SLANG_BC_CALL_DIRECT_INTRINSIC= 0x80,
00192    SLANG_BC_INTRINSIC_CALL_DIRECT= 0x81,
00193    SLANG_BC_CALL_DIRECT_LSTR    = 0x82,
00194    SLANG_BC_CALL_DIRECT_SLFUN   = 0x83,
00195    SLANG_BC_CALL_DIRECT_RETINTR = 0x84,
00196    SLANG_BC_RET_INTRINSIC       = 0x85,
00197    SLANG_BC_CALL_DIRECT_EARG_LVAR= 0x86,
00198    SLANG_BC_CALL_DIRECT_LINT    = 0x87,
00199    SLANG_BC_CALL_DIRECT_LVAR    = 0x88,
00200    SLANG_BC_LLVARIABLE_BINARY   = 0x89,
00201    SLANG_BC_LGVARIABLE_BINARY   = 0x8A,
00202    SLANG_BC_GLVARIABLE_BINARY   = 0x8B,
00203    SLANG_BC_GGVARIABLE_BINARY   = 0x8C,
00204    SLANG_BC_LIVARIABLE_BINARY   = 0x8D,
00205    SLANG_BC_LDVARIABLE_BINARY   = 0x8E,
00206    SLANG_BC_ILVARIABLE_BINARY   = 0x8F,
00207    SLANG_BC_DLVARIABLE_BINARY   = 0x90,
00208    SLANG_BC_LVARIABLE_BINARY    = 0x91,
00209    SLANG_BC_GVARIABLE_BINARY    = 0x92,
00210    SLANG_BC_LITERAL_INT_BINARY  = 0x93,
00211    SLANG_BC_LITERAL_DBL_BINARY  = 0x94,
00212    SLANG_BC_LASSIGN_LLBINARY    = 0x95,
00213    SLANG_BC_LASSIGN_LIBINARY    = 0x96,
00214    SLANG_BC_LASSIGN_ILBINARY    = 0x97,
00215    SLANG_BC_LASSIGN_LDBINARY    = 0x98,
00216    SLANG_BC_LASSIGN_DLBINARY    = 0x99,
00217    SLANG_BC_RET_LVARIABLE       = 0x9A,
00218    SLANG_BC_RET_LITERAL_INT     = 0x9B,
00219    SLANG_BC_MANY_LVARIABLE      = 0x9C,
00220    SLANG_BC_MANY_LVARIABLE_DIR  = 0x9D,
00221    SLANG_BC_LVARIABLE_AGET1     = 0x9E,
00222    SLANG_BC_LITERAL_AGET1       = 0x9F,
00223    SLANG_BC_LVARIABLE_APUT1     = 0xA0,
00224    SLANG_BC_LITERAL_APUT1       = 0xA1,
00225    SLANG_BC_UNUSED_0xA2         = 0xA2,
00226    SLANG_BC_UNUSED_0xA3         = 0xA3,
00227    SLANG_BC_UNUSED_0xA4         = 0xA4,
00228    SLANG_BC_UNUSED_0xA5         = 0xA5,
00229    SLANG_BC_UNUSED_0xA6         = 0xA6,
00230    SLANG_BC_UNUSED_0xA7         = 0xA7,
00231    SLANG_BC_UNUSED_0xA8         = 0xA8,
00232    SLANG_BC_UNUSED_0xA9         = 0xA9,
00233    SLANG_BC_UNUSED_0xAA         = 0xAA,
00234    SLANG_BC_UNUSED_0xAB         = 0xAB,
00235    SLANG_BC_UNUSED_0xAC         = 0xAC,
00236    SLANG_BC_UNUSED_0xAD         = 0xAD,
00237    SLANG_BC_UNUSED_0xAE         = 0xAE,
00238    SLANG_BC_UNUSED_0xAF         = 0xAF,
00239    /* The following do not actually occur in inner_interp.  They used 
00240     * to signify the bytecode has been combined with another.
00241     */
00242    SLANG_BC_LVARIABLE_COMBINED  = 0xB0,
00243    SLANG_BC_GVARIABLE_COMBINED  = 0xB1,
00244    SLANG_BC_LITERAL_COMBINED    = 0xB2,
00245    SLANG_BC_CALL_DIRECT_COMB    = 0xB3,
00246    SLANG_BC_COMBINED            = 0xB4,
00247    SLANG_BC_UNUSED_0xB5         = 0xB5,
00248    SLANG_BC_UNUSED_0xB6         = 0xB6,
00249    SLANG_BC_UNUSED_0xB7         = 0xB7,
00250    SLANG_BC_UNUSED_0xB8         = 0xB8,
00251    SLANG_BC_UNUSED_0xB9         = 0xB9,
00252    SLANG_BC_UNUSED_0xBA         = 0xBA,
00253    SLANG_BC_UNUSED_0xBB         = 0xBB,
00254    SLANG_BC_UNUSED_0xBC         = 0xBC,
00255    SLANG_BC_UNUSED_0xBD         = 0xBD,
00256    SLANG_BC_UNUSED_0xBE         = 0xBE,
00257    SLANG_BC_UNUSED_0xBF         = 0xBF,
00258    SLANG_BC_UNUSED_0xC0         = 0xC0,
00259    SLANG_BC_UNUSED_0xC1         = 0xC1,
00260    SLANG_BC_UNUSED_0xC2         = 0xC2,
00261    SLANG_BC_UNUSED_0xC3         = 0xC3,
00262    SLANG_BC_UNUSED_0xC4         = 0xC4,
00263    SLANG_BC_UNUSED_0xC5         = 0xC5,
00264    SLANG_BC_UNUSED_0xC6         = 0xC6,
00265    SLANG_BC_UNUSED_0xC7         = 0xC7,
00266    SLANG_BC_UNUSED_0xC8         = 0xC8,
00267    SLANG_BC_UNUSED_0xC9         = 0xC9,
00268    SLANG_BC_UNUSED_0xCA         = 0xCA,
00269    SLANG_BC_UNUSED_0xCB         = 0xCB,
00270    SLANG_BC_UNUSED_0xCC         = 0xCC,
00271    SLANG_BC_UNUSED_0xCD         = 0xCD,
00272    SLANG_BC_UNUSED_0xCE         = 0xCE,
00273    SLANG_BC_UNUSED_0xCF         = 0xCF,
00274    SLANG_BC_UNUSED_0xD0         = 0xD0,
00275    SLANG_BC_UNUSED_0xD1         = 0xD1,
00276    SLANG_BC_UNUSED_0xD2         = 0xD2,
00277    SLANG_BC_UNUSED_0xD3         = 0xD3,
00278    SLANG_BC_UNUSED_0xD4         = 0xD4,
00279    SLANG_BC_UNUSED_0xD5         = 0xD5,
00280    SLANG_BC_UNUSED_0xD6         = 0xD6,
00281    SLANG_BC_UNUSED_0xD7         = 0xD7,
00282    SLANG_BC_UNUSED_0xD8         = 0xD8,
00283    SLANG_BC_UNUSED_0xD9         = 0xD9,
00284    SLANG_BC_UNUSED_0xDA         = 0xDA,
00285    SLANG_BC_UNUSED_0xDB         = 0xDB,
00286    SLANG_BC_UNUSED_0xDC         = 0xDC,
00287    SLANG_BC_UNUSED_0xDD         = 0xDD,
00288    SLANG_BC_UNUSED_0xDE         = 0xDE,
00289    SLANG_BC_UNUSED_0xDF         = 0xDF,
00290    SLANG_BC_UNUSED_0xE0         = 0xE0,
00291    SLANG_BC_UNUSED_0xE1         = 0xE1,
00292    SLANG_BC_UNUSED_0xE2         = 0xE2,
00293    SLANG_BC_UNUSED_0xE3         = 0xE3,
00294    SLANG_BC_UNUSED_0xE4         = 0xE4,
00295    SLANG_BC_UNUSED_0xE5         = 0xE5,
00296    SLANG_BC_UNUSED_0xE6         = 0xE6,
00297    SLANG_BC_UNUSED_0xE7         = 0xE7,
00298    SLANG_BC_UNUSED_0xE8         = 0xE8,
00299    SLANG_BC_UNUSED_0xE9         = 0xE9,
00300    SLANG_BC_UNUSED_0xEA         = 0xEA,
00301    SLANG_BC_UNUSED_0xEB         = 0xEB,
00302    SLANG_BC_UNUSED_0xEC         = 0xEC,
00303    SLANG_BC_UNUSED_0xED         = 0xED,
00304    SLANG_BC_UNUSED_0xEE         = 0xEE,
00305    SLANG_BC_UNUSED_0xEF         = 0xEF,
00306    SLANG_BC_UNUSED_0xF0         = 0xF0,
00307    SLANG_BC_UNUSED_0xF1         = 0xF1,
00308    SLANG_BC_UNUSED_0xF2         = 0xF2,
00309    SLANG_BC_UNUSED_0xF3         = 0xF3,
00310    SLANG_BC_UNUSED_0xF4         = 0xF4,
00311    SLANG_BC_UNUSED_0xF5         = 0xF5,
00312    SLANG_BC_UNUSED_0xF6         = 0xF6,
00313    SLANG_BC_UNUSED_0xF7         = 0xF7,
00314    SLANG_BC_UNUSED_0xF8         = 0xF8,
00315    SLANG_BC_UNUSED_0xF9         = 0xF9,
00316    SLANG_BC_UNUSED_0xFA         = 0xFA,
00317    SLANG_BC_UNUSED_0xFB         = 0xFB,
00318    SLANG_BC_UNUSED_0xFC         = 0xFC,
00319    SLANG_BC_UNUSED_0xFD         = 0xFD,
00320    SLANG_BC_UNUSED_0xFE         = 0xFE,
00321    SLANG_BC_UNUSED_0xFF         = 0xFF
00322 }
00323 _pSLang_BC_Type;
00324    
00325 /* Byte-Code Sub Types (_BCST_) */
00326 
00327 /* These are sub_types of SLANG_BC_BLOCK */
00328 #define SLANG_BCST_ERROR_BLOCK  0x01
00329 #define SLANG_BCST_EXIT_BLOCK   0x02
00330 #define SLANG_BCST_USER_BLOCK0  0x03
00331 #define SLANG_BCST_USER_BLOCK1  0x04
00332 #define SLANG_BCST_USER_BLOCK2  0x05
00333 #define SLANG_BCST_USER_BLOCK3  0x06
00334 #define SLANG_BCST_USER_BLOCK4  0x07
00335 /* The user blocks MUST be in the above order */
00336 #define SLANG_BCST_LOOP 0x10
00337 #define SLANG_BCST_WHILE        0x11
00338 #define SLANG_BCST_FOR          0x12
00339 #define SLANG_BCST_FOREVER      0x13
00340 #define SLANG_BCST_CFOR 0x14
00341 #define SLANG_BCST_DOWHILE      0x15
00342 #define SLANG_BCST_FOREACH      0x16
00343 #define SLANG_BCST_TRY          0x17
00344 
00345 #define SLANG_BCST_IF           0x20
00346 #define SLANG_BCST_IFNOT        0x21
00347 #define SLANG_BCST_ELSE 0x22
00348 #define SLANG_BCST_ANDELSE      0x23
00349 #define SLANG_BCST_ORELSE       0x24
00350 #define SLANG_BCST_SWITCH       0x25
00351 #define SLANG_BCST_NOTELSE      0x26
00352 
00353 /* assignment (SLANG_BC_SET_*_LVALUE) subtypes.  The order MUST correspond
00354  * to the assignment token order with the ASSIGN_TOKEN as the first!
00355  */
00356 #define SLANG_BCST_ASSIGN               0x01
00357 #define SLANG_BCST_PLUSEQS              0x02
00358 #define SLANG_BCST_MINUSEQS             0x03
00359 #define SLANG_BCST_TIMESEQS             0x04
00360 #define SLANG_BCST_DIVEQS               0x05
00361 #define SLANG_BCST_BOREQS               0x06
00362 #define SLANG_BCST_BANDEQS              0x07
00363 #define SLANG_BCST_PLUSPLUS             0x08
00364 #define SLANG_BCST_POST_PLUSPLUS        0x09
00365 #define SLANG_BCST_MINUSMINUS           0x0A
00366 #define SLANG_BCST_POST_MINUSMINUS      0x0B
00367 
00368 /* These use SLANG_PLUS, SLANG_MINUS, SLANG_PLUSPLUS, etc... */
00369 
00370 
00371 #define LONG_IS_INT (SIZEOF_INT == SIZEOF_LONG)
00372 #define LONG_IS_NOT_INT (SIZEOF_INT != SIZEOF_LONG)
00373 #define SHORT_IS_INT (SIZEOF_INT == SIZEOF_SHORT)
00374 #define SHORT_IS_NOT_INT (SIZEOF_INT != SIZEOF_SHORT)
00375 #define LLONG_IS_LONG (SIZEOF_LONG == SIZEOF_LONG_LONG)
00376 #define LLONG_IS_NOT_LONG (SIZEOF_LONG != SIZEOF_LONG_LONG)
00377 
00378 /* If long or short are ints, then map the slang types to ints.  This is
00379  * done because slang has some optimizations for ints.
00380  */
00381 #if LONG_IS_INT
00382 # define _pSLANG_LONG_TYPE SLANG_INT_TYPE
00383 # define _pSLANG_ULONG_TYPE SLANG_UINT_TYPE
00384 #else
00385 # define _pSLANG_LONG_TYPE SLANG_LONG_TYPE
00386 # define _pSLANG_ULONG_TYPE SLANG_ULONG_TYPE
00387 #endif
00388 #if SHORT_IS_INT
00389 # define _pSLANG_SHORT_TYPE SLANG_INT_TYPE
00390 # define _pSLANG_USHORT_TYPE SLANG_UINT_TYPE
00391 #else
00392 # define _pSLANG_SHORT_TYPE SLANG_SHORT_TYPE
00393 # define _pSLANG_USHORT_TYPE SLANG_USHORT_TYPE
00394 #endif
00395 #if LLONG_IS_LONG
00396 # define _pSLANG_LLONG_TYPE _pSLANG_LONG_TYPE
00397 # define _pSLANG_ULLONG_TYPE _pSLANG_ULONG_TYPE
00398 #else
00399 # define _pSLANG_LLONG_TYPE SLANG_LLONG_TYPE
00400 # define _pSLANG_ULLONG_TYPE SLANG_ULLONG_TYPE
00401 #endif
00402 
00403 /* Map off_t to a slang type */
00404 #if defined(HAVE_LONG_LONG) && (SIZEOF_OFF_T == SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG > SIZEOF_LONG)
00405 # define SLANG_C_OFF_T_TYPE _pSLANG_LLONG_TYPE
00406 typedef long long _pSLc_off_t_Type;
00407 # define SLANG_PUSH_OFF_T SLang_push_long_long
00408 #else
00409 # if (SIZEOF_OFF_T == SIZEOF_INT)
00410 #  define SLANG_C_OFF_T_TYPE SLANG_INT_TYPE
00411 #  define SLANG_PUSH_OFF_T SLang_push_int
00412 typedef int _pSLc_off_t_Type;
00413 # else
00414 #  define SLANG_C_OFF_T_TYPE _pSLANG_LONG_TYPE
00415 #  define SLANG_PUSH_OFF_T SLang_push_long
00416 typedef long _pSLc_off_t_Type;
00417 # endif
00418 #endif
00419 
00420 #if SIZEOF_INT == 2
00421 # define _pSLANG_INT16_TYPE     SLANG_INT_TYPE
00422 # define _pSLANG_UINT16_TYPE    SLANG_UINT_TYPE
00423 #else
00424 # if SIZEOF_SHORT == 2
00425 #  define _pSLANG_INT16_TYPE    SLANG_SHORT_TYPE
00426 #  define _pSLANG_UINT16_TYPE   SLANG_USHORT_TYPE
00427 # else
00428 #  if SIZEOF_LONG == 2
00429 #   define _pSLANG_INT16_TYPE   SLANG_LONG_TYPE
00430 #   define _pSLANG_UINT16_TYPE  SLANG_ULONG_TYPE
00431 #  else
00432 #   define _pSLANG_INT16_TYPE   0
00433 #   define _pSLANG_UINT16_TYPE  0
00434 #  endif
00435 # endif
00436 #endif
00437 
00438 #if SIZEOF_INT == 4
00439 # define _pSLANG_INT32_TYPE     SLANG_INT_TYPE
00440 # define _pSLANG_UINT32_TYPE    SLANG_UINT_TYPE
00441 #else
00442 # if SIZEOF_SHORT == 4
00443 #  define _pSLANG_INT32_TYPE    SLANG_SHORT_TYPE
00444 #  define _pSLANG_UINT32_TYPE   SLANG_USHORT_TYPE
00445 # else
00446 #  if SIZEOF_LONG == 4
00447 #   define _pSLANG_INT32_TYPE   SLANG_LONG_TYPE
00448 #   define _pSLANG_UINT32_TYPE  SLANG_ULONG_TYPE
00449 #  else
00450 #   define _pSLANG_INT32_TYPE   0
00451 #   define _pSLANG_UINT32_TYPE  0
00452 #  endif
00453 # endif
00454 #endif
00455 
00456 #if SIZEOF_INT == 8
00457 # define _pSLANG_INT64_TYPE     SLANG_INT_TYPE
00458 # define _pSLANG_UINT64_TYPE    SLANG_UINT_TYPE
00459 #else
00460 # if SIZEOF_SHORT == 8
00461 #  define _pSLANG_INT64_TYPE    SLANG_SHORT_TYPE
00462 #  define _pSLANG_UINT64_TYPE   SLANG_USHORT_TYPE
00463 # else
00464 #  if SIZEOF_LONG == 8
00465 #   define _pSLANG_INT64_TYPE   SLANG_LONG_TYPE
00466 #   define _pSLANG_UINT64_TYPE  SLANG_ULONG_TYPE
00467 #  else
00468 #   if SIZEOF_LONG_LONG == 8
00469 #    define _pSLANG_INT64_TYPE  SLANG_LLONG_TYPE
00470 #    define _pSLANG_UINT64_TYPE SLANG_ULLONG_TYPE
00471 #   else
00472 #    define _pSLANG_INT64_TYPE  0
00473 #    define _pSLANG_UINT64_TYPE 0
00474 #   endif
00475 #  endif
00476 # endif
00477 #endif
00478 
00479 
00480 typedef union
00481 {
00482 #if SLANG_HAS_FLOAT
00483    double double_val;
00484    float float_val;
00485 #endif
00486 #ifdef HAVE_LONG_LONG
00487    long long llong_val;
00488    unsigned long long ullong_val;
00489 #endif
00490    long long_val;
00491    unsigned long ulong_val;
00492    VOID_STAR ptr_val;
00493    char *s_val;
00494    int int_val;
00495    unsigned int uint_val;
00496    SLang_MMT_Type *ref;
00497    SLang_Name_Type *n_val;
00498    struct _pSLang_Struct_Type *struct_val;
00499    struct _pSLang_Array_Type *array_val;
00500    short short_val;
00501    unsigned short ushort_val;
00502    char char_val;
00503    unsigned char uchar_val;
00504    SLindex_Type index_val;
00505 }
00506 _pSL_Object_Union_Type;
00507 
00508 typedef struct _pSLang_Object_Type
00509 {
00510    SLtype data_type;           /* SLANG_INT_TYPE, ... */
00511    _pSL_Object_Union_Type v;
00512 }
00513 SLang_Object_Type;
00514 
00515 struct _pSLang_MMT_Type
00516 {
00517    SLtype data_type;           /* int, string, etc... */
00518    VOID_STAR user_data;        /* address of user structure */
00519    unsigned int count;                 /* number of references */
00520 };
00521 
00522 extern int _pSLang_pop_object_of_type (SLtype, SLang_Object_Type *, int);
00523 
00524 typedef struct
00525 {
00526    char *name;                         /* slstring */
00527    SLang_Object_Type obj;
00528 }
00529 _pSLstruct_Field_Type;
00530 
00531 typedef struct _pSLang_Struct_Type
00532 {
00533    _pSLstruct_Field_Type *fields;
00534    unsigned int nfields;               /* number used */
00535    unsigned int num_refs;
00536    /* user-defined methods */
00537    SLang_Name_Type *destroy_method;
00538 }
00539 _pSLang_Struct_Type;
00540 
00541 extern void _pSLstruct_delete_struct (_pSLang_Struct_Type *);
00542 extern int _pSLang_push_struct (_pSLang_Struct_Type *);
00543 extern int _pSLang_pop_struct (_pSLang_Struct_Type **);
00544 extern int _pSLstruct_init (void);
00545 /* extern int _pSLstruct_get_field (char *); */
00546 extern int _pSLstruct_define_struct (void);
00547 extern int _pSLstruct_define_typedef (void);
00548 
00549 struct _pSLang_Ref_Type
00550 {
00551    int is_global;
00552    union
00553      {
00554         SLang_Name_Type *nt;
00555         SLang_Object_Type *local_obj;
00556      }
00557    v;
00558 };
00559 
00560 extern int _pSLang_dereference_ref (SLang_Ref_Type *);
00561 extern int _pSLang_deref_assign (SLang_Ref_Type *);
00562 extern int _pSLang_push_ref (int, VOID_STAR);
00563 
00564 extern int _pSL_increment_frame_pointer (void);
00565 extern int _pSL_decrement_frame_pointer (void);
00566 
00567 extern int SLang_pop(SLang_Object_Type *);
00568 extern void SLang_free_object (SLang_Object_Type *);
00569 extern int _pSLanytype_typecast (SLtype, VOID_STAR, unsigned int,
00570                                 SLtype, VOID_STAR);
00571 extern void _pSLstring_intrinsic (void);
00572 
00573 #if 0
00574 /* NULL not allowed here */
00575 extern char *_pSLmalloced_to_slstring (char *, unsigned int);
00576 /* But here it is ok */
00577 extern int _pSLpush_malloced_string (char *, unsigned int);
00578 #endif
00579 
00580 /* These functions are used to create slstrings of a fixed length.  Be
00581  * very careful how they are used.  In particular, if len bytes are allocated,
00582  * then the string must be len characters long, no more and no less.
00583  */
00584 extern char *_pSLallocate_slstring (unsigned int);
00585 extern char *_pSLcreate_via_alloced_slstring (char *, unsigned int);
00586 extern void _pSLunallocate_slstring (char *, unsigned int);
00587 extern int _pSLpush_alloced_slstring (char *, unsigned int);
00588 
00589 
00590 extern unsigned int _pSLstring_bytelen (SLstr_Type *);
00591 extern void _pSLang_free_slstring (SLstr_Type *);   /* slstring required and assumed */
00592 extern unsigned long _pSLstring_get_hash (SLstr_Type *s);   /* slstring required */
00593 
00594 typedef struct 
00595 {
00596    char **buf;
00597    unsigned int max_num;
00598    unsigned int num;
00599    unsigned int delta_num;
00600    int is_malloced;                    /* non-zero if object was malloced */
00601 }
00602 _pSLString_List_Type;
00603 
00604 /* Note that _pSLstring_list_append makes no copy of the object-- it steals it.
00605  * For a copy, use _pSLstring_list_append_copy */
00606 extern int _pSLstring_list_append (_pSLString_List_Type *, char *);
00607 extern int _pSLstring_list_append_copy (_pSLString_List_Type *, char *);
00608 extern int _pSLstring_list_init (_pSLString_List_Type *, unsigned int, unsigned int);
00609 extern _pSLString_List_Type *_pSLstring_list_new (unsigned int, unsigned int);
00610 extern void _pSLstring_list_delete (_pSLString_List_Type *);
00611 extern int _pSLstring_list_push (_pSLString_List_Type *, int);
00612 extern SLang_Array_Type *_pSLstrings_to_array (char **strs, unsigned int n);
00613 
00614 /* This function assumes that s is an slstring. */
00615 extern char *_pSLstring_dup_slstring (char *);
00616 extern int _pSLang_dup_and_push_slstring (char *);
00617 
00618 
00619 extern int _pSLang_init_import (void);
00620 extern int _pSLinit_exceptions (void);
00621 
00622 /* This function checks to see if the referenced object is initialized */
00623 extern int _pSLang_is_ref_initialized (SLang_Ref_Type *);
00624 extern int _pSLcheck_identifier_syntax (char *);
00625 extern int _pSLang_uninitialize_ref (SLang_Ref_Type *);
00626 
00627 extern int _pSLpush_slang_obj (SLang_Object_Type *);
00628 
00629 extern char *_pSLexpand_escaped_char(char *, SLwchar_Type *, int *);
00630 extern void _pSLexpand_escaped_string (char *, char *, char *);
00631 
00632 /* returns a pointer to an SLstring string-- use SLang_free_slstring */
00633 extern char *_pSLstringize_object (SLang_Object_Type *);
00634 extern int _pSLdump_objects (char *, SLang_Object_Type *, unsigned int, int);
00635 
00636 extern SLang_Object_Type *_pSLang_get_run_stack_pointer (void);
00637 extern SLang_Object_Type *_pSLang_get_run_stack_base (void);
00638 extern int _pSLang_dump_stack (void);
00639 extern int _pSLang_peek_at_stack2 (SLtype *);
00640 
00641 struct _pSLang_NameSpace_Type
00642 {
00643    struct _pSLang_NameSpace_Type *next;
00644    char *name;                         /* this is the load_type name */
00645    char *namespace_name;               /* this name is assigned by implements */
00646    char *private_name;
00647    unsigned int table_size;
00648    SLang_Name_Type **table;
00649 };
00650 extern SLang_NameSpace_Type *_pSLns_new_namespace (char *, unsigned int);
00651 extern SLang_NameSpace_Type *_pSLns_allocate_namespace (char *, unsigned int);
00652 extern void _pSLns_deallocate_namespace (SLang_NameSpace_Type *);
00653 extern SLang_NameSpace_Type *_pSLns_find_namespace (char *);
00654 extern int _pSLns_set_namespace_name (SLang_NameSpace_Type *, char *);
00655 extern SLang_Array_Type *_pSLnspace_apropos (SLang_NameSpace_Type *, char *, unsigned int);
00656 extern void _pSLang_use_namespace_intrinsic (char *name);
00657 extern char *_pSLang_cur_namespace_intrinsic (void);
00658 extern SLang_Array_Type *_pSLang_apropos (char *, char *, unsigned int);
00659 extern void _pSLang_implements_intrinsic (char *);
00660 extern SLang_Array_Type *_pSLns_list_namespaces (void);
00661 extern SLang_Name_Type *_pSLns_locate_hashed_name (SLang_NameSpace_Type *, char *, unsigned long);
00662 extern int _pSLns_add_hashed_name (SLang_NameSpace_Type *, SLang_Name_Type *, unsigned long);
00663 extern SLang_NameSpace_Type *_pSLns_find_object_namespace (SLang_Name_Type *nt);
00664 extern SLang_Name_Type *_pSLns_locate_name (SLang_NameSpace_Type *, char *);
00665 extern SLang_NameSpace_Type *_pSLns_get_private_namespace (char *name, char *nsname);
00666 extern SLang_NameSpace_Type *_pSLns_create_namespace2 (char *name, char *nsname);
00667 
00668 extern int _pSLang_Trace;
00669 extern char *_pSLang_current_function_name (void);
00670 
00671 extern int _pSLang_trace_fun(char *);
00672 
00673 /* This is a bitmapped variable */
00674 extern int _pSLang_Compile_Line_Num_Info;
00675 #if SLANG_HAS_BOSEOS
00676 extern int _pSLang_Compile_BOSEOS;
00677 extern int _pSLang_init_boseos (void);
00678 extern int _pSLcall_bos_handler (char *, int);
00679 extern int _pSLcall_eos_handler (void);
00680 extern int _pSLcall_debug_hook (char *file, int linenum);
00681 /* extern int _pSLcall_debug_hook (char *file, int linenum, char *funct); */
00682 #endif
00683 
00684 extern char *_pSLstring_dup_hashed_string (char *, unsigned long);
00685 extern unsigned long _pSLcompute_string_hash (char *);
00686 extern char *_pSLstring_make_hashed_string (char *, unsigned int, unsigned long *);
00687 extern void _pSLfree_hashed_string (char *, unsigned int, unsigned long);
00688 unsigned long _pSLstring_hash (unsigned char *, unsigned char *);
00689 extern int _pSLinit_slcomplex (void);
00690 
00691 extern int _pSLang_init_slstrops (void);
00692 extern int _pSLstrops_do_sprintf_n (int);
00693 extern int _pSLang_sscanf (void);
00694 extern double _pSLang_atof (char *);
00695 extern int _pSLang_init_bstring (void);
00696 extern int _pSLang_init_sltime (void);
00697 extern void _pSLpack (void);
00698 extern void _pSLunpack (char *, SLang_BString_Type *);
00699 extern void _pSLpack_pad_format (char *);
00700 extern unsigned int _pSLpack_compute_size (char *);
00701 extern int _pSLusleep (unsigned long);
00702 
00703 /* frees upon error.  NULL __NOT__ ok. */
00704 extern int _pSLang_push_slstring (char *);
00705 
00706 extern SLtype _pSLarith_promote_type (SLtype);
00707 extern int _pSLarith_get_precedence (SLtype);
00708 extern int _pSLarith_typecast (SLtype, VOID_STAR, unsigned int,
00709                               SLtype, VOID_STAR);
00710 
00711 extern int SLang_push(SLang_Object_Type *);
00712 extern int SLadd_global_variable (char *);
00713 
00714 extern int _pSLdo_pop (void);
00715 extern unsigned int _pSLsys_getkey (void);
00716 extern int _pSLsys_input_pending (int);
00717 #ifdef IBMPC_SYSTEM
00718 extern unsigned int _pSLpc_convert_scancode (unsigned int, unsigned int, int);
00719 #define _pSLTT_KEY_SHIFT        1
00720 #define _pSLTT_KEY_CTRL         2
00721 #define _pSLTT_KEY_ALT          4
00722 #endif
00723 
00724 typedef struct _pSLterminfo_Type SLterminfo_Type;
00725 extern SLterminfo_Type *_pSLtt_tigetent (char *);
00726 extern char *_pSLtt_tigetstr (SLterminfo_Type *, char *);
00727 extern int _pSLtt_tigetnum (SLterminfo_Type *, char *);
00728 extern int _pSLtt_tigetflag (SLterminfo_Type *, char *);
00729 
00730 #if SLTT_HAS_NON_BCE_SUPPORT
00731 extern int _pSLtt_get_bce_color_offset (void);
00732 #endif
00733 extern void (*_pSLtt_color_changed_hook)(void);
00734 
00735 extern unsigned char SLang_Input_Buffer [SL_MAX_INPUT_BUFFER_LEN];
00736 
00737 typedef struct SL_OOBinary_Type
00738 {
00739    SLtype data_type;           /* partner type for binary op */
00740 
00741     int (*binary_function)_PROTO((int,
00742                                  SLtype, VOID_STAR, unsigned int,
00743                                  SLtype, VOID_STAR, unsigned int,
00744                                  VOID_STAR));
00745 
00746    int (*binary_result) _PROTO((int, SLtype, SLtype, SLtype *));
00747    struct SL_OOBinary_Type *next;
00748 }
00749 SL_OOBinary_Type;
00750 
00751 typedef struct _pSL_Typecast_Type
00752 {
00753    SLtype data_type;           /* to_type */
00754    int allow_implicit;
00755 
00756    int (*typecast)_PROTO((SLtype, VOID_STAR, unsigned int,
00757                           SLtype, VOID_STAR));
00758    struct _pSL_Typecast_Type *next;
00759 }
00760 SL_Typecast_Type;
00761 
00762 struct _pSLang_Class_Type
00763 {
00764    SLclass_Type cl_class_type;         /* vector, scalar, mmt, pointer */
00765 
00766    unsigned int cl_data_type;          /* SLANG_INTEGER_TYPE, etc... */
00767    char *cl_name;                              /* slstring type */
00768 
00769    size_t cl_sizeof_type;
00770    VOID_STAR cl_transfer_buf;          /* cl_sizeof_type bytes*/
00771 
00772    /* Methods */
00773 
00774    /* Most of the method functions are prototyped:
00775     * int method (SLtype type, VOID_STAR addr);
00776     * Here, @type@ represents the type of object that the method is asked
00777     * to deal with.  The second parameter @addr@ will contain the ADDRESS of
00778     * the object.  For example, if type is SLANG_INT_TYPE, then @addr@ will
00779     * actually be int *.  Similary, if type is SLANG_STRING_TYPE,
00780     * then @addr@ will contain the address of the string, i.e., char **.
00781     */
00782 
00783    void (*cl_destroy)_PROTO((SLtype, VOID_STAR));
00784    /* Prototype: void destroy(unsigned type, VOID_STAR val)
00785     * Called to delete/free the object */
00786 
00787    char *(*cl_string)_PROTO((SLtype, VOID_STAR));
00788    /* Prototype: char *to_string (SLtype t, VOID_STAR p);
00789     * Here p is a pointer to the object for which a string representation
00790     * is to be returned.  The returned pointer is to be a MALLOCED string.
00791     */
00792 
00793    /* Prototype: void push(SLtype type, VOID_STAR v);
00794     * Push a copy of the object of type @type@ at address @v@ onto the
00795     * stack.
00796     */
00797    int (*cl_push)_PROTO((SLtype, VOID_STAR));
00798 
00799    /* Prototype: int pop(SLtype type, VOID_STAR v);
00800     * Pops value from stack and assign it to object, whose address is @v@.
00801     */
00802    int (*cl_pop)_PROTO((SLtype, VOID_STAR));
00803 
00804    /* mul2, sign, etc... */
00805    int (*cl_unary_op_result_type)_PROTO((int, SLtype, SLtype *));
00806    int (*cl_unary_op)_PROTO((int, SLtype, VOID_STAR, unsigned int, VOID_STAR));
00807 
00808 #if 0
00809    int (*cl_arith_unary_op_result_type)_PROTO((int, SLtype, SLtype *));
00810    int (*cl_arith_unary_op)_PROTO((int, SLtype, VOID_STAR, unsigned int, VOID_STAR));
00811 #endif
00812    int (*cl_app_unary_op_result_type)_PROTO((int, SLtype, SLtype *));
00813    int (*cl_app_unary_op)_PROTO((int, SLtype, VOID_STAR, unsigned int, VOID_STAR));
00814 
00815    /* If this function is non-NULL, it will be called for sin, cos, etc... */
00816 
00817    int (*cl_math_op)_PROTO((int, SLtype, VOID_STAR, unsigned int, VOID_STAR));
00818    int (*cl_math_op_result_type)_PROTO((int, SLtype, SLtype *));
00819 
00820    SL_OOBinary_Type *cl_binary_ops;
00821    SL_Typecast_Type *cl_typecast_funs;
00822 
00823    void (*cl_byte_code_destroy)_PROTO((SLtype, VOID_STAR));
00824    void (*cl_user_destroy_fun)_PROTO((SLtype, VOID_STAR));
00825    int (*cl_init_array_object)_PROTO((SLtype, VOID_STAR));
00826    int (*cl_datatype_deref)_PROTO((SLtype));
00827    SLang_Struct_Type *cl_struct_def;
00828    int (*cl_dereference) _PROTO((SLtype, VOID_STAR));
00829    int (*cl_acopy) (SLtype, VOID_STAR, VOID_STAR);
00830    int (*cl_apop) _PROTO((SLtype, VOID_STAR));
00831    int (*cl_apush) _PROTO((SLtype, VOID_STAR));
00832    int (*cl_push_literal) _PROTO((SLtype, VOID_STAR));
00833    void (*cl_adestroy)_PROTO((SLtype, VOID_STAR));
00834    int (*cl_push_intrinsic)_PROTO((SLtype, VOID_STAR));
00835    int (*cl_void_typecast)_PROTO((SLtype, VOID_STAR, unsigned int, SLtype, VOID_STAR));
00836 
00837    int (*cl_anytype_typecast)_PROTO((SLtype, VOID_STAR, unsigned int, SLtype, VOID_STAR));
00838 
00839    /* Array access functions */
00840    int (*cl_aput) (SLtype, unsigned int);
00841    int (*cl_aget) (SLtype, unsigned int);
00842    int (*cl_anew) (SLtype, unsigned int);
00843 
00844    /* length method */
00845    int (*cl_length) (SLtype, VOID_STAR, unsigned int *);
00846 
00847    /* foreach */
00848    SLang_Foreach_Context_Type *(*cl_foreach_open) (SLtype, unsigned int);
00849    void (*cl_foreach_close) (SLtype, SLang_Foreach_Context_Type *);
00850    int (*cl_foreach) (SLtype, SLang_Foreach_Context_Type *);
00851 
00852    /* Structure access: get and put (assign to) fields */
00853    int (*cl_sput) (SLtype, char *);
00854    int (*cl_sget) (SLtype, char *);
00855 
00856    /* File I/O */
00857    int (*cl_fread) (SLtype, FILE *, VOID_STAR, unsigned int, unsigned int *);
00858    int (*cl_fwrite) (SLtype, FILE *, VOID_STAR, unsigned int, unsigned int *);
00859    int (*cl_fdread) (SLtype, int, VOID_STAR, unsigned int, unsigned int *);
00860    int (*cl_fdwrite) (SLtype, int, VOID_STAR, unsigned int, unsigned int *);
00861 
00862    int (*cl_to_bool) (SLtype, int *);
00863    
00864    int (*cl_cmp)(SLtype, VOID_STAR, VOID_STAR, int *);   
00865    int (*cl_eqs)(SLtype, VOID_STAR, SLtype, VOID_STAR);
00866    SL_OOBinary_Type *cl_void_binary_this;
00867    SL_OOBinary_Type *cl_this_binary_void;
00868    int is_container;
00869 };
00870 
00871 extern int _pSLregister_types (void);
00872 extern SLang_Class_Type *_pSLclass_get_class (SLtype);
00873 extern VOID_STAR _pSLclass_get_ptr_to_value (SLang_Class_Type *, SLang_Object_Type *);
00874 extern void _pSLclass_type_mismatch_error (SLtype, SLtype);
00875 extern int _pSLclass_init (void);
00876 extern int _pSLclass_copy_class (SLtype, SLtype);
00877 
00878 extern int (*_pSLclass_get_typecast (SLtype, SLtype, int))
00879 (SLtype, VOID_STAR, unsigned int,
00880  SLtype, VOID_STAR);
00881 
00882 extern int (*_pSLclass_get_binary_fun (int, SLang_Class_Type *, SLang_Class_Type *, SLang_Class_Type **, int))
00883 (int,
00884  SLtype, VOID_STAR, unsigned int,
00885  SLtype, VOID_STAR, unsigned int,
00886  VOID_STAR);
00887 
00888 extern int (*_pSLclass_get_unary_fun (int, SLang_Class_Type *, SLang_Class_Type **, int))
00889 (int, SLtype, VOID_STAR, unsigned int, VOID_STAR);
00890 
00891 #if 0
00892 extern int _pSLclass_add_arith_unary_op (SLtype type,
00893                                         int (*f)(int,
00894                                                  SLtype, VOID_STAR, unsigned int,
00895                                                  VOID_STAR),
00896                                         int (*r)(int, SLtype, SLtype *));
00897 #endif
00898 
00899 extern int _pSLclass_get_unary_opcode (char *name);
00900 extern int _pSLclass_get_binary_opcode (char *name);
00901 extern int _pSLclass_is_same_obj (SLang_Object_Type *a, SLang_Object_Type *b);
00902 extern int _pSLclass_obj_eqs (SLang_Object_Type *a, SLang_Object_Type *b);
00903 
00904 extern int _pSLarith_register_types (void);
00905 extern SLtype _pSLarith_Arith_Types [];
00906 
00907 extern int _pSLang_ref_is_callable (SLang_Ref_Type *);
00908 extern int _pSLang_is_arith_type (SLtype);
00909 extern void _pSLang_set_arith_type (SLtype, unsigned char);
00910 #if SLANG_OPTIMIZE_FOR_SPEED
00911 extern SLclass_Type