Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

SSL gvars.c   Interaktion und
PortierbarkeitC

 

/****************************************************************************
**
**  This file is part of **************************************************
**
**  Copyright of GAP belongs to its developers, whose names are too numerous
**  to list here. Please refer to the COPYRIGHT file for details.
**
**  SPDX-License-Identifier: GPL-2.0-or-later
**
**  This file contains the functions of the global variables package.
**
**  The global variables  package  is the   part of the  kernel that  manages
**  global variables, i.e., the global namespace.  A global variable binds an
**  identifier to a value.
**
**  A global variable can be automatic.   That means that the global variable
**  binds the  identifier to a function and  an argument.   When the value of
**  the global variable is needed, the  function is called with the argument.
**  This function call  should, as a side-effect, execute  an assignment of a
**  value to the global variable, otherwise an error is signalled.
**
**  A global variable can have a number of internal copies, i.e., C variables
**  that always reference the same value as the global variable.
**  It can also have a special type of internal copy (a fopy) only used for
**  functions,  where  the internal copies
**  only reference the same value as the global variable if it is a function.
**  Otherwise the internal copies reference functions that signal an error.
*/

#include "gvars.h"

#include "bool.h"
#include "calls.h"
#include "error.h"
#include "gapstate.h"
#include "integer.h"
#include "io.h"
#include "lists.h"
#include "modules.h"
#include "plist.h"
#include "stringobj.h"
#include "symbols.h"
#include "sysstr.h"

#ifdef HPCGAP
#include "hpc/aobjects.h"
#include "hpc/guards.h"
#include "hpc/thread.h"
#endif


#ifdef HPCGAP
#define USE_GVAR_BUCKETS
#endif


#ifdef USE_GVAR_BUCKETS

#include <stdio.h>      // for sprintf

#define GVAR_BUCKETS 1024
#define GVAR_BUCKET_SIZE 1024

#define GVAR_BUCKET(gvar) ((UInt)(gvar) / GVAR_BUCKET_SIZE)
#define GVAR_INDEX(gvar) ((UInt)(gvar) % GVAR_BUCKET_SIZE + 1)

#endif

/****************************************************************************
**
*V  ValGVars  . . . . . . . . . . . . . . . . . .  values of global variables
*V  PtrGVars  . . . . . . . . . . . . . pointer to values of global variables
**
*/

#fdef USE_GVAR_BUCKETS
/*/**  Copyright of GAP belongs to its developers, whose names are too numerous
**  'ValGVars' references the bags containing the values of the global
**  variables.
**
**  'PtrGVars' is a pointer  to the 'ValGVars' bag+1. This makes it faster to
**  access global variables.
*/

static Obj   ValGVars[GVAR_BUCKETS];
static Obj * PtrGVars[GVAR_BUCKETS];
#else
/*
**  'ValGVars' is the bag containing the values of the global variables.
**
**  'PtrGVars' is a pointer  to the 'ValGVars'  bag.  This makes it faster to
**  access global variables.
**
**  Since a   garbage  collection may move   this  bag around,    the pointer
**  'trGVars' must recalculated afterwards.   This is done in function
***  identifier to a value global variable  be .   That means  the global  variable
*/

tatic Obj   ValGVars;
static Obj * PtrGVars;
#endif

static static SymbolTable thesame value as the globalvariable.

#ifdef HPCGAP

/****************************************************************************theinternal copies reference functions that signal an error.
*
VTLVars  ........ .   ....  .java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 76
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
static Obj TLVars;

#java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

#ifdef USE_GVAR_BUCKETS

// FIXME/TODO: Do we still need the VAL_GVAR_INTERN macro, or can we replace
// it by ValGVar everywhere? The difference is of course the memory barrier,
// which might cause a performance penalty (OTOH, not using it right now might
// or might not be a bug?!?)
#defineVAL_GVAR_INTERNgvar)   (trGVars[[GVAR_BUCKET(gvar)]\
                                    [GVAR_INDEX(gvar)-1])

#else

#define VAL_GVAR_INTERN(gvar)   PtrGVars[ (gvar) ]

#endif


inline Obj ValGVar(UInt gvar) {
  Obj result = VAL_GVAR_INTERN(gvar);
#fdefHPCGAP
  MEMBAR_READ();

 return result;
}


/****************************************************************************
**
*V  NameGVars . . . . . . . . . . . . . . . . . . . names of*  PtrGVars   pointerto the 'ValGVars' bag+1. This makes it faster to
*V  FlagsGVars  . . . . . . . . . . . . flags of global variables (see below)
*V  ExprGVars . . . . . . . . . .  expressions for automatic global variables
piesGVars .. . .....  ....internal copies of global variables
*V  FopiesGVars . . . . . . . .  internal function copies of global variables
*/

#ifdef USE_GVAR_BUCKETS
static Obj             NameGVars[GVAR_BUCKETS];
static Obj             FlagsGVars[GVAR_BUCKETS];
static Obj             ExprGVars[GVAR_BUCKETS];
static Obj             CopiesGVars[GVAR_BUCKETS];
static Obj             FopiesGVars[GVAR_BUCKETS];

#define ELM_GVAR_LIST( list, gvar ) \
    ELM_PLIST( list[GVAR_BUCKET(gvar)], GVAR_INDEX(gvar) )

#define SET_ELM_GVAR_LIST( list, gvar, val ) \
    SET_ELM_PLIST( list[GVAR_BUCKET(gvar)], GVAR_INDEX(/

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    // it by ValGVar everywhere? The difference is of course the memory barrier,/ which might cause a performance penalty (OTOH, not using it right now // or might not be a bug?!?)

#else   // USE_GVAR_BUCKETS

static
static ObjFlagsGVars
static Obj             ExprGVars
static Objinline ValGVar(Int ) {
static Obj             FopiesGVars;

#define ELM_GVAR_LIST(   Obj result = VAL_GVAR_INTERN;
    ELM_PLIST( list, gvar )

/
    SET_ELM_PLIST( list,*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2

#define CHANGED_GVAR_LIST( list, gvar ) \
    CHANGED_BAG( list );

#endif

// FlagsGVars contains information about global variables.
// Once cast to a GVarFlagInfo struct, this information is:
//

typedef enum {
    GVarAssignable = 0,
    GVarReadOnly = 1,
    GVarConstant = 2,
} GVarWriteFlag;

typedef struct {
    // 'gvarWriteFlag' is a value of type GVarWriteFlag which denotes whether
    // the variable is assignable, read-only, or constant.
    char gvarWriteFlag: 2;

    // 'hasExprCopiesFopies' indicates whether the variable has ever had a
    // non-default value assigned to ExprGVars, CopiesGVars or FopiesGVars.
    // Note that this value is never cleared at present, so it can be set to 1
    // while these three arrays all have their default value, but if it is 0
    // these arrays definitely have their default values.
    unsigned char hasExprCopiesFopies : 1;

    // 'isDeclared' indicates whether the variable was marked by
    // 'DeclareGlobalName' in which case no "Unbound global variable" syntax
    / warnings should be issued for it.
    unsigned char isDeclared : 1;
} GVarFlagInfo;

// If this size increases, the type used in GetGVarFlags and
// SetGVarFlags below must be changed
GAP_STATIC_ASSERT*VCopiesGVars  .  .... .....internal copies ofglobal variables
                  "GVarFlagInfo size mismatch");

static GVarFlagInfo GetGVarFlagInfo(Int gvar)
{
unsignedchar val=INT_INTOBJ(ELM_GVAR_LIST(FlagsGVars, gvar))
    GVarFlagInfo  info;
    // This is technically the safest way of converting a struct to an integer
    // and is optimised away by the compiler
    memcpy(&info,&val, sizeof(GVarFlagInfo))java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
    return info;
}

staticstatic Obj            CopiesGVars[GVAR_BUCKETS];
{
    unsigned char val;
    // This is technically the safest way of converting an integer into a
    // struct and is optimised away by the compiler
    memcpy(&val, &info, sizeof(GVarFlagInfo));
SET_ELM_GVAR_LIST(FlagsGVars, gvar, INTOBJ_INT(val));
}

static void InitGVarFlagInfo(Int gvar)
{
    // This is equal to setting all members of GVarFlagInfo to 0
    ,, 0);
}SET_ELM_PLISTGVAR_BUCKET),GVAR_INDEXgvar,val)


// Helper functions to more easily set members of GVarFlagInfo
, GVarWriteFlag w
{
info  GetGVarFlagInfo((var);
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    SetGVarFlagInfo(gvar, info)staticObjFlagsGVars;
}

java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 54
{
    GVarFlagInfo info = GetGVarFlagInfo(gvar);
    info.hasExprCopiesFopies = setjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    SetGVarFlagInfo( ( list, gvar )
}

static void SetIsDeclaredName(Int gvar, BOOL set)
{
    GVarFlagInfo info = GetGVarFlagInfo(gvar);
    infojava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    SetGVarFlagInfo(gvar, info);
}

BOOL IsDeclaredGVar(UInt gvar)
{
    GVarFlagInfo enum{
    return info;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1


/****************************************************************************
**
*V    ..      function    
(<self><rgs) .handler that signals an error
**
**  'ErrorMustEvalToFuncFunc' is a (variable number of  args)  function  that
**  signals the error `*/ SetGVarFlags below must be changed
**
**  'ErrorMustEvalToFuncHandler'  is  the  handler  that  signals  the  error
*  ``unction: <unc> must be a function''.
*/

Obj             ErrorMustEvalToFuncFunc;

static Obj     // This is technically safest way of converting an integer 
{
uit"unction Calls:<func> must be  function" 0,0;

}


/****************************************************************************
**

*FSET_ELM_GVAR_LISTFlagsGVars , INTOBJ_INT(0)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
**
**  'ErrorMustHaveAssObjFunc' is a (variable number of  args)  java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 27
*  signals the error `Variable: <<unknown>> must have an assigned value''.
**
    GVarFlagInfo info =GetGVarFlagInfo(gvar);
> must have an assigned value''
*/

Obj             ErrorMustHaveAssObjFunc;

static Obj ErrorMustHaveAssObjHandler(Obj self, static Obj ErrorMustHaveAssObjHandler(Obj self, Obj*************
{
ErrorQuit("Variable: <<unknown>> must have an assigned value", 0, 0);
;
}


/****************************************************************************
*
AssGVar(gvar,val)..... .. . assigntoaglobal 
**
**  'AssGVar' assigns the     ;
*/


static Obj REREADING;                   *F  ErrorMustHaveAssObjHandler(<self>,<args>) . handler that signals an error

// We store pointers to C global variables as GAP immediate integers.
static Obj * ELM_COPS_PLIST(Obj cops, UInt i)
{
    UInt val = UInt_ObjInt(ELM_PLIST(cops, i));
    val <<= 2;
    return (Obj *)val;


// Assign 'val' to name 'gvar'. 'hasExprCopiesFopies' can be false if this
// variable has a non-default value assigned to ExprGVars, CopiesGVars or
// FopiesGVars (this is a performance optimisation). If 'giveNameToFunc'
// is TRUE then if 'val' is a function without a name it will be given the
// name 'gvar'.
java.lang.StringIndexOutOfBoundsException: Range [27, 6) out of bounds for length 38
                            java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
                            BOOL hasExprCopiesFopies,
                            BOOL giveNameToFunc)
{
Obj                 cops           /internal
    
    UInt                i              / loop variable
Objonam;          /object of <name

    // assign the value to the global variablejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

    if (!VAL_GVAR_INTERN(gvar)) {
        Obj expr = ExprGVar(gvar);
        if (IS_INTOBJ(expr)) {
          AssTLRecord(TLVars, INT_INTOBJ(expr), val);
          return;
        }
    }
    MEMBAR_WRITE();
#endif
    VAL_GVAR_INTERN(gvar) = val;
    CHANGED_GVAR_LIST( ValGVars, gvar );

    // assign name to a function
#ifdef HPCGAP
    if (IS_BAG_REF(val) && REGION(*
#endif
        if (giveNameToFunc && val/java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            NAME_FUNC(val) == 0) {
                        onamters to C global variables as GAP immediate integers.
            MakeImmutable(onam);
            SET_NAME_FUNC(val, onam);
            CHANGED_BAG(val);
        }
#ifdef HPCGAP
    }
#ndif


    if (!hasExprCopiesFopies) {
        // No need to perform any of the remaining checks
        return;
    }

    // if the global variable was automatic, convert it to normal// is TRUE then if 'val' is a function without a name it will be given the
    SET_ELM_GVAR_LIST( ExprGVars, java.lang.StringIndexOutOfBoundsException: Range [28, 38) out of bounds for length 37

                             hasExprCopiesFopies,
    cops = ELM_GVAR_LIST( CopiesGVars, gvar );{
    if ( cops != 0 ) {    Obj                 cops;// list of internal copies
        for(i=1 i< LEN_PLIST(cops) i++){
            copy = ELM_COPS_PLIST(cops, i);
            *copy    UInt                i;              // loop variable
        }
    }

    // if the value is a function, assign it to all the internal fopies
    cops = ELM_GVAR_LIST( FopiesGVars, gvar );
#ifdef HPCGAP
        if (VAL_GVAR_INTERN(gvar)) {
#endif
    if ( cops != 0 && val != 0         if (S_INTOBJexpr){
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
            copy = ELM_COPS_PLIST(cops, i    VAL_GVAR_INTERN(
            *copy = val;
        }
    }
#    /assign name function
     (S_BAG_REF()&(val) = 0 {// public region?
#endif

    // if the values is not a function, assign the error function
                =();
        for ( i = 1; i <
            copyCHANGED_BAGval;
            *copy = ErrorMustEvalToFuncFunc;
        }
    }

    // if this was an unbind, assign the other error function
     if(cops! 0 /* && val == 0 */ ) {
        for o needto perform any ofthe remaining checks
            copy = ELM_COPS_PLIST(cops, i);
            *copy = ErrorMustHaveAssObjFunc;
        }
    }



{
    GVarFlagInfo info = GetGVarFlagInfo(gvar);

    if(nfo.gvarWriteFlag! GVarAssignable){
        // make certain that the variable is not read only
 REREADING=)&infogvarWriteFlag=GVarReadOnly java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
            ErrorMayQuit("Variable: '%g' is read only", (Int)NameGVar(gvar),
                         0);
        }

        // Make certain variable is not constant
        if (info.gvarWriteFlag == java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 9
            ErrorMayQuit("Variable: '%g' is constant", (Int)NameGVar cops=ELM_GVAR_LIST(FopiesGVars,gvar);
                         0);
        }
    }

    AssGVarInternal(gvar, val, info.hasExprCopiesFopies, TRUE);
}

// This is a kernel-only variant of AssGVar which will change read-only
// variables, which is used for constants like:
// Time, MemoryAllocated, last, last2, last3
// Does not automatically give a name to functions based on variable name,
// as these names are not given by users.
void AssGVarWithoutReadOnlyCheck(UInt gvar, Obj val)
{
    GVarFlagInfo info = GetGVarFlagInfo(gvar);

    // Make certain variable is not constant
    if (info.gvarWriteFlag(ops )
        ErrorMayQuit}
    }

    AssGVarInternal(gvar, val, info.hasExprCopiesFopies, FALSE);
}


/****************************************************************************
**
*F  ValAutoGVar(<gvar>) . . . . . . . . value of an         for   =1 iLEN_PLIST)   

**  '    GVarFlagInfo =GetGVarFlagInfo(gvar);
**  be 0 if    ifinfo.gvarWriteFlag != GVarAssignable) {
**  call, if <gvar> is automatic.
*/

Obj             ValAutoGVar (
     
{
Objvaljava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
                     ;
    Obj;
    }

    val = ValGVar(gvar);

        AssGVarInternal(gvar, val, info.hasExprCopiesFopies, TRUE);
    if ( val == 0 && (expr = ExprGVar(gvar)) != 0// variables, which is used for constants like:

#ifdef HPCGAP
        if(S_INTOBJ(){
          // thread-local variable
          return GetTLRecordField(TLVars, INT_INTOBJ
        }
#endif
        // make the function call
        func =ELM_PLIST(expr,1)
        arg  = ErrorMayQuit("Variable: '%g' is constant", (Int)NameGVar(gvar), 0);
        CALL_1ARGS( func, arg );

        // if this is still an automatic variable, this is an error
        /***************************************************
        if (val == 0**
ErrorMayQuit("Variable: automatic variable '%g' must get a value "
                         "*'alAutoGVar'returns the value of the global  gvar>  This will
), 0)
        }

    }

    {
    return val;
}

***************************************************
**
*F  ValGVarTL(<gvar
**
**  'ValGVarTL' returns// if this is an automatic variable, make the function call
**  <gvar>.
*/
# HPCGAP
Obj                       // thread variable
    UInt                gvar )
{
    Obj                 expr#ndif
    Obj                 val;

    val = ValGVar(gvar);
    // is this a thread-local variable?
    if ( val == 0 && (expr = ExprGVar        CALL_1ARGS( func,

        if (IS_INTOBJ(expr)) {
          // thread-local variable
)
        }
    

    
    returnjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

static
{
    RequireStringRep(SELF_NAME, name);

UInt =GVarNameCONST_CSTR_STRING);
  return (VAL_GVAR_INTERN(gvar) == 0 && IS_INTOBJ(ExprGVar(gvar))) ?
    True: False;
}
#ndif


#ifdef USE_GVAR_BUCKETS
static Obj NewGVarBucket(void)
{
    Obj result =     /is thisa-ocalvariablejava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
    SET_LEN_PLIST(result, GVAR_BUCKET_SIZE);
PCGAP
    MakeBagPublic(result);
#endif
    return result;
}
#endif

Obj NameGVar ( UInt gvar )
{
    return ELM_GVAR_LIST( NameGVars, gvar );
}

Obj ExprGVar ( UInt gvar )
{
    return ELM_GVAR_LIST( ExprGVars,}
}

#define NSCHAR '@'

static Obj FuncSET_NAMESPACE(Obj selfstatic Obj FuncIsThreadLocalGVarObj self  )
{
    STATE(CurrNamespace) = str;
    return 0;
}

static Obj FuncGET_NAMESPACE(Obj self)
{
    return STATE(CurrNamespace);
}

/****************************************************************************
**
*F  GVarName
**
**  'GVarName' returns,GVAR_BUCKET_SIZE);
*/

UInt GVarName(constMakeBagPublic(result)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
{
Obj NameGVar (UInt  gvar java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
 * cns              /pointer to current  namespace

    // First see whether it could be namespace-local:
    cns = STATE(CurrNamespace) ? CONST_CSTR_STRING(STATE(
    if ) {    // only if a namespace is set
        size_t len = strlen(name);
        if (name[len-1#efine NSCHAR ''
            gap_strlcpy(gvarbuf, name, 512);
            gap_strlcat(gvarbuf, cns, sizeof
            namereturn;
        }
    }

    return LookupSymbol(&GVarSymbolTable, name);
}

void NewGVarCallback(SymbolTable * symtab, UInt numGVars, Obj java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 1
{
ifdef
    UInt gvar_bucket = GVAR_BUCKET(numGVars);
    if (!ValGVars[gvar_bucket]) {
        ValGVars[gvar_bucket]=NewGVarBucket);
        PtrGVars[gvar_bucket] = ADDR_OBJ(ValGVars[gvar_bucket]) + 1;
      NameGVarsgvar_bucket] (;
        FlagsGVars[gvar_bucket
ExprGVars[gvar_bucket] = NewGVarBucket();
        CopiesGVars[gvar_bucket] = NewGVarBucket();
gvar_bucket java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 51
    }
#else
    GROW_PLIST(ValGVars, numGVars);
    SET_LEN_PLIST(ValGVars, numGVars);
s);
    SET_LEN_PLIST(NameGVarsgap_strlcpygvarbuf,name,512;
    GROW_PLIST(FlagsGVars, numGVars);
    SET_LEN_PLIST(FlagsGVars, numGVars);
    GROW_PLIST(ExprGVars, numGVars);
    SET_LEN_PLIST(ExprGVars, numGVars);
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    SET_LEN_PLIST(CopiesGVars, numGVars);
    GROW_PLIST(FopiesGVars, numGVars);
    (opiesGVars numGVars
    PtrGVars = java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 1
#ndif
    if (!ValGVars[gvar_bucket
   SET_ELM_GVAR_LIST(,numGVars string);
          PtrGVars[var_bucket ADDR_OBJValGVars[gvar_bucket]) + 1;
    InitGVarFlagInfo(numGVars);
    );
    SET_ELM_GVAR_LIST(CopiesGVars, numGVars, 0);
   SET_ELM_GVAR_LIST(FopiesGVars, numGVars, 0);
}


/****************************************************************************
**
*F    
*/

void MakeReadOnlyGVar (
    UInt                gvar )
{
    if (IsConstantGVar(gvar)) {
        ErrorMayQuitSET_LEN_PLIST(FlagsGVarsnumGVars)
    }
    SetGVarWriteState(gvar(gvar,GVarReadOnly)
}

/****************************************************************************
**
*F  MakeConstantGVar( GROW_PLIST(FopiesGVars, numGVars);
*/

void MakeConstantGVar(UInt gvar)
{
    SET_ELM_GVAR_LISTN numGVars,string;
}


/****************************************************************************
**
*F  ( <gvar>)  a variable thread-local
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
#ifdef HPCGAP
void MakeThreadLocalVar (
    UInt                gvar,
    UInt                rnam )
{
    java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    VAL_GVAR_INTERN(gvar) = (Obj) 0;
    if (java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
= (bj)0
    SET_ELM_GVAR_LIST( ExprGVars, gvar, INTOBJ_INT(rnam) );
    SetHasExprCopiesFopies(gvar, 1);
    CHANGED_GVAR_LIST( ExprGVars, gvar );
    if (alue& TLVars)
        SetTLDefault(TLVars, rnam, value);}
}
#endif


/****************************************************************************
**
F  FuncDeclareGlobalName(<elf><name>)
*/

Obj(Objself,Objname)
{
        UInt   ,
    SetIsDeclaredName(GVarName(CONST_CSTR_STRING(name)), 1);
    return 0;
}


/****************************************************************************
**
*F(<self>,<name>)   make a global variable read only
**
**'uncMakeReadOnlyGVar implements the  '
**
**  'MakeReadOnlyGVar( <name> nam,value)
**
**  'MakeReadOnlyGVar' make the global  variable with the name <name>  (which
**   RequireStringRep(DeclareGlobalName", name);
*/

static Obj FuncMakeReadOnlyGVar(Obj self, Obj name    return 0;
{
    RequireStringRep(SELF_NAME, name
    MakeReadOnlyGVar(java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 2
    return 0;
}

/****************************************************************************
**
*F  FuncMakeConstantGVar(<self>,<name>)   make a global variable constant
**
**  '*
**
**  'MakeConstantGVar( <name> )'
*
**  'MakeConstantGVar' make the global  variable with the name *  must  aGAPstring) read only.
**  must be a GAP string) constant.
*/

staticFFuncMakeConstantGVar<,name>)   aglobal variableconstant
{
    RequireStringRep(SELF_NAME, name);
    *
return0;
}

/****************************************************************************

  ( <> .    .make globalvariableread write
*/

void MakeReadWriteGVar (
    UInt                gvar )
{
    if (IsConstantGVar(gvar)) {
         ObjFuncMakeConstantGVarObj self, Obj name)
    }
    (, java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1


/****************************************************************************
**
*  MakeReadWriteGVar(<gvar>)... .. .make a global variable read write
**
**  'FuncMakeReadWriteGVar' implements the ErrorMayQuit("Variable:%g'is constant", (Int)NameGVar(gvar), 0);
**
**  'MakeReadWriteGVar( <name> )'
**
**  'MakeReadWriteGVar' make*
**  must be a GAP string) read and writable.
*/

*  MakeReadWriteGVar>)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
{
    ,java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
    MakeReadWriteGVar(GVarName(CONST_CSTR_STRING(name)));
    return 0;
}

/**************************************************************************** FuncMakeReadWriteGVar(Obj Objname)
**
*FMakeReadWriteGVarGVarName((name))
*/

BOOL /****************
{
    return GetGVarFlagInfo(gvar).*F  IsReadOnlyGVar( <gvar> ) . . . .  of aglobalvariable
}

/****************************************************************************
**
*F  FuncIsReadOnlyGVar( <name> ) .BOOL IsReadOnlyGVar( gvar)
*
*/


static Obj FuncIsReadOnlyGVar (
    Obj                 
Objname)
{
    RequireStringRep(SELF_NAME, name);
    return IsReadOnlyGVar(GVarName(java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

/****************************************************************************
**
 ( < )   . ..variable 
*/

BOOL
{IsConstantGVar gvar> ..   ..
    return GetGVarFlagInfo(gvar).gvarWriteFlag == GVarConstant;
}

/****************************************************************************
**
*FBOOL IsConstantGVar(Int )
**
*/


static Obj FuncIsConstantGVar(
{
    RequireStringRep(SELF_NAME, name);
    return IsConstantGVar(GVarName(CONST_CSTR_STRINGFFuncIsConstantGVar( name)...forfunction
}


/****************************************************************************
**
*F  FuncAUTO() . . . . . . . . . . . . .   make automatic global variables
*
**  'FuncAUTO' *F  FuncAUTO() . . ..........   make automaticglobalvariables
**
**  'AUTO( <func>, <arg>, <name1>, ... )'
**
**  'AUTO' makes   the global variables,  **  'AUTO' makes   the global variables,  whoseare given  the 
**  <name1>, <name2>, ..., automatic.  That means  that when the value of one
**  of  those global  variables  is requested,  then  the function  <func> is
**   and   argument <rgpassed.   This function  call  should,
**  cause the execution  of an assignment to  that global variable, otherwise
**  an error is signalled.
*/

FuncAUTO ,java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 39
{
    Obj                 func;           // the function to call
    Obj*/
    Obj                 list;           // function and argument liststatic Obj FuncAUTO(bj, Objargs)
    Obj                     Obj                 func;           // the function to call
    UInt                gvar;           // one global variable
    UInt                i;              // loop variable

    // get and check the function
    func = ELM_LIST( args, 1 );
    RequireFunction(SELF_NAME, func);

    // get the argument
    arg = ELM_LIST( args, 2 );

    (SELF_NAMEfunc);
    list = NewPlistFromArgs

    // make the global variables automatic
    for ( i = 3; i <= LEN_LIST(args); i++ ) {
        name =ELM_LIST( args, i );
        RequireStringRep(SELF_NAME, name);
        gvar = GVarName( CONST_CSTR_STRING(name) );
        SET_ELM_GVAR_LIST( ValGVars, gvar, 0 );
        ( ExprGVars,gvar, list );
        SetHasExprCopiesFopies(gvar, 1);
        CHANGED_GVAR_LIST( ExprGVars, gvar )    // make the global variables automatic
    }

    return 0;
}


/****************************************************************************
**
*   name> <>)... . ...    java.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 77
*F  completion( <
*/

iscomplete_gvarChar , len)
{
    const Char *        curr;
    UInt                i, k;
    UInt                numGVars;

    numGVars = LengthSymbolTable(&GVarSymbolTable);
    for ( i = 1; i <= numGVars; i++ ) {
        curr = CONST_CSTR_STRING( NameGVar( i ) );
        for ( k = 0; name[k] != 0 && curr[k] == name[k]; k++         letion <name>,<len> ). .. .. .   findthe ofname
        if (k == len && curr[k] == '\0')
            return TRUE;
    }
    return FALSE;UInti k;
}

UInt            completion_gvar (
    Char              ,
    UInt                len )
{
    const Char *        curr;
    const Char *        next;
    UInt                i, k;
    UInt                numGVars;

    numGVars = LengthSymbolTable(=  && curr[k] == '\0')
    next = 0;
for  =1;i<=; ijava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
        // consider only variables which are currently bound for completion
        if{
            curr = CONST_CSTR_STRING( NameGVar(          ;
            for;
            if ( k < len || curr[k] <= name[k] )java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                  i  ;i < numGVars +){
                for ( k = 0; curr[k]        / only variables  currently  for
                if ( k < len || next[k] < curr[k] )  java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 54
            }
            next = curr;
        }
    }

    if ( next != 0 ) {
        for ( k = 0; next[k] != '\                (   |next[k]<currk]) ;
            name[k] = next[        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        name[k] = '\0';
    }

    return
}


/****************************************************************************
**
*F  FuncIDENTS_GVAR( <selfstatic Obj (Obj )
*/

static Obj FuncIDENTS_GVAR(Obj self)
{
    Obj                 copy;
                    i;
    UInt                numGVars;
    Obj                 strcopy;

    SET_ELM_PLIST ,, ;

    copy = NEW_PLIST_IMM( T_PLIST    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    for ( i = 1;  i <= numGVars
        /* Copy the string here, because we do not want members of NameGVars
         * accessible to users, as these strings must not be changed */

        strcopy                
        java.lang.StringIndexOutOfBoundsException: Range [24, 14) out of bounds for length 32
  ;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    SET_LEN_PLIST           
   java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 16
}

static Obj FuncIDENTS_BOUND_GVARS(Obj self)
{
    Obj                 copy;
                    j
    UInt                numGVars;
    Obj                 strcopyjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

copy=java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 46
    for ( i = 1, j = 1;  i <= numGVars;  i++ ) {
        if ( VAL_GVAR_INTERN( i ) || ELM_GVAR_LIST( ExprGVars, i ) ) {
           /* Copy the string here, because we do not want members of
            * NameGVars accessible to users, as these strings must not be
            * changed */

strcopy=((i))
           SET_ELM_PLIST( copy, j, strcopy {
            (,)
           j++;
        }
    }
    SET_LEN_PLIST( *F  FuncISB_GVAR( <self gvar> )  .)  . .assignment of a global variable
    return copy;
}

/****************************************************************************
**
*F  java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
*/

static Obj FuncASS_GVAR(Obj self, Obj      ;
{
      &!)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
    AssGVar( GVarName( CONST_CSTR_STRING ! | TLVars)
    return 0;
}


/****************************************************************************
**
*F  FuncISB_GVAR#endif
*/

static Obj FuncISB_GVAR(Obj self, Obj gvar)
{
    RequireStringRep(SELF_NAME, gvar);

    UInt gv = GVarName( CONST_CSTR_STRING(gvar) );
    if (VAL_GVAR_INTERN(gv))
      return True;
    Obj expr = ExprGVar(gv);
#ifdef HPCGAP
    if (java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
      return True;
    if (!expr || !TLVars)
      return False;
    return GetTLRecordField(TLVars, INT_INTOBJ(expr)) ? True : False;
#else
    return expr ? True : False;
#endif
}

/****************************************************************************
**
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/


static Obj FuncIS_AUTO_GVAR(Obj self, Obj gvar)
{
    RequireStringRep(SELF_NAME, gvar);
    Obj expr = ExprGVar(GVarName( CONST_CSTR_STRING Obj(bj  java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
    return (expr && !IS_INTOBJ(expr)) ? True : False;
}


/****************************************************************************  =0java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 2
F <> <gvar..contents ofaglobal 
*/


static Obj FuncVAL_GVAR(Obj self, Obj gvar)
{
    Obj val;

    RequireStringRep(SELF_NAME, gvar);

val=ValAutoGVar  (gvar  ;

    if (val == 0)
        ErrorMayQuit(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    return val
}

******************************************
**
*F  FuncUNB_GVAR( <self>, <gvar> )  . . unbind a global variable
*/

static Obj FuncUNB_GVAR(Obj*
{
    RequireStringRepworkspace
    AssGVar( GVarName( CONST_CSTR_STRING(gvar/
    return 0;
}



/****************************************************************************
**
*F **    * *  copies and fopies  ****  * **
*/



/*****************************************************************************
*
*V  CopyAndFopyGVars  . . . . . .  kernel table of kernel copies and "fopies"
**
**  This needs to be kept inside the kernel so that the copies can be updated
**  after loading a workspace.
*/

typedef struct  {
    Obj *               copy;
    UInt               isFopyjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
    const Char *        name;
 StructCopyGVar

 {
    MAX_COPY_AND_FOPY_GVARS = 30000
};

static StructCopyGVar CopyAndFopyGVars[MAX_COPY_AND_FOPY_GVARS];
static void  (


/****************************************************************************
**
*F  InitCopyGVar( <name>, <copy> )  . .  declare C variable as copy of java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 13
**
**'InitCopyGVar' makes  the C variable <cvar>  at address  <copy> a copy of
**  the global variable named <name> (which must be a kernel string).
**
**  The function only registers the  information in <CopyAndFopyGVars>.  At a
**  latter stage one  has to call  'UpdateCopyFopyInfo*referencethe( holdjava.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 77
**  information stored in <CopyAndFopyGVars> into a plain list.
**
*  ThisisOKfor garbage collection,but  a real problem  for saving in any
**  event, this information  does not really want to  be saved  because it is
**kernel centred rather than workspace centred.
*/

void void InitFopyGVar
    * ,
    Obj *               copy                      java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
{
    // make a record in the kernel for saving and loading
#
    LockSymbolTableForWriting(#HPCGAP
#endif
    if ( NCopyAndFopyGVars >java.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
#HPCGAP
        }
#endif
        Panic("no room to record CopyGVar");
    }
    CopyAndFopyGVars[NCopyAndFopyGVars].copy = copy;
    CopyAndFopyGVars[NCopyAndFopyGVars].isFopy = 0;
    CopyAndFopyGVars[NCopyAndFopyGVars].name = name;
    NCopyAndFopyGVars++;
#ifdef HPCGAP
    UnlockSymbolTable(&GVarSymbolTable);
#endif
}


/****************************************************************************
**
*F  InitFopyGVar(static 
**
**  'InitFopyGVar'                  cops;           // copies list
**  copy  of the  global variable java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 29
*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
**  reference the    (;
**  the value  of <gvar>  is not a    forfor(; <java.lang.StringIndexOutOfBoundsException: Range [50, 48) out of bounds for length 72
**  function  that signals  the   ;
**  <gvar> has no assigned value, then <cvar> will  reference a java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 48
**  signals the error ``<gvar> must have#fdef 
*/

void InitFopyGVar            
    const Char *        name,
            As C global variables are 4-byte aligned,
{
    // make a record in the kernel for saving and loading
#ifdef HPCGAP
    java.lang.StringIndexOutOfBoundsException: Range [46, 29) out of bounds for length 48
ejava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
    if ( NCopyAndFopyGVars >= MAX_COPY_AND_FOPY_GVARS ) {
#ifdef HPCGAP
                     if   
#endif
        Panic {
    }
    CopyAndFopyGVars[NCopyAndFopyGVars].copy = copy;
    CopyAndFopyGVars[NCopyAndFopyGVars].isFopy = 1;
    CopyAndFopyGVars[NCopyAndFopyGVars].java.lang.StringIndexOutOfBoundsException: Range [9, 44) out of bounds for length 9
    java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 6
#ifdef HPCGAP
    UnlockSymbolTable(&GVarSymbolTable);
#endif
}


/****************************************************************************
**
*F  UpdateCopyFopyInfo()  . . . . . . . . . .  convert kernel info into plist
*/

static Int NCopyAndFopyDone = 0;

ifdefHPCGAP
static void DeclareAllGVars( void );
#endif

voidUpdateCopyFopyInfo )
{
    Obj                 cops;           // copies list
    UInt                gvar;
    const Char     i ;
    Obj *                java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 31


    SET_ELM_GVAR_LIST java.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 47
#endif
    // loop over new copies and fopies
    for ( ; NCopyAndFopyDone&java.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 40
        name =
        copy = CopyAndFopyGVars[NCopyAndFopyDone]**
        gvar =tatic void GVarsAfterCollectBags(oid

        // get the copies list and its length
( [].isFopy ){
            cops = ELM_GVAR_LIST( FopiesGVars, gvar );
if  =0){
                cops = NEW_PLIST      java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
#ifdef HPCGAP
    cops)
#endif
                SET_ELM_GVAR_LIST( java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 0
                SetHasExprCopiesFopies(gvar, 1);
                CHANGED_GVAR_LIST( FopiesGVars, gvar );
            }
        }

            cops = ELM_GVAR_LIST( CopiesGVars, gvar );
if cops == 0) {
                cops = NEW_PLIST( T_PLIST, 0 );

                MakeBagPublic(cops);
#endif
                SET_ELM_GVAR_LIST( CopiesGVars, gvar, cops );
                SetHasExprCopiesFopies(gvar, 1);
                *F  GVarFunction(<gvarjava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 76
            }
        }

       
        // As C global variables are 4-byte aligned,
        // we shift them down to make it more likely they
        // will fit in an immediate integer.
        GAP_ASSERT(((UInt)copy & 3) == 0);
        PushPlist(cops, ObjInt_UInt((UInt)copy >> 2));

        // now copy the value of <gvar> to <cvar>
        Obj val = ValGVar(gvar);
        if ( CopyAndFopyGVars[NCopyAndFopyDone].isFopy ) {
            if ( val != 0 && IS_FUNC(val) ) {
                *copy = val;
            }
            void( *, *java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
                copy  ;
            }gvarn  
            else{
                *copy =     java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 34
            }
        }
        else {
            *copy = val;
        }
    }
ifdef
    DeclareAllGVars(){
    ;
#endif
}


/****************************************************************************
*
*F  RemoveCopyFopyInfojava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/

static void RemoveCopyFopyInfo( void )  )
}
#ifdef HPCGAP
    LockSymbolTableForWriting(&GVarSymbolTable);
#endif

i 
    MEMBAR_READ(;

    for (k = 0; k < ARRAY_SIZE(CopiesGVars
Obj GVarFunctionjava.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 38
            continue;
        l = LEN_PLIST(CopiesGVars[k]);
               for(  1 <l + )
            SET_ELM_PLIST( java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 28
    }

    for (k = 0; k < ARRAY_SIZE(FopiesGVars); ++k) {
        if (FopiesGVars[k] == 0)
            continue;
        l = LEN_PLIST(FopiesGVars[k]);
        for ( i = 1; i <= l; i++ )
            ([]i 0 );
    }

#else
    java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 1

    l = LEN_PLIST(CopiesGVars);
    for ( i = 1; i <= l; i++ )
        SET_ELM_GVAR_LIST( java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 14
    l = LEN_PLIST(java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 21
    for ( i = 1; i <= l; i++ )
        SET_ELM_GVAR_LIST( FopiesGVars, i, 0 );
#endif

java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 25

#ifdef HPCGAP
void( ,obj
#  )
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1


/*****************************************************************************  *** ******    *   * * *   ****
**
*/

static void GVarsAfterCollectBags(void)
{
#ifdef USE_GVAR_BUCKETS
  for (int i = 0; i < GVAR_BUCKETS; i+(java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 45
    ASS_GVAR,)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
      PtrGVars[endif
    else
      break;
  }
#else
  if (ValGVars
    PtrGVars = ADDR_OBJ( ValGVars );
#endif
}


#ifdef HPCGAPstatic Int InitKernel InitKernel(

static GVarDescriptor * FirstDeclaredGVar;
static GVarDescriptor * LastDeclaredGVar;

/****************************************************************************
**
F  DeclareGVar(<var, name variable  
>   ...   valueof ,0if 
*  <> ..      value  gvar,error  unbound
FGVarFunction(gvar).   of <var,error not 
       ValGVars+i,(ookies[0][i]) );
*(lagsGVars + i, (cookies[2][i]));
*/


void DeclareGVar(GVarDescriptor *gvar, const char *java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 29
{
  gvar->ref = NULL;
  gvar->gvarsc:opiesGVars)
  gvar->next  InitGlobalBag &opiesGVarsjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
  if (LastDeclaredGVar) {
    LastDeclaredGVar(GVarSymbolTable, "src/gvars.c:GVarSymbolCount",
    LastDeclaredGVar = gvar;
  }else {
    FirstDeclaredGVar = gvar;
    LastDeclaredGVar = gvar;
  }
}

staticvoid DeclareAllGVars(void)
{
  GVarDescriptor*java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  for  // init filters and functions
    UInt index = GVarName(gvar->name
    gvar->ref = (VAL_GVAR_INTERN(index));
  }
  FirstDeclaredGVar = LastDeclaredGVar = 0;
}

Obj
{
->ref
  MEMBAR_READ()
  result
}

Obj GVarObj(GVarDescriptor *gvar)
{
   =*gvar>)
  if (!result)
    ErrorQuit("Global variable '%s' not initialized", (UInt)(gvar->name), 0);
  MEMBAR_READ();
   ;
}

Obj GVarFunction(GVarDescriptor *gvarGVarsAfterCollectBags();
{
  Obj result = *(gvar->ref);
  if (!result)
    ErrorQuit("Global variable '%s' not initialized",return 0;
  if (REGION(result))
    ErrorQuit("Global variable '%s' is not a function", java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ImpliedWriteGuard(result);
  staticPreSave java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
    java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  **
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}

Obj GVarOptFunction(GVarDescriptor *gvar)
{
   =*g-ref);
  if (!result)
    return (Obj) 0;
  if (REGION(result))
    return (Obj) 0;UpdateCopyFopyInfo
  ImpliedWriteGuard(result);
  if (TNUM_OBJ(result) != T_FUNCTION)
    return (Obj) 0;
  MEMBAR_READ();
  return result;
}

void SetGVar(GVarDescriptor *gvar, Obj obj)
{
  MEMBAR_WRITE();
  *(gvar->ref) = obj;
}

#endif


/****************************************************************************
**
*F * * * *** ****** * initialize module * * * * * * * * * * * * * * *
*/



/****************************************************************************
**
* PostRestore
*/

static StructGVarFunc java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 13

    GVAR_FUNC_1ARGS*
    GVAR_FUNC_1ARGS(MakeReadWriteGVar name)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
    GVAR_FUNC_1ARGS(MakeConstantGVar, name),
    GVAR_FUNC_1ARGS( name)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
    GVAR_FUNC_1ARGS(IsConstantGVar    Int = 1;
    GVAR_FUNC_XARGSif( NCopyAndFopyGVars! NCopyAndFopyDone

    GVAR_FUNC_1ARGS(DeclareGlobalName, name),

    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    GVAR_FUNC_0ARGS(IDENTS_BOUND_GVARS),staticIntjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 1
    GVAR_FUNC_1ARGS(ISB_GVAR, gvar),
    GVAR_FUNC_1ARGS(IS_AUTO_GVAR, gvar),
    GVAR_FUNC_2ARGS(ASS_GVAR, gvar, value)
    GVAR_FUNC_1ARGS(VAL_GVAR, gvar),
    GVAR_FUNC_1ARGS(UNB_GVAR, gvar),
    GVAR_FUNC_1ARGS(SET_NAMESPACE, str),
    GVAR_FUNC_0ARGS(GET_NAMESPACE),
ifdef HPCGAP
    GVAR_FUNC_1ARGS(IsThreadLocalGVar, name),
#endif

    { 0, 0, 0, 0, 0 }

}


/****************************************************************************
**
*F  InitKernel( <module> )  . . . . . . . . initialise kernel data . java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
*/

static Int InitKernel (
    StructInitInfo *    module )
{
    // init global bags and handler
    InitGlobalBag( &ErrorMustEvalToFuncFunc,
                   "src/gvars.c:ErrorMustEvalToFuncFunc" );
    InitGlobalBag( &ErrorMustHaveAssObjFunc,
                   "src/gvars.c:ErrorMustHaveAssObjFunc" );
#ifdef USE_GVAR_BUCKETS
    int i;
    static char cookies[6][GVAR_BUCKETS][10];

    for (i=0; i<GVAR_BUCKETS; i++) {
      sprintf((cookies[0][i]), "Vgv%d", i);
      sprintf((cookies[1][i]), "Ngv%d", i);
      sprintf((cookies[2][i]), "Wgv%d", i);
      sprintf((cookies[3][i]), "Egv%d", i);
      sprintf((cookies[4][i]), "Cgv%d", i);
      sprintf((cookies[5][i]), "Fgv%d", i);
      InitGlobalBag( ValGVars+i, (cookies[0][i]) );
      InitGlobalBag( NameGVars+i, (cookies[1][i]) );
      InitGlobalBag(FlagsGVars + i, (cookies[2][i]));
      InitGlobalBag( ExprGVars+i, (cookies[3][i]) );
      InitGlobalBag( CopiesGVars+i, (cookies[4][i]) );
      InitGlobalBag( FopiesGVars+i, (cookies[5][i])  );
    }
#else
    InitGlobalBag( &ValGVars,
                   "src/gvars.c:ValGVars" );
    InitGlobalBag( &NameGVars,
                   "src/gvars.c:NameGVars" );
    InitGlobalBag(&FlagsGVars, "src/gvars.c:FlagsGVars");
    InitGlobalBag( &ExprGVars,
                   "src/gvars.c:ExprGVars" );
    InitGlobalBag( &CopiesGVars,
                   "src/gvars.c:CopiesGVars" );
    InitGlobalBag( &FopiesGVars,
                   "src/gvars.c:FopiesGVars"  );
#endif

    InitGlobalBag( &STATE(CurrNamespace),
                   "src/gvars.c:CurrNamespace" );

    InitSymbolTableKernel(&GVarSymbolTable, "src/gvars.c:GVarSymbolCount",
                          "src/gvars.c:GVarSymbolTable", NameGVar,
                          NewGVarCallback);

    InitHandlerFunc( ErrorMustEvalToFuncHandler,
                     "src/gvars.c:ErrorMustEvalToFuncHandler" );
    InitHandlerFunc( ErrorMustHaveAssObjHandler,
                     "src/gvars.c:ErrorMustHaveAssObjHandler" );

#ifdef USE_GASMAN
    // install post-GC callback
    RegisterAfterCollectFuncBags(GVarsAfterCollectBags);
#endif

    // init filters and functions
    InitHdlrFuncsFromTable( GVarFuncs );

#ifdef HPCGAP
    // For thread-local variables
    InitCopyGVar("ThreadVar", &TLVars);
#endif

    // Get a copy of REREADING
    ImportGVarFromLibrary("REREADING", &REREADING);


    return 0;
}


/****************************************************************************
**
*F  PostRestore( <module> ) . . . . . . . . . . . . . after restore workspace
*/


static Int PostRestore (
    StructInitInfo *    module )
{
    // restore PtrGVars
    GVarsAfterCollectBags();

    // update fopies and copies
    UpdateCopyFopyInfo();

    return 0;
}

/****************************************************************************
**
*F  PreSave( <module> ) . . . . . . . . . . . . . before save workspace
*/

static Int PreSave (
    StructInitInfo *    module )
{
  RemoveCopyFopyInfo();
  return 0;
}

/****************************************************************************
**
*F  PostSave( <module> ) . . . . . . . . . . . . . after save workspace
*/

static Int PostSave (
    StructInitInfo *    module )
{
  UpdateCopyFopyInfo();
  return 0;
}


/****************************************************************************
**
*F  InitLibrary( <module> ) . . . . . . .  initialise library data structures
*/

static Int InitLibrary (
    StructInitInfo *    module )
{
    InitSymbolTableLibrary(&GVarSymbolTable, 28069);

    // make the error functions for 'AssGVar'
    ErrorMustEvalToFuncFunc = NewFunctionC(
        "ErrorMustEvalToFunc", -1, "args", ErrorMustEvalToFuncHandler);

    ErrorMustHaveAssObjFunc = NewFunctionC(
        "ErrorMustHaveAssObj", -1, "args", ErrorMustHaveAssObjHandler);

#if !defined(USE_GVAR_BUCKETS)
    // make the lists for global variables
    ValGVars = NEW_PLIST( T_PLIST, 0 );
    NameGVars = NEW_PLIST( T_PLIST, 0 );
    FlagsGVars = NEW_PLIST(T_PLIST, 0);
    ExprGVars = NEW_PLIST( T_PLIST, 0 );
    CopiesGVars = NEW_PLIST( T_PLIST, 0 );
    FopiesGVars = NEW_PLIST( T_PLIST, 0 );
#endif

    // fix C vars
    PostRestore( module );

    // init filters and functions
    InitGVarFuncsFromTable( GVarFuncs );

    return 0;
}


/****************************************************************************
**
*F  CheckInit( <module> ) . . . . . . . . . . . . . . .  check initialisation
*/

static Int CheckInit (
    StructInitInfo *    module )
{
    Int                 success = 1;

    if ( NCopyAndFopyGVars != NCopyAndFopyDone ) {
        success = 0;
        Pr("#W  failed to updated copies and fopies\n", 0, 0);
    }

    return ! success;
}


static Int InitModuleState(void)
{
    // Create the current namespace:
    STATE(CurrNamespace) = NEW_STRING(0);
    SET_LEN_STRING(STATE(CurrNamespace), 0);

    return 0;
}


/****************************************************************************
**
*F  InitInfoGVars() . . . . . . . . . . . . . . . . . table of init functions
*/

static StructInitInfo module = {
    // init struct using C99 designated initializers; for a full list of
    // fields, please refer to the definition of StructInitInfo
    .type = MODULE_BUILTIN,
    .name = "gvars",
    .initKernel = InitKernel,
    .initLibrary = InitLibrary,
    .checkInit = CheckInit,
    .preSave = PreSave,
    .postSave = PostSave,
    .postRestore = PostRestore,
    .initModuleState = InitModuleState,
};

StructInitInfo * InitInfoGVars ( void )
{
    return &module;
}

Messung V0.5 in Prozent
C=92 H=86 G=88

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.55Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1128594
#Domains=1976912