00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef __MSD_USER_H__
00014 #define __MSD_USER_H__
00015
00016 #define MAXRES 8
00017
00018 #ifdef __cplusplus
00019 #ifndef __MSD_CHEM_H__
00020 #include "msd_chem.h"
00021 #endif
00022 extern "C" {
00023 #endif
00024
00025 enum msdstatus
00026 { INIT,
00027 ATTACHED,
00028 NOTATTACHED,
00029 LOGGEDIN,
00030 NOTLOGGEDIN,
00031 NOOBJECT,
00032 NOTCONNECTED,
00033 NORESULTSET,
00034 NOSQLQUERY,
00035 LOGGEDOUT,
00036 NOTLOGGEDOUT,
00037 DETACHED,
00038 NOTDETACHED,
00039 MSDEND
00040 };
00041
00042 typedef struct MSDNode MSDNode,*MSDValue;
00043 typedef struct MSDEnv MSDEnv,*pMSDEnv;
00044 struct MSDNode {
00045 char type;
00046 char flags;
00047 int id;
00048 MSDValue (*pGetFunc) (pMSDEnv,int);
00049 union MSDNodeValue {
00050 int vint;
00051 float vfloat;
00052 double vdouble;
00053 int vchcode;
00054 char vchr;
00055 char* vstr;
00056
00057 struct {
00058 int year;
00059 int months;
00060 int day;
00061 int hour;
00062 int minute;
00063 int second;
00064 } datetime;
00065 struct {
00066 int size;
00067 MSDValue *data;
00068 } vec;
00069
00070 struct {
00071 MSDValue type;
00072 void *ptr;
00073 } foreignptr;
00074
00075 } value;
00076 };
00077 struct MSDEnv
00078 { int ConID;
00079 int SqlID;
00080 enum msdstatus stat;
00081 void* conn;
00082 void* select;
00083 void* manager;
00084 void* data;
00085 void* result[MAXRES];
00086 MSDNode node;
00087 };
00088
00089
00090
00091 #define MSDGetFloat(x,v) ((x)->value.vfloat)
00092 #define MSDGetInt(x) ((x)->value.vint)
00093 #define MSDGetDouble(x) ((x)->value.vdouble)
00094 #define MSDGetString(x) ((x)->value.vstr)
00095 #define MSDSetFloat(x,v) ((x)->value.vfloat = (v))
00096 #define MSDSetInt(x,v) ((x)->value.vint = (v))
00097 #define MSDSetDouble(x,v) ((x)->value.vdouble = (v))
00098 #define MSDSetString(x,v) (strcpy((x)->value.msd_vstr,(v)))
00099 #define MSDGetElement(x,i) ((x)->value.vec.data[i])
00100
00101 int msd_init(pMSDEnv msd);
00102 int msd_rlogin(pMSDEnv msd, char* loginstring);
00103
00104 #ifdef MSD_ORACLE
00105 int msd_attach(pMSDEnv msd, char* oserver);
00106 int msd_begin(pMSDEnv msd, char* usern, char* passwd);
00107 int msd_end(pMSDEnv msd);
00108 int msd_detach(pMSDEnv msd);
00109 int msd_disconnect(pMSDEnv msd);
00110 #endif
00111 int msd_logoff(pMSDEnv msd);
00112 int msd_free(pMSDEnv msd);
00113 int msd_select (pMSDEnv msd ,char* stm);
00114 int msd_sqlinit (pMSDEnv msd, char* stm);
00115 int msd_setcriteria(pMSDEnv msd, const char* fmt,...);
00116 int msd_getrownum(pMSDEnv msd);
00117 int msd_getnext(pMSDEnv msd);
00118
00119 MSDValue msd_getvfloat(pMSDEnv msd,int col);
00120 MSDValue msd_getvint(pMSDEnv msd,int col);
00121 MSDValue msd_getvstr(pMSDEnv msd,int col);
00122 MSDValue msd_getvdouble(pMSDEnv msd,int col);
00123 MSDValue msd_getvalue(pMSDEnv msd,int col, MSDValue (*pGetFunc)(pMSDEnv,int));
00124 #define MSDGetValue(e,n,f,p) do { \
00125 MSDValue x = msd_getvalue((&e),(n), (msd_get##p)); \
00126 (f) = (x->value.p); \
00127 break; \
00128 } while (0)
00129
00130
00131
00132 float msd_ugetfloat(pMSDEnv msd,int col);
00133 int msd_ugetint(pMSDEnv msd,int col);
00134 char* msd_ugetstr(pMSDEnv msd,int col,char* s);
00135 double msd_ugetdouble(pMSDEnv msd,int col);
00136
00137 #ifdef __WITH_XMMDB__
00138 int msd_manager(pMSDEnv msd);
00139 int msd_get_number_of_atoms(pMSDEnv msd);
00140 int msd_get_object_entry (pMSDEnv msd, int n_eID);
00141
00142 #endif
00143 char* msd_get_accession_code(pMSDEnv msd, int e_ID);
00144 int msd_get_entry_id(pMSDEnv msd, char* acc_code);
00145
00146
00147
00148 int msd_lisp_init(int argc, char* argv[]);
00149 int msd_lisp_load(char * fn);
00150 int msd_lisp_eval(void);
00151 int msd_write_table_attributes(char* schema, char* connstr, char* fname);
00152 int msd_soap_data_generator(char* schema, char* connstr, char* fname);
00153 int msd_get_tables_relations(char* schema, char* connstr);
00154 int msd_get_datamodel(char* schema, char* connstr);
00155 int msd_load_metadata(char* schema, char* connstr);
00156
00157 #ifdef __cplusplus
00158 }
00159 #endif
00160
00161
00162
00163
00164
00165
00166
00167
00168 #endif
00169