XA Online Documentation, Inside XA "access.c"

access.c

Source file access.c

access.c provides the user and interface programmer with an ease-to-use enviroment to read data out of the atom data structure again.

Comments

orbital_type_ptr XAOrbital(atom_ptr curr_atom, char *orbital_string)

First the parameter orbital string is analyzed to get the orbital symbol and the shell number. If these are not found an error code will be returned to the calling function. After these validations a while loop looks for the orbital symbol by using the XAFirstOrbital and XANextOrbital functions. If it is found a pointer to this orbital will be returned.

shell_ptr XAShell(atom_ptr curr_atom, char *orbital_string)

works like XAOrbital, first the orbital is searched by using XAOrbital. Then the procedure looks for the shell number and, when found, returns a pointer to the shell.

orbital_value_ptr XAData(int i, atom_ptr, char *orbital_string)

XAShell is used to access the shell, which is given by the orbital string parameter. The while loop looks for the ith data element in this shell, where i=0 stands for the first data block, i=1 the second etc. If i is greater than the number of data blocks a POINTER_RETURN_ERROR is returned to the calling function.

int XADataN(int i, atom_ptr curr_atom, char *orbital_string)
float XADataC(int i, atom_ptr curr_atom, char *orbital_string)
float XADataAlpha(int i, atom_ptr curr_atom, char *orbital_string)

These functions are based on the XAData procedure, so the functionality is the same. E.g. instead of using XACurrentN(XAData(...)) we can use the abbreviation XADataN now.

int XASetNextShell(shell_ptr curr_shell, shell_ptr new_shell)

XASetNextShell sets the next_shell pointer of curr_shell to new_shell. Currently this procedure is only used to delete orbitals by calling XASetNextShell with the parameter NULL.

orbital_array_ptr XAOrbitalArray(atom_ptr curr_atom)

XAOrbitalArray returns general information of an atom to the calling procedure. The information is coded into the orbital_array_ptr structure which is defined as follows:

To get these values XAOrbitalArray just examines every pointer of the atom data structure recursively, creates the return structure and returns it to the calling procedure. The various orbitals and shells are accessed by the access functions and therefore based on their correctness. Additionally, every "dead end" of the atom data structure must be marked by a NULL pointer.

Please note: whereas orbital types are stored as LIFO order, shells are in FIFO order.

You can access these values in your procedure by using the following access procedures.


[return to home page][return to Inside XA]
Reinhard Schaffner, © 1995-05-30