34 #include "itm_constants.h"
36 #ifndef AMNS_INTERFACE_H
37 #define AMNS_INTERFACE_H
41 #define version_length 32
43 #define reaction_length 16
44 #define query_length 16
45 #define answer_length 128
46 #define amns_max_length 128
48 char *
strcpy_f2c(
char *fsrc,
int flen,
char **cdest);
49 char *
strcpy_c2f(
char *csrc,
char *fdest,
int flen);
326 end = fstr + flen - 1;
327 while(end >= fstr && isspace(*end)) end--;
328 return end - fstr + 1;
336 int trimlen =
fstrlen(fsrc, flen);
337 if (((*cdest) = malloc(trimlen+1)) != NULL) {
338 memcpy(*cdest, fsrc, trimlen);
339 *(*cdest + trimlen) = 0;
350 memset(fdest,
' ', flen);
352 int clen = strlen(csrc);
354 printf(
"strcpy_c2f: WARNING: C string exceeds size of target Fortran string. Truncating.");
357 memcpy(fdest, csrc, clen);
544 ITM_AMNS_C_RX_3_C(handle_rx_in, nx, ny, nz, out, arg1, arg2, arg3, &f_error_status);
void amns_reaction_type_f2c(amns_reaction_type ftype, amns_c_reaction_type *ctype)
void ITM_AMNS_CC_RX_0_A(void *handle_rx_in, double *out, double arg1, amns_c_error_type *error_status)
void ITM_AMNS_C_RX_0_B(void *handle_rx_in, double *out, double arg1, double arg2, amns_error_type *error_status)
void amns_answer_type_c2f(amns_c_answer_type ctype, amns_answer_type *ftype)
void ITM_AMNS_C_RX_0_C(void *handle_rx_in, double *out, double arg1, double arg2, double arg3, amns_error_type *error_status)
void ITM_AMNS_C_SET(void *handle_in, amns_set_type *set, amns_error_type *error_status)
void ITM_AMNS_C_SETUP_VERSION(void **handle_in, amns_version_type *version, amns_error_type *error_status)
char * string
string version of the answer to a query
int fstrlen(char *fstr, int flen)
void ITM_AMNS_CC_SET_TABLE(void *handle_rx_in, amns_c_set_type *set, amns_c_error_type *error_status)
void ITM_AMNS_C_RX_3_C(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, double *arg2, double *arg3, amns_error_type *error_status)
Type for specifying the AMNS version ("interoperable" version)
void ITM_AMNS_CC_RX_1_B(void *handle_rx_in, int nx, double *out, double *arg1, double *arg2, amns_c_error_type *error_status)
const amns_version_type DEFAULT_AMNS_VERSION_TYPE
amns_c_error_type get_default_amns_c_error_type(void)
prototype
const amns_error_type DEFAULT_AMNS_ERROR_TYPE
amns_c_reaction_type get_default_amns_c_reaction_type(void)
prototype
void ITM_AMNS_CC_RX_3_B(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, double *arg2, amns_c_error_type *error_status)
void ITM_AMNS_CC_RX_3_C(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, double *arg2, double *arg3, amns_c_error_type *error_status)
int number
integer version of the answer to a query
void amns_error_type_c2f(amns_c_error_type ctype, amns_error_type *ftype)
char * string
used to pass a change in the settings
Type for error returns from the AMNS interface ("C" version)
Type for querying parameters in the AMNS package ("C" version)
void amns_query_type_c2f(amns_c_query_type ctype, amns_query_type *ftype)
const amns_c_set_type DEFAULT_AMNS_C_SET_TYPE
bool flag
True if an error occurred.
amns_c_version_type get_default_amns_c_version_type(void)
prototype
void ITM_AMNS_C_SETUP_TABLE(void *handle_in, amns_reaction_type *reaction_type, void *reactant_handle_in, void **handle_rx_out, amns_error_type *error_status)
const amns_reaction_type DEFAULT_AMNS_REACTION_TYPE
const amns_c_error_type DEFAULT_AMNS_C_ERROR_TYPE
void amns_error_type_f2c(amns_error_type ftype, amns_c_error_type *ctype)
amns_c_reactant_type get_default_amns_c_reactant_type(void)
prototype
void ITM_AMNS_C_GET_REACTANT(void *reactants_handle_in, int reactant_index, amns_reactant_type *reactant_out)
const amns_c_reactant_type DEFAULT_AMNS_C_REACTANT_TYPE
void ITM_AMNS_C_RX_2_B(void *handle_rx_in, int nx, int ny, double *out, double *arg1, double *arg2, amns_error_type *error_status)
Type for answers from queries in the AMNS package ("C" version)
const amns_c_answer_type DEFAULT_AMNS_C_ANSWER_TYPE
void ITM_AMNS_CC_FINISH_TABLE(void **handle_rx_inout, amns_c_error_type *error_status)
void ITM_AMNS_C_RX_1_C(void *handle_rx_in, int nx, double *out, double *arg1, double *arg2, double *arg3, amns_error_type *error_status)
Type used for specifying reactions when using the AMNS interface ("C" version)
char * string
name of the reaction (e.g. RC)
char backend[version_length]
specify the backend to be used to access the CPOs
char * strcpy_c2f(char *csrc, char *fdest, int flen)
void ITM_AMNS_CC_FINISH_REACTANTS(void **reactants_handle_inout)
void ITM_AMNS_C_SET_REACTANT(void *reactants_handle_in, int reactant_index, amns_reactant_type *reactant_in)
Type for answers from queries in the AMNS package ("interoperable" version)
void ITM_AMNS_C_RX_3_A(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, amns_error_type *error_status)
Type for error returns from the AMNS interface ("interoperable" version)
char string[answer_length]
text describing the error if flag was True
void ITM_AMNS_C_FINISH_REACTANTS(void **reactants_handle_inout)
int isotope_resolved
if the reaction is different for different isotopes, isotope_resolved shoukld be set to 1 ...
const amns_answer_type DEFAULT_AMNS_ANSWER_TYPE
char * strcpy_f2c(char *fsrc, int flen, char **cdest)
double real_specifier
a place holder to specify an optional real further characterising a reactant/product ...
void ITM_AMNS_CC_RX_1_C(void *handle_rx_in, int nx, double *out, double *arg1, double *arg2, double *arg3, amns_c_error_type *error_status)
Type for setting parameters in the AMNS package ("C" version)
void ITM_AMNS_C_RX_2_A(void *handle_rx_in, int nx, int ny, double *out, double *arg1, amns_error_type *error_status)
void ITM_AMNS_CC_QUERY_TABLE(void *handle_rx_in, amns_c_query_type *query, amns_c_answer_type *answer, amns_c_error_type *error_status)
void ITM_AMNS_CC_FINISH(void **handle_inout, amns_c_error_type *error_status)
void ITM_AMNS_C_SET_TABLE(void *handle_rx_in, amns_set_type *set, amns_error_type *error_status)
char string[set_length]
used to pass a change in the settings
const amns_c_version_type DEFAULT_AMNS_C_VERSION_TYPE
Type for specifying the AMNS version ("C" version)
char * backend
specify the backend to be used to access the CPOs
void ITM_AMNS_C_RX_2_C(void *handle_rx_in, int nx, int ny, double *out, double *arg1, double *arg2, double *arg3, amns_error_type *error_status)
char string[version_length]
ascii specification of the version
amns_reactant_type amns_c_reactant_type
char string[query_length]
used to pass a query about settings
void ITM_AMNS_C_FINISH_TABLE(void **handle_rx_inout, amns_error_type *error_status)
char * string
ascii specification of the version
char string[reaction_length]
name of the reaction (e.g. RC)
const amns_reactant_type DEFAULT_AMNS_REACTANT_TYPE
int number
integer specification of the version number (primary specification at the moment) ...
void ITM_AMNS_CC_GET_REACTANT(void *reactants_handle_in, int reactant_index, amns_c_reactant_type *reactant_out)
char user[version_length]
specify the username of the data to be obtained (defaults to tghe person running the code) ...
void ITM_AMNS_C_SETUP(void **handle_out, amns_error_type *error_status)
int isotope_resolved
if the reaction is different for different isotopes, isotope_resolved shoukld be set to 1 ...
char * user
specify the username of the data to be obtained (defaults to tghe person running the code) ...
const amns_c_reaction_type DEFAULT_AMNS_C_REACTION_TYPE
void ITM_AMNS_C_RX_3_B(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, double *arg2, amns_error_type *error_status)
void ITM_AMNS_C_RX_0_A(void *handle_rx_in, double *out, double arg1, amns_error_type *error_status)
int number
integer specification of the version number (primary specification at the moment) ...
void ITM_AMNS_CC_RX_2_C(void *handle_rx_in, int nx, int ny, double *out, double *arg1, double *arg2, double *arg3, amns_c_error_type *error_status)
void ITM_AMNS_CC_SETUP_REACTANTS(void **reactants_handle_out, char *string_in, int index_in, int n_reactants)
void ITM_AMNS_CC_RX_0_B(void *handle_rx_in, double *out, double arg1, double arg2, amns_c_error_type *error_status)
Type used for specifying reactions when using the AMNS interface ("interoperable" version) ...
void ITM_AMNS_CC_SET_REACTANT(void *reactants_handle_in, int reactant_index, amns_c_reactant_type *reactant_in)
void ITM_AMNS_CC_SET(void *handle_in, amns_c_set_type *set, amns_c_error_type *error_status)
void ITM_AMNS_CC_QUERY(void *handle_in, amns_c_query_type *query, amns_c_answer_type *answer, amns_c_error_type *error_status)
void ITM_AMNS_C_QUERY_TABLE(void *handle_rx_in, amns_query_type *query, amns_answer_type *answer, amns_error_type *error_status)
void amns_version_type_f2c(amns_version_type ftype, amns_c_version_type *ctype)
int number
integer version of the answer to a query
bool flag
True if an error occurred.
void amns_set_type_f2c(amns_set_type ftype, amns_c_set_type *ctype)
void amns_version_type_c2f(amns_c_version_type ctype, amns_version_type *ftype)
void ITM_AMNS_CC_RX_0_C(void *handle_rx_in, double *out, double arg1, double arg2, double arg3, amns_c_error_type *error_status)
void ITM_AMNS_CC_RX_2_B(void *handle_rx_in, int nx, int ny, double *out, double *arg1, double *arg2, amns_c_error_type *error_status)
void ITM_AMNS_C_RX_1_B(void *handle_rx_in, int nx, double *out, double *arg1, double *arg2, amns_error_type *error_status)
const amns_c_query_type DEFAULT_AMNS_C_QUERY_TYPE
void ITM_AMNS_C_FINISH(void **handle_inout, amns_error_type *error_status)
void ITM_AMNS_C_RX_1_A(void *handle_rx_in, int nx, double *out, double *arg1, amns_error_type *error_status)
void ITM_AMNS_C_SETUP_REACTANTS(void **reactants_handle_out, char string_in[reaction_length], int index_in, int n_reactants)
Type for querying parameters in the AMNS package ("interoperable" version)
Type for indicating a single reactant or product when using the AMNS interface.
Type for setting parameters in the AMNS package ("interoperable" version)
void amns_reaction_type_c2f(amns_c_reaction_type ctype, amns_reaction_type *ftype)
char string[answer_length]
string version of the answer to a query
if error_status & error_status
void ITM_AMNS_C_QUERY(void *handle_in, amns_query_type *query, amns_answer_type *answer, amns_error_type *error_status)
void ITM_AMNS_CC_RX_3_A(void *handle_rx_in, int nx, int ny, int nz, double *out, double *arg1, amns_c_error_type *error_status)
void ITM_AMNS_CC_SETUP_TABLE(void *handle_in, amns_c_reaction_type *reaction_type, void *reactant_handle_in, void **handle_rx_out, amns_c_error_type *error_status)
char * string
text describing the error if flag was True
int int_specifier
a place holder to specify an optional integer further characterising a reactant/product ...
const amns_query_type DEFAULT_AMNS_QUERY_TYPE
void amns_answer_type_f2c(amns_answer_type ftype, amns_c_answer_type *ctype)
char * string
used to pass a query about settings
int LR
reactant (LR=0) or product (LR=1)
void ITM_AMNS_CC_RX_1_A(void *handle_rx_in, int nx, double *out, double *arg1, amns_c_error_type *error_status)
void ITM_AMNS_CC_RX_2_A(void *handle_rx_in, int nx, int ny, double *out, double *arg1, amns_c_error_type *error_status)
void amns_set_type_c2f(amns_c_set_type ctype, amns_set_type *ftype)
void ITM_AMNS_CC_SETUP(void **handle_out, amns_c_error_type *error_status)
void ITM_AMNS_CC_SETUP_VERSION(void **handle_in, amns_c_version_type *version, amns_c_error_type *error_status)
void amns_query_type_f2c(amns_query_type ftype, amns_c_query_type *ctype)
const amns_set_type DEFAULT_AMNS_SET_TYPE