## Attr2String

(misc_lib/miscattr.c:525)
Prototype:

      char *Attr2String(IPAttributeStruct *Attr, int DataFileFormat)

Description:
Routine to convert an attribute to a string.
Parameters:

Attr: | To convert to a string.
--- | ---
DataFileFormat: | If TRUE, the attribute is formated in the IRIT data file format. Otherwise, just the attribute value is returned as a string.

Returned Value:

char *: A pointer to a static string representing/describing the given attribute.

Keywords:
attributes

## AttrCopyAttributes

(misc_lib/miscattr.c:801)
Prototype:

      IPAttributeStruct *AttrCopyAttributes(IPAttributeStruct *Src)

Description:
Routine to copy an attribute list.
Parameters:

Src: | Attribute list to duplicate.
--- | ---

Returned Value:

IPAttributeStruct *: Duplicated attribute list.

Keywords:
attributes

## AttrFindAttribute

(misc_lib/miscattr.c:680)
Prototype:

      IPAttributeStruct *AttrFindAttribute(IPAttributeStruct *Attrs, char *Name)

Description:
Routine to search for an attribute by Name.
Parameters:

Attrs: | Attribute list to search.
--- | ---
Name: | Attribute to search by this name.

Returned Value:

IPAttributeStruct *: Attribute if found, otherwise NULL.

Keywords:
attributes

## AttrFreeAttributes

(misc_lib/miscattr.c:768)
Prototype:

      void AttrFreeAttributes(IPAttributeStruct **Attrs)

Description:
Routine to remove anddelete all attributes of the given Attr list.
Parameters:

Attrs: | To remove and delete.
--- | ---

Returned Value:

void

Keywords:
attributes

## AttrFreeOneAttribute

(misc_lib/miscattr.c:727)
Prototype:

      void AttrFreeOneAttribute(IPAttributeStruct **Attrs, char *Name)

Description:
Routine to remove and delete the attribute named Name from the given Attr list.
Parameters:

Attrs: | To search for an attribute named Name and remove and delete it.
--- | ---
Name: | Name of attribute to remove and delete.

Returned Value:

void

Keywords:
attributes

## AttrGetColor

(misc_lib/miscattr.c:56)
Prototype:

      int AttrGetColor(IPAttributeStruct *Attrs)

Description:
Routine to return a color attribute.
Parameters:

Attrs: | For which we would like to know the color of.
--- | ---

Returned Value:

int: Color or IP_ATTR_NO_COLOR if no color set.

See Also:
AttrSetColor AttrSetRGBColor AttrGetRGBColor AttrSetWidth AttrGetWidth AttrGetIntAttrib AttrGetObjectColor
Keywords:
attributes color

## AttrGetIntAttrib

(misc_lib/miscattr.c:242)
Prototype:

      int AttrGetIntAttrib(IPAttributeStruct *Attrs, char *Name)

Description:
Routine to get an integer attribute.
Parameters:

Attrs: | Attribute list to search for requested attribute.
--- | ---
Name: | Name of requested attribute.

Returned Value:

int: Found attribute, or IP_ATTR_BAD_INT if not found.

See Also:
AttrSetIntAttrib AttrSetPtrAttrib AttrGetPtrAttrib AttrSetRealAttrib AttrGetRealAttrib AttrSetStrAttrib AttrGetStrAttrib
Keywords:
attributes

## AttrGetPtrAttrib

(misc_lib/miscattr.c:313)
Prototype:

      VoidPtr AttrGetPtrAttrib(IPAttributeStruct *Attrs, char *Name)

Description:
Routine to get a pointer attribute.
Parameters:

Attrs: | Attribute list to search for requested attribute.
--- | ---
Name: | Name of requested attribute.

Returned Value:

VoidPtr: Found attribute, or NULL if not found.

See Also:
AttrSetIntAttrib AttrGetIntAttrib AttrSetPtrAttrib AttrSetRealAttrib AttrGetRealAttrib AttrSetStrAttrib AttrGetStrAttrib
Keywords:
attributes

## AttrGetRGBColor

(misc_lib/miscattr.c:118)
Prototype:

      int AttrGetRGBColor(IPAttributeStruct *Attrs, int *Red, int *Green, int *Blue)

Description:
Routine to return a RGB attribute.
Parameters:

Attrs: | For which we would like to know the RGB of.
--- | ---
Red, Green, Blue: | Component of RGB color to initialize.

Returned Value:

int: TRUE if does have an RGB color attribute, FALSE otherwise.

See Also:
AttrSetColor AttrGetColor AttrSetRGBColor AttrSetWidth AttrGetWidth AttrSetIntAttrib AttrGetObjectRGBColor
Keywords:
attributes color rgb

## AttrGetRealAttrib

(misc_lib/miscattr.c:379)
Prototype:

      RealType AttrGetRealAttrib(IPAttributeStruct *Attrs, char *Name)

Description:
Routine to get a RealType attribute.
Parameters:

Attrs: | Attribute list to search for requested attribute.
--- | ---
Name: | Name of requested attribute.

Returned Value:

RealType: Found attribute, or IP_ATTR_BAD_REAL if not found.

See Also:
AttrSetIntAttrib AttrGetIntAttrib AttrSetPtrAttrib AttrGetPtrAttrib AttrSetRealAttrib AttrSetStrAttrib AttrGetStrAttrib
Keywords:
attributes

## AttrGetStrAttrib

(misc_lib/miscattr.c:455)
Prototype:

      char *AttrGetStrAttrib(IPAttributeStruct *Attrs, char *Name)

Description:
Routine to get a string attribute.
Parameters:

Attrs: | Attribute list to search for requested attribute.
--- | ---
Name: | Name of requested attribute.

Returned Value:

char *: Found attribute, or NULL if not found.

See Also:
AttrSetIntAttrib AttrGetIntAttrib AttrSetPtrAttrib AttrGetPtrAttrib AttrSetRealAttrib AttrGetRealAttrib AttrSetStrAttrib
Keywords:
attributes

## AttrGetWidth

(misc_lib/miscattr.c:166)
Prototype:

      RealType AttrGetWidth(IPAttributeStruct *Attrs)

Description:
Routine to return a width attribute.
Parameters:

Attrs: | For which we would like to know the width of.
--- | ---

Returned Value:

RealType: Width or IP_ATTR_NO_WIDTH if no width set.

See Also:
AttrSetColor AttrGetColor AttrSetRGBColor AttrGetRGBColor AttrSetWidth AttrGetRealAttrib AttrGetObjectWidth
Keywords:
attributes width

## AttrResetAttributes

(misc_lib/miscattr.c:630)
Prototype:

      void AttrResetAttributes(IPAttributeStruct **Attrs)

Description:
Routine to initialize the attributes of the given Attr list.
Parameters:

Attrs: | To initialize.
--- | ---

Returned Value:

void

Keywords:
attributes

## AttrReverseAttributes

(misc_lib/miscattr.c:648)
Prototype:

      IPAttributeStruct *AttrReverseAttributes(IPAttributeStruct *Attr)

Description:
Routine to reverse the given Attr list.
Parameters:

Attrs: | To reverse, in place.
--- | ---

Returned Value:

IPAttributeStruct: The reversed list, in place.

Keywords:
attributes

## AttrSetColor

(misc_lib/miscattr.c:34)
Prototype:

      void AttrSetColor(IPAttributeStruct **Attrs, int Color)

Description:
Routine to set a color attribute.
Parameters:

Attrs: | Where to place the color attribute.
--- | ---
Color: | New color.

Returned Value:

void

See Also:
AttrGetColor AttrSetRGBColor AttrGetRGBColor AttrSetWidth AttrGetWidth AttrSetIntAttrib AttrSetObjectColor
Keywords:
attributes color

## AttrSetIntAttrib

(misc_lib/miscattr.c:206)
Prototype:

      void AttrSetIntAttrib(IPAttributeStruct **Attrs, char *Name, int Data)

Description:
Routine to set an integer attribute.
Parameters:

Attrs: | Attribute list where to place new attribute.
--- | ---
Name: | Name of thely introducedattribute
Data: | Ingeter attribute to save.

Returned Value:

void

See Also:
AttrGetIntAttrib AttrSetPtrAttrib AttrGetPtrAttrib AttrSetRealAttrib AttrGetRealAttrib AttrSetStrAttrib AttrGetStrAttrib
Keywords:
attributes

## AttrSetPtrAttrib

(misc_lib/miscattr.c:278)
Prototype:

      void AttrSetPtrAttrib(IPAttributeStruct **Attrs, char *Name, VoidPtr Data)

Description:
Routine to set a pointer attribute.
Parameters:

Attrs: | Attribute list where to place new attribute.
--- | ---
Name: | Name of thely introducedattribute
Data: | Pointer attribute to save.

Returned Value:

void

See Also:
AttrSetIntAttrib AttrGetIntAttrib AttrGetPtrAttrib AttrSetRealAttrib AttrGetRealAttrib AttrSetStrAttrib AttrGetStrAttrib
Keywords:
attributes

## AttrSetRGBColor

(misc_lib/miscattr.c:91)
Prototype:

      void AttrSetRGBColor(IPAttributeStruct **Attrs, int Red, int Green, int Blue)

Description:
Routine to set an RGB color attribute.
Parameters:

Attrs: | Where to place the TGB color attribute.
--- | ---
Red, Green, Blue: | Component of RGB color.

Returned Value:

void

See Also:
AttrSetColor AttrGetColor AttrGetRGBColor AttrSetWidth AttrGetWidth AttrSetIntAttrib AttrSetObjectRGBColor
Keywords:
attributes color rgb

## AttrSetRealAttrib

(misc_lib/miscattr.c:343)
Prototype:

      void AttrSetRealAttrib(IPAttributeStruct **Attrs, char *Name, RealType Data)

Description:
Routine to set a RealType attribute.
Parameters:

Attrs: | Attribute list where to place new attribute.
--- | ---
Name: | Name of thely introducedattribute
Data: | RealType attribute to save.

Returned Value:

void

See Also:
AttrSetIntAttrib AttrGetIntAttrib AttrSetPtrAttrib AttrGetPtrAttrib AttrGetRealAttrib AttrSetStrAttrib AttrGetStrAttrib
Keywords:
attributes

## AttrSetStrAttrib

(misc_lib/miscattr.c:419)
Prototype:

      void AttrSetStrAttrib(IPAttributeStruct **Attrs, char *Name, char *Data)

Description:
Routine to set a string attribute.
Parameters:

Attrs: | Attribute list where to place new attribute.
--- | ---
Name: | Name of thely introducedattribute
Data: | String attribute to save.

Returned Value:

void

See Also:
AttrSetIntAttrib AttrGetIntAttrib AttrSetPtrAttrib AttrGetPtrAttrib AttrSetRealAttrib AttrGetRealAttrib AttrGetStrAttrib
Keywords:
attributes

## AttrSetWidth

(misc_lib/miscattr.c:144)
Prototype:

      void AttrSetWidth(IPAttributeStruct **Attrs, RealType Width)

Description:
Routine to set a width attribute.
Parameters:

Attrs: | Where to place the width attribute.
--- | ---
Width: | New width.

Returned Value:

void

See Also:
AttrSetColor AttrGetColor AttrSetRGBColor AttrGetRGBColor AttrGetWidth AttrSetRealAttrib AttrSetObjectWidth
Keywords:
attributes width

## AttrTraceAttributes

(misc_lib/miscattr.c:488)
Prototype:

      IPAttributeStruct *AttrTraceAttributes(IPAttributeStruct *TraceAttrs,
                                             IPAttributeStruct *FirstAttrs)

Description:
Routine to aid in scanning a list of attributes. If TraceAttrs != NULL, a ptr to its attribute list is saved and the next attribute is returned every call until the end of the list is reached, in which NULL is returned. FirstAttrs should be NULL in all but the first call in the sequence. Attributes with names starting with an underscore '_' are assumed to be temporary or internal and are skipped.
Parameters:

TraceAttrs: | If not NULL, contains the previously returned attribute.
--- | ---
FirstAttrs: | First attribute in list, usually NULL in all but the first invokation in a psuence.

Returned Value:

IPAttributeStruct *: Next attribute in list.

Keywords:
attributes

## Config

(misc_lib/config.c:115)
Prototype:

      void Config(char *PrgmName, ConfigStruct *SetUp, int NumVar)

Description:
Main routine of configuration file handling. Gets the program name, PrgmName, and the configuration data base that defines the acceptable variables, Setup, with Numvarentries.
Parameters:

PrgmName: | Name of program that uses this data base.
--- | ---
SetUp: | Configuration data based.
NumVar: | Number of entries on configuration data base.

Returned Value:

void

Keywords:
configuration cfg files

## ConfigPrint

(misc_lib/config.c:61)
Prototype:

      void ConfigPrint(ConfigStruct *SetUp, int NumVar)

Description:
Routine to print the current configuration data structure contents.
Parameters:

SetUp: | Configuration data based.
--- | ---
NumVar: | Number of entries on configuration data base.

Returned Value:

void

Keywords:
configuration cfg files

## DistPoint1DWithEnergy

(misc_lib/dist_pts.c:42)
Prototype:

      RealType *DistPoint1DWithEnergy(int N,
                                      RealType XMin,
                                      RealType XMax,
                                      int Resolution,
                                      DistEnergy1DFuncType EnergyFunc)

Description:
Distributes N points with a given energy in the region in the X line that is bounded by XMin, XMax. Energy is specified via the EnergyFunc that recieves the X location. Resolution * N specifies how many samples to take from EnergyFunc. Returns an array of N distributed points. The solution to the distribution is analythic provided EnergyFunc can be integrated. Herein, this integral is computed nomerically.
Parameters:

N: | Number of points to distribute,
--- | ---
XMin: | Minimum of domain to distribute points.
XMax: | Minimum of domain to distribute points.
Resolution: | Fineness of integral calculation.
EnergyFunc: | Energy function to use.

Returned Value:

RealType *: A vector of N points distributed as requested.

Keywords:
point distribution

## GAGetArgs

(misc_lib/getarg.c:198)
Prototype:

      int GAGetArgs(int va_alist, ...)

Description:
Routine to access command line arguments and interpret them, by getting access to the main routine's argc/argv interface and a control string that prescribes the expected options. Returns ARG_OK (0) is case of succesfull parsing, error code else... Format of CtrlStr format: The control string passed to GAGetArgs controls the way argv (argc) are parsed. Each entry in this string must have no spaces in it. The First Entry is the name of the program which is usually ignored except when GAPrintHowTo is called. All the other entries (except the last one which will be discussed shortly) must have the following format: 1. One letter which sets the option letter (i.e. 'x' for option '-x'). 2. '!' or '%' to determines if this option is really optional ('%') or it must be provided by the user ('!'). 3. '-' always. 4. Alpha numeric string, usually ignored, but used by GAPrintHowTo to describe the meaning of this option. 5. Sequences that start with either '!' or '%'. Again if '!' then this sequence must exists (only if its option flag is given), and if '%' it is optional. Each sequence will be followed by one or two characters which defines the kind of the input: 5.1. d, x, o, u - integer is expected (decimal, hex, octal base or unsigned). 5.2. D, X, O, U - long integer is expected (same as above). 5.3. f - float number is expected. 5.4. F - double number is expected. 5.5. s - string is expected. 5.6. *? - any number of '?' kind (d, x, o, u, D, X, O, U, f, F, s) will match this one. If '?' is numeric, it scans until none numeric input is given. If '?' is 's' then it scans up to the next option or end of argv. If the last parameter given in the CtrlStr, is not an option (i.e. the second char is not in ['!', '%'] and the third one is not '-'), all what remained from argv is hooked to it. The variables passed to GAGetArgs (starting from 4th parameter) MUST match the order of options in the CtrlStr. For each option, an address of an integer must be passed. This integer must initialized by 0. If that option is given in the command line, it will be set to one. Otherwise, this integer will not be affected. In addition, the sequences that might follow an option require the following parameter(s) to be passed 1. d, x, o, u - pointer to an integer (int *). 2. D, X, O, U - pointer to a long (long *). 3. f - pointer to a float (float *). 4. F - pointer to a double (double *). 5. s - pointer to a char * (char **). NO pre-allocation is required. 6. *? - TWO variables are passed for each such wild character request. The first variable is an address of an integer, and it will return the number of parameters actually hooked to this sequence. The second variable is a pointer to a pointer to type ? (? **). It will return an address of a vector of pointers of type ?, terminated with a NULL pointer. NO pre-allocation is required. These two variables behaves very much like the argv/argc pair and are used the "trap" unused command line options. Examples:

       "Example1  i%-OneInteger!d  s%-Strings!*s  j%-  k!-Float!f  Files!*s"
    Will match: Example1 -i 77 -s String1 String2 String3 -k 88.2 File1 File2
      or match: Example1 -s String1 -k 88.3 -i 999 -j
       but not: Example1 -i 77 78 (i expects one integer, k must be specified).

The option k must exists in the above example and if '-i' is prescribed one integer argument must follow it. In the first example, File1 & File2, will match Files in the control string. The order of the options in the command line is irrelevant. A call to GAPrintHowTo with this CtrlStr will print to stderr:

    Example1 [-i OneIngeter] [-s Strings...] [-j] -k Float Files...

The parameters below are stdarg style and in fact are expecting the following:

      GAGetArgs(argc, argv, CtrlStr, ...);

1. argc, argv: The usual C interface from the main routine of the program. 2. CtrlStr: Defining the types/options to expect in the command line. 3. ...: list of addreses of variables to initialize according to parsed command line.
Parameters:

va_alist: | Do "man stdarg".
--- | ---
...: | Rest of optional parameters

Returned Value:

int: TRUE if command line was valid, FALSE otherwise.

Keywords:
command line arguments

## GAPrintErrMsg

(misc_lib/getarg.c:711)
Prototype:

      void GAPrintErrMsg(int Error)

Description:
Routine to print a description of an error to stderr, for this module:
Parameters:

Error: | Error type as returned by GAGetArgs.
--- | ---

Returned Value:

void

Keywords:
command line arguments

## GAPrintHowTo

(misc_lib/getarg.c:754)
Prototype:

      void GAPrintHowTo(char *CtrlStr)

Description:
Routine to print the correct format of command line allowed, to stderr. For example, for the following control string,

       "Example1  i%-OneInteger!d  s%-Strings!*s  j%-  k!-Float!f  Files"

This routine will print

##

    Example1 [-i OneIngeter] [-s Strings...] [-j] -k Float Files...

    Parameters:

     CtrlStr:    Defining the types/options to expect in the command line.

    Returned Value:

      void

    Keywords:

      command line arguments

     IritCPUTime   (misc_lib/xgeneral.c:236)

    Prototype:

      RealType IritCPUTime(int Reset)

    Description:

Routine to compute the cpu time of the running process.
Parameters:

Reset: | If TRUE, clock is reset back to zero.
--- | ---

Returned Value:

RealType: CPU time since last reset or beginning of execution.

Keywords:
time

## IritDebugMallocReset

(misc_lib/imalloc.c:555)
Prototype:

      void IritDebugMallocAllocated(void)

Description:
Prints the currently allocated memory blocks. This function will take affect iff IritDebugMalloc is non zero as set via "IRIT_MALLOC" env.
Parameters:

None

Returned Value:

void

See Also:
IritFree IritMalloc IritRealloc IritTestAllDynMemory IritDebugMallocReset IritDebugMallocSearchPtr
Keywords:

## IritDebugMallocReset

(misc_lib/imalloc.c:499)
Prototype:

      void IritDebugMallocReset(void)

Description:
Reset the malloc debugging code. This function will reset the malloc debuging code iff IritDebugMalloc is TRUE as set via "IRIT_MALLOC" env.
Parameters:

None

Returned Value:

void

See Also:
IritFree IritMalloc IritRealloc IritTestAllDynMemory IritDebugMallocSearchPtr IritDebugMallocAllocated
Keywords:

## IritDebugMallocReset

(misc_lib/imalloc.c:531)
Prototype:

      void IritDebugMallocSearchPtr(VoidPtr p, int Abort)

Description:
Set the searched malloced pointer. This function will take affect iff IritDebugMalloc is non zero as set via "IRIT_MALLOC" env.
Parameters:

p: | The pointer to search for.
--- | ---
Abort: | If TRUE, we also abort() once searched pointer is detected.

Returned Value:

void

See Also:
IritFree IritMalloc IritRealloc IritTestAllDynMemory IritDebugMallocSearchPtr IritDebugMallocAllocated
Keywords:

## IritFatalError

(misc_lib/irit_ftl.c:26)
Prototype:

      void IritFatalError(char *Msg)

Description:
Default trap for IRIT programs for irit fatal errors. This function just prints the given error message and die.
Parameters:

Msg: | Error message to print.
--- | ---

Returned Value:

void

Keywords:
error trap

## IritFree

(misc_lib/imalloc.c:378)
Prototype:

      void IritFree(VoidPtr p)

Description:
Routine to free dynamic memory for all IRIT program/tool/libraries. All requests to free dynamic memory should invoke this function. If the environment variable "IRIT_MALLOC" is set when an IRIT program is executed, the consistency of the dynamic memory is tested on every invokation of this routine. See IritTestAllDynMemory function for more.
Parameters:

p: | Pointer to a block that needs to be freed.
--- | ---

Returned Value:

void

See Also:
IritMalloc IritRealloc IritTestAllDynMemory IritDebugMallocReset IritDebugMallocSearchPtr IritDebugMallocAllocated
Keywords:
allocation

## IritMalloc

(misc_lib/imalloc.c:256)
Prototype:

      VoidPtr IritMalloc(unsigned Size, char *ObjType, char *FileName, int LineNum)
      VoidPtr IritMalloc(unsigned Size)

Description:
Routine to allocate dynamic memory for all IRIT program/tool/libraries. All requests for dynamic memory should invoke this function. If the environment variable "IRIT_MALLOC" is set when an IRIT program is executed, the consistency of the dynamic memory is tested on every invokation of this routine. See IritTestAllDynMemory function for more.
Parameters:

Size: | Size of block to allocate, in bytes.
--- | ---
ObjType: | This variable exists iff "#define MALLOC_DEBUG_INFO". This holds the object descriptions.
FileName: | his variable exists iff "#define MALLOC_DEBUG_INFO". This holds the file name where the call is invoked from.
LineNum: | This variable exists iff "#define MALLOC_DEBUG_INFO". This holds the line number where the call is invoked from.

Returned Value:

VoidPtr: A pointer to the allocated block. A function calling this may assume return value will never be NULL, since no more memory cases are trapped locally.

See Also:
IritFree IritRealloc IritTestAllDynMemory IritDebugMallocReset IritDebugMallocSearchPtr IritDebugMallocAllocated
Keywords:
allocation

## IritRandom

(misc_lib/xgeneral.c:202)
Prototype:

      RealType IritRandom(RealType Min, RealType Max)

Description:
Routine to compute a random number in a specified range. See also IritRandomInit.
Parameters:

Min: | Minimum range of random number requested.
--- | ---
Max: | Maximum range of random number requested.

Returned Value:

RealType: A random number between Min andMax.

Keywords:
random numbers

## IritRandomInit

(misc_lib/xgeneral.c:174)
Prototype:

      void IritRandomInit(long Seed)

Description:
Routine to initialize the random number generator.
Parameters:

Seed: | To initialize the random number generator with.
--- | ---

Returned Value:

void

Keywords:
random numbers

## IritRealTimeDate

(misc_lib/xgeneral.c:303)
Prototype:

      char *IritRealTimeDate(void)

Description:
Routine to create and return a string describing current date and time.
Parameters:

None

Returned Value:

char *: A string describing current date and time.

Keywords:
date time

## IritRealloc

(misc_lib/imalloc.c:211)
Prototype:

      VoidPtr IritRealloc(VoidPtr p, unsigned Size)

Description:
Routine to reallocate dynamic memory for all IRIT program/tool/libraries. All requests for dynamic memory should invoke this function. If the environment variable "IRIT_MALLOC" is set when an IRIT program is executed, the consistency of the dynamic memory is tested on every invokation of this routine. See IritTestAllDynMemory function for more.
Parameters:

p: | Old pointer to reallocate.
--- | ---
Size: | Size of block to allocate, in bytes.

Returned Value:

VoidPtr: A pointer to the allocated block. A function calling this may assume return value will never be NULL, since no more memory cases are trapped locally.

See Also:
IritFree IritMalloc IritTestAllDynMemory IritDebugMallocReset IritDebugMallocSearchPtr IritDebugMallocAllocated
Keywords:
allocation

## IritSleep

(misc_lib/xgeneral.c:96)
Prototype:

      void IritSleep(int MilliSeconds)

Description:
Routine to force a process to sleep.
Parameters:

MilliSeconds: | Sleeping time required, in miliseconds.
--- | ---

Returned Value:

void

Keywords:
sleep

## IritStrdup

(misc_lib/xgeneral.c:54)
Prototype:

      char *IritStrdup(char *s)

Description:
Routine to duplicate a string. Exists in some computer environments.
Parameters:

s: | String to duplicate.
--- | ---

Returned Value:

char *: Duplicated string.

Keywords:
strdup

## IritTestAllDynMemory

(misc_lib/imalloc.c:113)
Prototype:

      void IritTestAllDynMemory(int PrintAllAlloc)

Description:
Tests for error in dynamically allocated memory, without affecting any such allocation or allocated blocks. This routine may be used only if "IRIT_MALLOC" environment variable is set for debugging purposes and it obviously slows down running time. The following tests are being made on every block allocated, and messages are printed to stderr as needed: 1. Overwriting beyond the end of the allocated block. 2. Overwriting below the beginning of the allocated block. 3. Freeing an unallocated pointer. 4. Freeing the same pointer twice. 5. If "IRIT_MALLOC_PTR" environment variable is set to an address, this address is being search for during allocation (IritMalloc) and announced when detected. If this function is compiled with '#define MALLOC_DEBUG_INFO' more information is printed regarding the allocating location (filename/line number) as well as the object type involved. This also introduce some delay into the allocation process.
Parameters:

PrintAllAlloc: | If TRUE, prints information all all allocated block, not just block with errors.
--- | ---

Returned Value:

void

See Also:
IritFree IritMalloc IritRealloc IritDebugMallocReset IritDebugMallocSearchPtr IritDebugMallocAllocated
Keywords:
allocation

## IritWarningError

(misc_lib/irit_wrn.c:26)
Prototype:

      void IritWarningError(char *Msg)

Description:
Default trap for IRIT programs for irit warning errors. This function just prints the given error message.
Parameters:

Msg: | Error message to print.
--- | ---

Returned Value:

void

Keywords:
error trap

## MatAddTwo4by4

(misc_lib/genmat.c:291)
Prototype:

      void MatAddTwo4by4(MatrixType MatRes, MatrixType Mat1, MatrixType Mat2)

Description:
Routine to add 2 4by4 matrices. MatRes may be one of Mat1 or Mat2.
Parameters:

MatRes: | Result of matrix addition.
--- | ---
Mat1, Mat2: | The two operand of the matrix addition.

Returned Value:

void

Keywords:
transformations matrix addition

## MatGenMatRotX

(misc_lib/genmat.c:140)
Prototype:

      void MatGenMatRotX(RealType CosTeta, RealType SinTeta, MatrixType Mat)

Description:
Routine to generate a 4*4 matrix to Rotate around the X axis by Teta, given the sin and cosine of Teta
Parameters:

SinTeta, CosTeta: | Amount of rotation, given as sine and cosine of Teta.
--- | ---
Mat: | Matrix to initialize as a rotation matrix.

Returned Value:

void

Keywords:
transformations rotation

## MatGenMatRotX1

(misc_lib/genmat.c:116)
Prototype:

      void MatGenMatRotX1(RealType Teta, MatrixType Mat)

Description:
Routine to generate a 4*4 matrix to Rotate around the X axis by Teta radians.
Parameters:

Teta: | Amount of rotation, in radians.
--- | ---
Mat: | Matrix to initialize as a rotation matrix.

Returned Value:

void

Keywords:
transformations rotation

## MatGenMatRotY

(misc_lib/genmat.c:188)
Prototype:

      void MatGenMatRotY(RealType CosTeta, RealType SinTeta, MatrixType Mat)

Description:
Routine to generate a 4*4 matrix to Rotate around the Y axis by Teta, given the sin and cosine of Teta
Parameters:

SinTeta, CosTeta: | Amount of rotation, given as sine and cosine of Teta.
--- | ---
Mat: | Matrix to initialize as a rotation matrix.

Returned Value:

void

Keywords:
transformations rotation

## MatGenMatRotY1

(misc_lib/genmat.c:164)
Prototype:

      void MatGenMatRotY1(RealType Teta, MatrixType Mat)

Description:
Routine to generate a 4*4 matrix to Rotate around the Y axis by Teta radians.
Parameters:

Teta: | Amount of rotation, in radians.
--- | ---
Mat: | Matrix to initialize as a rotation matrix.

Returned Value:

void

Keywords:
transformations rotation

## MatGenMatRotZ

(misc_lib/genmat.c:236)
Prototype:

      void MatGenMatRotZ(RealType CosTeta, RealType SinTeta, MatrixType Mat)

Description:
Routine to generate a 4*4 matrix to Rotate around the Z axis by Teta, given the sin and cosine of Teta
Parameters:

SinTeta, CosTeta: | Amount of rotation, given as sine and cosine of Teta.
--- | ---
Mat: | Matrix to initialize as a rotation matrix.

Returned Value:

void

Keywords:
transformations rotation

## MatGenMatRotZ1

(misc_lib/genmat.c:212)
Prototype:

      void MatGenMatRotZ1(RealType Teta, MatrixType Mat)

Description:
Routine to generate a 4*4 matrix to Rotate around the Z axis by Teta radians.
Parameters:

Teta: | Amount of rotation, in radians.
--- | ---
Mat: | Matrix to initialize as a rotation matrix.

Returned Value:

void

Keywords:
transformations rotation

## MatGenMatScale

(misc_lib/genmat.c:74)
Prototype:

      void MatGenMatScale(RealType Sx, RealType Sy, RealType Sz, MatrixType Mat)

Description:
Routine to generate a 4*4 matrix to Scale x, y, z in Sx, Sy, Sz amounts.
Parameters:

Sx, Sy, Sz: | Scaling factors requested.
--- | ---
Mat: | Matrix to initialize as a scaling matrix.

Returned Value:

void

Keywords:
transformations scaling

## MatGenMatTrans

(misc_lib/genmat.c:52)
Prototype:

      void MatGenMatTrans(RealType Tx, RealType Ty, RealType Tz, MatrixType Mat)

Description:
Routine to generate a 4*4 matrix to translate in Tx, Ty, Tz amounts.
Parameters:

Tx, Ty, Tz: | Translational amounts requested.
--- | ---
Mat: | Matrix to initialize as a translation matrix.

Returned Value:

void

Keywords:
transformations translation

## MatGenMatUnifScale

(misc_lib/genmat.c:96)
Prototype:

      void MatGenMatUnifScale(RealType Scale, MatrixType Mat)

Description:
Routine to generate a 4*4 matrix to uniformly scale Scale amount.
Parameters:

Scale: | Uniform scaling factor requested.
--- | ---
Mat: | Matrix to initialize as a scaling matrix.

Returned Value:

void

Keywords:
transformations scaling

## MatGenUnitMat

(misc_lib/genmat.c:26)
Prototype:

      void MatGenUnitMat(MatrixType Mat)

Description:
Routine to generate a 4*4 unit matrix:
Parameters:

Mat: | Matrix to initialize as a unit matrix.
--- | ---

Returned Value:

void

Keywords:
transformations unit matrix

## MatInverseMatrix

(misc_lib/genmat.c:436)
Prototype:

      int MatInverseMatrix(MatrixType M, MatrixType InvM)

Description:
Routine to compute the INVERSE of a given matrix M which is not modified. The matrix is assumed to be 4 by 4 (transformation matrix). Return TRUE if inverted matrix (InvM) do exists.
Parameters:

M: | Original matrix to invert.
--- | ---
InvM: | Inverted matrix will be placed here.

Returned Value:

int: TRUE if inverse exists, FALSE otherwise.

Keywords:
transformations matrix inverse

## MatMultTwo4by4

(misc_lib/genmat.c:260)
Prototype:

      void MatMultTwo4by4(MatrixType MatRes, MatrixType Mat1, MatrixType Mat2)

Description:
Routine to multiply 2 4by4 matrices. MatRes may be one of Mat1 or Mat2 - it is only updated in the end.
Parameters:

MatRes: | Result of matrix product.
--- | ---
Mat1, Mat2: | The two operand of the matrix product.

Returned Value:

void

Keywords:
transformations matrix product

## MatMultVecby4by4

(misc_lib/genmat.c:366)
Prototype:

      void MatMultVecby4by4(VectorType VRes, VectorType Vec, MatrixType Mat)

Description:
Routine to multiply an XYZ Vector by 4by4 matrix: The Vector has only 3 components (X, Y, Z) and it is assumed that W = 1 VRes may be Vec as it is only updated in the end.
Parameters:

VRes: | Result of vector - matrix product.
--- | ---
Vec: | Vector to transfrom using Matrix.
Mat: | Transformation matrix.

Returned Value:

void

Keywords:
transformations vector matrix product

## MatMultWVecby4by4

(misc_lib/genmat.c:405)
Prototype:

      void MatMultWVecby4by4(RealType VRes[4], RealType Vec[4], MatrixType Mat)

Description:
Routine to multiply a WXYZ Vector by 4by4 matrix: The Vector has only 4 components (W, X, Y, Z). VRes may be Vec as it is only updated in the end.
Parameters:

VRes: | Result of vector - matrix product.
--- | ---
Vec: | Vector to transfrom using Matrix.
Mat: | Transformation matrix.

Returned Value:

void

Keywords:
transformations vector matrix product

## MatScale4by4

(misc_lib/genmat.c:340)
Prototype:

      void MatScale4by4(MatrixType MatRes, MatrixType Mat, RealType *Scale)

Description:
Routine to scale a 4by4 matrix. MatRes may be Mat.
Parameters:

MatRes: | Result of matrix scaling.
--- | ---
Mat: | The two operand of the matrix scaling.
Scale: | Scalar value to multiple matrix with.

Returned Value:

void

Keywords:
transformations matrix scaling

## MatScaleFactorMatrix

(misc_lib/genmat.c:505)
Prototype:

      RealType MatScaleFactorMatrix(MatrixType M)

Description:
Routine to estimate the scaling factor in a matrix by computing the average of the scale of the X, Y, and Z unit vectors.
Parameters:

M: | Matrix to estimate scaling factors.
--- | ---

Returned Value:

RealType: Estimated Scaling factor.

Keywords:
transformations

## MatSubTwo4by4

(misc_lib/genmat.c:315)
Prototype:

      void MatSubTwo4by4(MatrixType MatRes, MatrixType Mat1, MatrixType Mat2)

Description:
Routine to subtract 2 4by4 matrices. MatRes may be one of Mat1 or Mat2.
Parameters:

MatRes: | Result of matrix subtraction.
--- | ---
Mat1, Mat2: | The two operand of the matrix subtraction.

Returned Value:

void

Keywords:
transformations matrix subtraction

## PQCompFunc

(misc_lib/priorque.c:99)
Prototype:

      void PQCompFunc(PQCompFuncType NewCompFunc)

Description:
Sets (a pointer to) the function that is used in comparing two items in the queue. This comparison function will get two item pointers, and should return >0, 0, <0 as comparison result for greater than, equal, or less than relation, respectively.
Parameters:

NewCompFunc: | A comparison function to used on item in the queue.
--- | ---

Returned Value:

void

Keywords:
priority queue

## PQDelete

(misc_lib/priorque.c:198)
Prototype:

      VoidPtr PQDelete(PriorQue **PQ, VoidPtr OldItem)

Description:
Deletes an old item from the queue, using comparison function CompFunc. Returns a pointer to Deleted item if was fould and deleted from the queure, NULL otherwise.
Parameters:

PQ: | To delete OldItem from.
--- | ---
OldItem: | Old element in priority queue PQ to remove from.

Returned Value:

VoidPtr: Removed OldItem if found, NULL otherwise.

Keywords:
priority queue

## PQEmpty

(misc_lib/priorque.c:77)
Prototype:

      int PQEmpty(PriorQue *PQ)

Description:
returns TRUE iff PQ priority queue is empty.
Parameters:

PQ: | Priority queue to test for containment.
--- | ---

Returned Value:

int: TRUE if not empty, FALSE otherwise.

Keywords:
priority queue

## PQFind

(misc_lib/priorque.c:279)
Prototype:

      VoidPtr PQFind(PriorQue *PQ, VoidPtr OldItem)

Description:
Finds old item on the queue, PQ, using the comparison function CompFunc. Returns a pointer to item if was fould, NULL otherwise.
Parameters:

PQ: | To search for OldItem at.
--- | ---
OldItem: | Element to search in PQ.

Returned Value:

VoidPtr: Found element or othewise NULL.

Keywords:
priority queue

## PQFirst

(misc_lib/priorque.c:119)
Prototype:

      VoidPtr PQFirst(PriorQue **PQ, int Delete)

Description:
Returns the first element in the given priority queue, and delete it from the queue if Delete is TRUE. returns NULL if empty queue.
Parameters:

PQ: | To examine/remove first element from.
--- | ---
Delete: | If TRUE first element is being removed from the queue.

Returned Value:

VoidPtr: A pointer to the first element in the queue.

Keywords:
priority queue

## PQFree

(misc_lib/priorque.c:392)
Prototype:

      void PQFree(PriorQue *PQ, int FreeItem)

Description:
Frees the given queue. The elelents are also freed if FreeItems is TRUE.
Parameters:

PQ: | Priority queue to release.
--- | ---
FreeItem: | If TRUE, elements are being freed as well.

Returned Value:

void

Keywords:
priority queue

## PQFreeFunc

(misc_lib/priorque.c:420)
Prototype:

      void PQFreeFunc(PriorQue *PQ, void (*FreeFunc)(VoidPtr))

Description:
Frees the given queue. The elelents are also freed by invoking FreeFunc onall of them as FreeFunc's only argument.
Parameters:

PQ: | Priority queue to release.
--- | ---
FreeFunc: | "Printing function".

Returned Value:

void

Keywords:
priority queue

## PQInit

(misc_lib/priorque.c:58)
Prototype:

      void PQInit(PriorQue **PQ)

Description:
Initializes the priority queue.
Parameters:

PQ: | To initialize.
--- | ---

Returned Value:

void

Keywords:
priority queue

## PQInsert

(misc_lib/priorque.c:155)
Prototype:

      VoidPtr PQInsert(PriorQue **PQ, VoidPtr NewItem)

Description:
Insert a new element into the queue (NewItem is a pointer to new element) using given compare function CompFunc (See PQCompFunc). Insert elelemnt will always be a leaf of the constructed tree. Returns a pointer to old element if was replaced or NULL if the element is new.
Parameters:

PQ: | To insert a new element to.
--- | ---
NewItem: | The new element to insert.

Returned Value:

VoidPtr: An old element NewItem replaced, or NULL otherwise.

Keywords:
priority queue

## PQNext

(misc_lib/priorque.c:320)
Prototype:

      VoidPtr PQNext(PriorQue *PQ, VoidPtr CmpItem, VoidPtr LargerThan)

Description:
Returns the smallest element in PQ that is larger than given element CmpItem. PQ is not modified. Return NULL if none was found. LargerThan will allways hold the smallest Item Larger than current one.
Parameters:

PQ: | To examine.
--- | ---
CmpItem: | To find the smallest item in PQ that is larger than it.
LargerThan: | The item that is found larger so far.

Returned Value:

VoidPtr: The samllest item in PQ that is larger than CmpItem or NULL if no found.

Keywords:
priority queue

## PQPrint

(misc_lib/priorque.c:366)
Prototype:

      void PQPrint(PriorQue *PQ, void (*PrintFunc)(VoidPtr))

Description:
Scans the priority queue in order and invokes the "printing" routine, PrintFunc on every item in the queue as its only argument.
Parameters:

PQ: | Pritority queue to traverse.
--- | ---
PrintFunc: | "Printing function".

Returned Value:

void

Keywords:
priority queue

## getcwd

(misc_lib/xgeneral.c:519)
Prototype:

      char *getcwd(char *s, int Len)

Description:
Get current working directory - BSD4.3 style. *
Parameters:

s: | Where to save current working direction.
--- | ---
Len: | Length of s.

Returned Value:

char *: Same as s.

Keywords:

## movmem

(misc_lib/xgeneral.c:338)
Prototype:

      void movmem(VoidPtr Src, VoidPtr Dest, int Len)

Description:
Routine to move a block in memory. Unlike memcpy/bcopy, this routine should support overlaying blocks. This stupid implemetation will copy it twice - to a temporary block and back again. The temporary block size will be allocated by demand.
Parameters:

Src: | Of block to copy.
--- | ---
Dest: | Of block to copy.
Len: | Of block to copy.

Returned Value:

void

Keywords:
copy

## searchpath

(misc_lib/xgeneral.c:363)
Prototype:

      char *searchpath(char *Name)

Description:
RRoutine to search for a given file name.
Parameters:

Name: | Of file to search for.
--- | ---

Returned Value:

char *: Complete file name of Name.

Keywords:

## stricmp

(misc_lib/xgeneral.c:442)
Prototype:

      int stricmp(char *s1, char *s2)

Description:
Routine to compare two strings, ignoring case.
Parameters:

s1, s2: | The two strings to compare.
--- | ---

Returned Value:

int: <0, 0, >0 according to the relation between s1 and s2.

Keywords:

## strnicmp

(misc_lib/xgeneral.c:401)
Prototype:

      int strnicmp(char *s1, char *s2, int n)

Description:
Routine to compare two strings, ignoring case, up to given length.
Parameters:

s1, s2: | The two strings to compare.
--- | ---
n: | maximum number of characters to compare.

Returned Value:

int: <0, 0, >0 according to the relation between s1 and s2.

Keywords:

## strstr

(misc_lib/xgeneral.c:488)
Prototype:

      char *strstr(char *s, char *Pattern)

Description:
Routine to search for a Pattern (no regular expression) in s. Returns address in s of first occurance of Pattern, NULL if non found.
Parameters:

s: | To search for Pattern in.
--- | ---
Pattern: | To search in s.

Returned Value:

char *: Address in s where Pattern was first found, NULL otherwise.

Keywords: