IPhreeqc
Data Structures | Enumerations | Functions
Var.h File Reference

IPhreeqc VARIANT Documentation More...

Go to the source code of this file.

Data Structures

struct  VAR
 Datatype used to store SELECTED_OUTPUT values. More...
 

Enumerations

enum  VAR_TYPE {
  TT_EMPTY = 0, TT_ERROR = 1, TT_LONG = 2, TT_DOUBLE = 3,
  TT_STRING = 4
}
 Enumeration used to determine the type of data stored in a VAR. More...
 
enum  VRESULT {
  VR_OK = 0, VR_OUTOFMEMORY = -1, VR_BADVARTYPE = -2, VR_INVALIDARG = -3,
  VR_INVALIDROW = -4, VR_INVALIDCOL = -5
}
 Enumeration used to return error codes. More...
 

Functions

char * VarAllocString (const char *pSrc)
 
VRESULT VarClear (VAR *pvar)
 
VRESULT VarCopy (VAR *pvarDest, const VAR *pvarSrc)
 
void VarFreeString (char *pSrc)
 
void VarInit (VAR *pvar)
 

Detailed Description

IPhreeqc VARIANT Documentation

Enumeration Type Documentation

enum VAR_TYPE

Enumeration used to determine the type of data stored in a VAR.

Enumerator
TT_EMPTY 

VAR contains no data

TT_ERROR 

vresult is valid

TT_LONG 

lVal is valid

TT_DOUBLE 

dVal is valid

TT_STRING 

sVal is valid

enum VRESULT

Enumeration used to return error codes.

Enumerator
VR_OK 

Success

VR_OUTOFMEMORY 

Failure, Out of memory

VR_BADVARTYPE 

Failure, Invalid VAR type

VR_INVALIDARG 

Failure, Invalid argument

VR_INVALIDROW 

Failure, Invalid row

VR_INVALIDCOL 

Failure, Invalid column

Function Documentation

char* VarAllocString ( const char *  pSrc)

Allocates a new string for use in a VAR and copies the passed string into it.

Parameters
pSrcPointer to the VAR that will be initialized.
Returns
A pointer to the string on success NULL otherwise.
VRESULT VarClear ( VAR pvar)

Clears a VAR.

Parameters
pvarPointer to the VAR that will be freed and initialized.
Return values
VR_OKSuccess.
VR_BADVARTYPEThe VAR was invalid (probably uninitialized).
VRESULT VarCopy ( VAR pvarDest,
const VAR pvarSrc 
)

Frees the destination VAR and makes a copy of the source VAR.

Parameters
pvarDestPointer to the VAR to receive the copy.
pvarSrcPointer to the VAR to be copied.
Return values
VR_OKSuccess.
VR_BADVARTYPEThe source and/or the destination are invalid (usually uninitialized).
VR_OUTOFMEMORYMemory could not be allocated for the copy.
Returns
The return value is one of the following.
void VarFreeString ( char *  pSrc)

Frees a string allocated using VarAllocString.

Parameters
pSrcPointer to the string to be freed.
void VarInit ( VAR pvar)

Initializes a VAR.

Parameters
pvarPointer to the VAR that will be initialized.