/* * Old compatibility routines */ #include #include "SDDAS_types.h" #include "libdb.h" #define DKEY_VINST -149 static char _error_msg [1024]; void SetErrorString (const char *error_str) { strcpy (_error_msg, error_str); } const char *GetErrorString () { return _error_msg; } #ifdef ALL_DB char *SQL_dbErrorMsg () #else char *dbErrorMsg () #endif { return _error_msg; } SDDAS_SHORT get_data_key (SDDAS_CHAR *pstr, SDDAS_CHAR *mstr, SDDAS_CHAR *estr, SDDAS_CHAR *istr, SDDAS_CHAR *vstr, SDDAS_ULONG *data_key) { *data_key = dbGetDataKey (pstr, mstr, estr, istr, vstr); if (*data_key != 0) return (ALL_OKAY); else return DKEY_VINST; } int dbGetFile (SDDAS_ULONG data_key, Time_t *btime, Time_t etime, RequestedDataType dataType, const char *exten, char *name1, char *name2) { SDDAS_USHORT year = 0, day = 0; int ret_val = dbIDFSGetFile (data_key, year, day, btime->msec, etime.yr, etime.day, etime.msec, dataType, exten, name1, name2); btime->yr = (SDDAS_LONG) year; btime->day = (SDDAS_LONG) day; return (ret_val); } char *db_msgs (int gay_error_code) { return dbErrorMsg (); }