FORM  4.3
Data Structures | Macros | Typedefs | Functions
structs.h File Reference

Go to the source code of this file.

Data Structures

struct  PoSiTiOn
 
struct  STOREHEADER
 
struct  InDeXeNtRy
 
struct  FiLeInDeX
 
struct  FiLeDaTa
 
struct  VaRrEnUm
 
struct  ReNuMbEr
 
struct  LIST
 
struct  KEYWORD
 
struct  KEYWORDV
 
struct  NaMeNode
 
struct  NaMeTree
 
struct  tree
 
struct  MiNmAx
 
struct  BrAcKeTiNdEx
 
struct  BrAcKeTiNfO
 
struct  TaBlEs
 
struct  ExPrEsSiOn
 
struct  SyMbOl
 
struct  InDeX
 
struct  VeCtOr
 
struct  FuNcTiOn
 
struct  SeTs
 
struct  DuBiOuS
 
struct  FaCdOlLaR
 
struct  DoLlArS
 
struct  MoDoPtDoLlArS
 
struct  fixedset
 
struct  TaBlEbAsEsUbInDeX
 
struct  TaBlEbAsE
 
struct  FUN_INFO
 
struct  FiLe
 
struct  StreaM
 
struct  SpecTatoR
 
struct  TrAcEs
 
struct  TrAcEn
 
struct  pReVaR
 
struct  INSIDEINFO
 
struct  PRELOAD
 
struct  PROCEDURE
 
struct  DoLoOp
 
struct  bit_field
 
struct  HANDLERS
 
struct  CbUf
 
struct  ChAnNeL
 
struct  SETUPPARAMETERS
 
struct  NeStInG
 
struct  StOrEcAcHe
 
struct  PeRmUtE
 
struct  PeRmUtEp
 
struct  DiStRiBuTe
 
struct  PaRtI
 
struct  sOrT
 
struct  POLYMOD
 
struct  SHvariables
 
struct  COST
 
struct  MODNUM
 
struct  OPTIMIZE
 
struct  OPTIMIZERESULT
 
struct  DICTIONARY_ELEMENT
 
struct  DICTIONARY
 
struct  SWITCHTABLE
 
struct  SWITCH
 
struct  M_const
 
struct  P_const
 
struct  C_const
 
struct  S_const
 
struct  R_const
 
struct  T_const
 
struct  N_const
 
struct  O_const
 
struct  X_const
 
struct  AllGlobals
 
struct  FixedGlobals
 

Macros

#define INFILEINDEX   ((512-2*sizeof(POSITION))/sizeof(INDEXENTRY))
 
#define EMPTYININDEX   (512-2*sizeof(POSITION)-INFILEINDEX*sizeof(INDEXENTRY))
 
#define PHEAD
 
#define PHEAD0   VOID
 
#define BHEAD
 
#define BHEAD0
 

Typedefs

typedef struct PoSiTiOn POSITION
 
typedef struct InDeXeNtRy INDEXENTRY
 
typedef struct FiLeInDeX FILEINDEX
 
typedef struct FiLeDaTa FILEDATA
 
typedef struct VaRrEnUm VARRENUM
 
typedef struct ReNuMbErRENUMBER
 
typedef struct NaMeNode NAMENODE
 
typedef struct NaMeTree NAMETREE
 
typedef struct tree COMPTREE
 
typedef struct MiNmAx MINMAX
 
typedef struct BrAcKeTiNdEx BRACKETINDEX
 
typedef struct BrAcKeTiNfO BRACKETINFO
 
typedef struct TaBlEsTABLES
 
typedef struct ExPrEsSiOnEXPRESSIONS
 
typedef struct SyMbOlSYMBOLS
 
typedef struct InDeXINDICES
 
typedef struct VeCtOrVECTORS
 
typedef struct FuNcTiOnFUNCTIONS
 
typedef struct SeTsSETS
 
typedef struct DuBiOuSDUBIOUSV
 
typedef struct FaCdOlLaR FACDOLLAR
 
typedef struct DoLlArSDOLLARS
 
typedef struct MoDoPtDoLlArS MODOPTDOLLAR
 
typedef struct fixedset FIXEDSET
 
typedef struct TaBlEbAsEsUbInDeX TABLEBASESUBINDEX
 
typedef struct TaBlEbAsE TABLEBASE
 
typedef struct FiLe FILEHANDLE
 
typedef struct StreaM STREAM
 
typedef struct SpecTatoR SPECTATOR
 
typedef struct TrAcEs TRACES
 
typedef struct TrAcEnTRACEN
 
typedef struct pReVaR PREVAR
 
typedef struct DoLoOp DOLOOP
 
typedef struct bit_field set_of_char[32]
 
typedef struct bit_fieldone_byte
 
typedef WORD(* FINISHUFFLE) (WORD *)
 
typedef WORD(* DO_UFFLE) (WORD *, WORD, WORD, WORD)
 
typedef WORD(* COMPARE) (WORD *, WORD *, WORD)
 
typedef struct CbUf CBUF
 
typedef struct ChAnNeL CHANNEL
 
typedef struct NeStInGNESTING
 
typedef struct StOrEcAcHeSTORECACHE
 
typedef struct PeRmUtE PERM
 
typedef struct PeRmUtEp PERMP
 
typedef struct DiStRiBuTe DISTRIBUTE
 
typedef struct PaRtI PARTI
 
typedef struct sOrT SORTING
 
typedef struct AllGlobals ALLGLOBALS
 
typedef WORD(* WCN) ()
 
typedef WORD(* WCN2) ()
 
typedef struct FixedGlobals FIXEDGLOBALS
 

Functions

 STATIC_ASSERT (sizeof(STOREHEADER)==512)
 
 STATIC_ASSERT (sizeof(FILEINDEX)==512)
 

Detailed Description

Contains definitions for global structs.

!!!CAUTION!!! Changes in this file will most likely have consequences for the recovery mechanism (see checkpoint.c). You need to care for the code in checkpoint.c as well and modify the code there accordingly!

The marker [D] is used in comments in this file to mark pointers to which dynamically allocated memory is assigned by a call to malloc() during runtime (in contrast to pointers that point into already allocated memory). This information is especially helpful if one needs to know which pointers need to be freed (cf. checkpoint.c).

Definition in file structs.h.

Macro Definition Documentation

◆ INFILEINDEX

#define INFILEINDEX   ((512-2*sizeof(POSITION))/sizeof(INDEXENTRY))

Maximum number of entries (struct InDeXeNtRy) in a file index (struct FiLeInDeX). Number is calculated such that the size of a file index is no more than 512 bytes.

Definition at line 118 of file structs.h.

◆ EMPTYININDEX

#define EMPTYININDEX   (512-2*sizeof(POSITION)-INFILEINDEX*sizeof(INDEXENTRY))

Number of empty filling bytes for a file index (struct FiLeInDeX). It is calculated such that the size of a file index is always 512 bytes.

Definition at line 123 of file structs.h.

Typedef Documentation

◆ INDEXENTRY

typedef struct InDeXeNtRy INDEXENTRY

Defines the structure of an entry in a file index (see struct FiLeInDeX).

It represents one expression in the file.

◆ FILEINDEX

typedef struct FiLeInDeX FILEINDEX

Defines the structure of a file index in store-files and save-files.

It contains several entries (see struct InDeXeNtRy) up to a maximum of INFILEINDEX.

The variable number has been made of type POSITION to avoid padding problems with some types of computers/OS and keep system independence of the .sav files.

This struct is always 512 bytes long.

◆ VARRENUM

typedef struct VaRrEnUm VARRENUM

Contains the pointers to an array in which a binary search will be performed.

◆ RENUMBER

typedef struct ReNuMbEr * RENUMBER

Only symb.lo gets dynamically allocated. All other pointers points into this memory.

◆ NAMENODE

typedef struct NaMeNode NAMENODE

The names of variables are kept in an array. Elements of type NAMENODE define a tree (that is kept balanced) that make it easy and fast to look for variables. See also NAMETREE.

◆ NAMETREE

typedef struct NaMeTree NAMETREE

A struct of type NAMETREE controls a complete (balanced) tree of names for the compiler. The compiler maintains several of such trees and the system has been set up in such a way that one could define more of them if we ever want to work with local name spaces.

◆ COMPTREE

typedef struct tree COMPTREE

The subexpressions in the compiler are kept track of in a (balanced) tree to reduce the need for subexpressions and hence save much space in large rhs expressions (like when we have xxxxxxx occurrences of objects like f(x+1,x+1) in which each x+1 becomes a subexpression. The struct that controls this tree is COMPTREE.

◆ TABLES

typedef struct TaBlEs * TABLES

buffers, mm, flags, and prototype are always dynamically allocated, tablepointers only if needed (=0 if unallocated), boomlijst and argtail only for sparse tables.

Allocation is done for both the normal and the stub instance (spare), except for prototype and argtail which share memory.

◆ FUNCTIONS

typedef struct FuNcTiOn * FUNCTIONS

Contains all information about a function. Also used for tables. It is used in the LIST elements of #AC.

◆ FILEHANDLE

typedef struct FiLe FILEHANDLE

The type FILEHANDLE is the struct that controls all relevant information of a file, whether it is open or not. The file may even not yet exist. There is a system of caches (PObuffer) and as long as the information to be written still fits inside the cache the file may never be created. There are variables that can store information about different types of files, like scratch files or sort files. Depending on what is available in the system we may also have information about gzip compression (currently sort file only) or locks (TFORM).

◆ STREAM

typedef struct StreaM STREAM

Input is read from 'streams' which are represented by objects of type STREAM. A stream can be a file, a do-loop, a procedure, the string value of a preprocessor variable ..... When a new stream is opened we have to keep information about where to fall back in the parent stream to allow this to happen even in the middle of reading names etc as would be the case with a`i'b

◆ TRACES

typedef struct TrAcEs TRACES

The struct TRACES keeps track of the progress during the expansion of a 4-dimensional trace. Each time a term gets generated the expansion tree continues in the next statement. When it returns it has to know where to continue. The 4-dimensional traces are more complicated than the n-dimensional traces (see TRACEN) because of the extra tricks that can be used. They are responsible for the shorter final expressions.

◆ TRACEN

typedef struct TrAcEn * TRACEN

The struct TRACEN keeps track of the progress during the expansion of a 4-dimensional trace. Each time a term gets generated the expansion tree continues in the next statement. When it returns it has to know where to continue.

◆ PREVAR

typedef struct pReVaR PREVAR

An element of the type PREVAR is needed for each preprocessor variable.

◆ DOLOOP

typedef struct DoLoOp DOLOOP

Each preprocessor do loop has a struct of type DOLOOP to keep track of all relevant parameters like where the beginning of the loop is, what the boundaries, increment and value of the loop parameter are, etc. Also we keep the whole loop inside a buffer of type PRELOAD

◆ set_of_char

typedef struct bit_field set_of_char[32]

Used in set_in, set_set, set_del and set_sub.

Definition at line 903 of file structs.h.

◆ one_byte

typedef struct bit_field* one_byte

Used in set_in, set_set, set_del and set_sub.

Definition at line 909 of file structs.h.

◆ CBUF

typedef struct CbUf CBUF

The CBUF struct is used by the compiler. It is a compiler buffer of which since version 3.0 there can be many.

◆ CHANNEL

typedef struct ChAnNeL CHANNEL

When we read input from text files we have to remember not only their handle but also their name. This is needed for error messages. Hence we call such a file a channel and reserve a struct of type CHANNEL to allow to lay this link.

◆ NESTING

typedef struct NeStInG * NESTING

The NESTING struct is used when we enter the argument of functions and there is the possibility that we have to change something there. Because functions can be nested we have to keep track of all levels of functions in case we have to move the outer layers to make room for a larger function argument.

◆ STORECACHE

typedef struct StOrEcAcHe * STORECACHE

The struct of type STORECACHE is used by a caching system for reading terms from stored expressions. Each thread should have its own system of caches.

◆ PERM

typedef struct PeRmUtE PERM

The struct PERM is used to generate all permutations when the pattern matcher has to try to match (anti)symmetric functions.

◆ PERMP

typedef struct PeRmUtEp PERMP

Like struct PERM but works with pointers.

◆ DISTRIBUTE

typedef struct DiStRiBuTe DISTRIBUTE

The struct DISTRIBUTE is used to help the pattern matcher when matching antisymmetric tensors.

◆ PARTI

typedef struct PaRtI PARTI

The struct PARTI is used to help determining whether a partition_ function can be replaced.

◆ SORTING

typedef struct sOrT SORTING

The struct SORTING is used to control a sort operation. It includes a small and a large buffer and arrays for keeping track of various stages of the (merge) sorts. Each sort level has its own struct and different levels can have different sizes for its arrays. Also different threads have their own set of SORTING structs.

◆ ALLGLOBALS

typedef struct AllGlobals ALLGLOBALS

Without pthreads (FORM) the ALLGLOBALS struct has all the global variables

◆ FIXEDGLOBALS

typedef struct FixedGlobals FIXEDGLOBALS

The FIXEDGLOBALS struct is an anachronism. It started as the struct with global variables that needed initialization. It contains the elements Operation and OperaFind which define a very early way of automatically jumping to the proper operation. We find the results of it in parts of the file opera.c Later operations were treated differently in a more transparent way. We never changed the existing code. The most important part is currently the cTable which is used intensively in the compiler.