25 #ifndef QOF_DISABLE_DEPRECATED
33 #ifdef HAVE_LANGINFO_H
34 #define HAVE_LANGINFO_D_FMT 1
37 #ifdef HAVE_LANGINFO_D_FMT
38 # define QOF_D_FMT (nl_langinfo (D_FMT))
39 # define QOF_D_T_FMT (nl_langinfo (D_T_FMT))
40 # define QOF_T_FMT (nl_langinfo (T_FMT))
42 # define QOF_D_FMT "%F"
43 # define QOF_D_T_FMT "%F %r"
44 # define QOF_T_FMT "%i"
49 #define _(String) dgettext (GETTEXT_PACKAGE, String)
51 #include "qofsession-p.h"
52 #include "qoferror-p.h"
55 static FILE *fout = NULL;
61 gint __attribute__ ((unused)) gnc_trace_num_spaces = 0;
87 gnc_set_logfile (FILE * outfile)
92 gnc_log_prettify (
const char *name)
101 const char *d __attribute__ ((unused)),
102 const char *e __attribute__ ((unused)), ...)
109 const char *d __attribute__ ((unused)),
110 const char *e __attribute__ ((unused)), ...)
117 const char *d __attribute__ ((unused)),
118 const char *e __attribute__ ((unused)), ...)
136 gnc_engine_unregister_event_handler (gint handler_id)
142 gnc_engine_suspend_events (
void)
148 gnc_engine_resume_events (
void)
186 gnc_string_cache_insert (gconstpointer key)
192 gnc_stpcpy (gchar * dest,
const gchar * src)
194 return g_stpcpy (dest, src);
198 gnc_engine_get_string_cache (
void)
204 gnc_engine_string_cache_destroy (
void)
210 gnc_string_cache_remove (gconstpointer key)
216 gnc_date_string_to_dateformat (
const gchar * format_string,
229 gnc_date_string_to_monthformat (
const gchar * format_string,
235 if (!strcmp (format_string,
"number"))
237 else if (!strcmp (format_string,
"abbrev"))
239 else if (!strcmp (format_string,
"name"))
257 qof_time_to_Timespec (
QofTime * time)
281 qta = timespecToQofTime (*ta);
282 qtb = timespecToQofTime (*tb);
295 qta = timespecToQofTime (*ta);
296 qtb = timespecToQofTime (*tb);
310 *ts = qof_time_to_Timespec (time);
326 qta = timespecToQofTime (*ta);
327 qtb = timespecToQofTime (*tb);
329 ts = qof_time_to_Timespec (qt);
340 QofTime *qt = timespecToQofTime (*t);
342 ts = qof_time_to_Timespec (qt);
350 struct tm tm, *result;
353 time_t t_secs = t.tv_sec + (t.tv_nsec /
QOF_NSECS);
354 result = localtime(&t_secs);
356 gnc_tm_set_day_middle(&tm);
357 retval.tv_sec = mktime(&tm);
363 qof_date_dmy_to_sec (gint day, gint month, gint year)
381 qof_print_hours_elapsed_buff (
char *buff,
size_t len,
int secs,
389 flen = g_snprintf (buff, len,
390 "%02d:%02d:%02d", (
int) (secs / 3600),
391 (
int) ((secs % 3600) / 60), (
int) (secs % 60));
395 flen = g_snprintf (buff, len,
396 "%02d:%02d", (
int) (secs / 3600),
397 (
int) ((secs % 3600) / 60));
404 flen = g_snprintf (buff, len,
405 "-%02d:%02d:%02d", (
int) (-secs / 3600),
406 (
int) ((-secs % 3600) / 60), (
int) (-secs % 60));
410 flen = g_snprintf (buff, len,
411 "-%02d:%02d", (
int) (-secs / 3600),
412 (
int) ((-secs % 3600) / 60));
419 qof_print_minutes_elapsed_buff (
char *buff,
size_t len,
int secs,
427 flen = g_snprintf (buff, len,
428 "%02d:%02d", (
int) (secs / 60), (
int) (secs % 60));
432 flen = g_snprintf (buff, len,
"%02d", (
int) (secs / 60));
439 flen = g_snprintf (buff, len,
440 "-%02d:%02d", (
int) (-secs / 60), (
int) (-secs % 60));
444 flen = g_snprintf (buff, len,
"-%02d", (
int) (-secs / 60));
451 qof_print_date_time_buff (
char *buff,
size_t len, time_t secs)
454 int day, month, year, hour, min, sec;
459 ltm = *localtime (&secs);
461 month = ltm.tm_mon + 1;
462 year = ltm.tm_year + 1900;
470 g_snprintf (buff, len,
"%2d/%2d/%-4d %2d:%02d", day, month,
475 g_snprintf (buff, len,
"%2d.%2d.%-4d %2d:%02d", day, month,
480 g_snprintf (buff, len,
"%04d-%02d-%02d %02d:%02d", year, month,
485 gtm = *gmtime (&secs);
491 flen = strftime (buff, len, QOF_D_T_FMT, <m);
498 g_snprintf (buff, len,
"%2d/%2d/%-4d %2d:%02d", month, day,
515 gtm = *gmtime (&secs);
519 ltm = *localtime (&secs);
520 flen = strftime (buff, len, QOF_T_FMT, <m);
526 qof_is_same_day (time_t ta, time_t tb)
529 lta = *localtime (&ta);
530 ltb = *localtime (&tb);
531 if (lta.tm_year == ltb.tm_year)
533 return (ltb.tm_yday - lta.tm_yday);
535 return (ltb.tm_year - lta.tm_year)*365;
539 gnc_tm_set_day_start (
struct tm *tm)
548 gnc_tm_get_day_start (
struct tm *tm, time_t time_val)
550 tm = localtime_r (&time_val, tm);
551 gnc_tm_set_day_start (tm);
555 gnc_tm_set_day_middle (
struct tm *tm)
564 gnc_tm_set_day_end (
struct tm *tm)
573 gnc_tm_get_day_end (
struct tm *tm, time_t time_val)
575 tm = localtime_r (&time_val, tm);
576 gnc_tm_set_day_end (tm);
580 gnc_timet_get_day_start (time_t time_val)
584 gnc_tm_get_day_start (&tm, time_val);
589 gnc_timet_get_day_end (time_t time_val)
593 gnc_tm_get_day_end (&tm, time_val);
597 #ifndef GNUCASH_MAJOR_VERSION
599 gnc_timet_get_day_start_gdate (GDate * date)
604 stm.tm_year = g_date_get_year (date) - 1900;
605 stm.tm_mon = g_date_get_month (date) - 1;
606 stm.tm_mday = g_date_get_day (date);
607 gnc_tm_set_day_start (&stm);
608 secs = mktime (&stm);
613 gnc_timet_get_day_end_gdate (GDate * date)
618 stm.tm_year = g_date_get_year (date) - 1900;
619 stm.tm_mon = g_date_get_month (date) - 1;
620 stm.tm_mday = g_date_get_day (date);
621 gnc_tm_set_day_end (&stm);
622 secs = mktime (&stm);
627 gnc_date_my_last_mday (
int month,
int year)
629 return g_date_get_days_in_month (month, year);
633 date_get_last_mday (
struct tm *tm)
635 return g_date_get_days_in_month (tm->tm_mon + 1, tm->tm_year + 1900);
639 date_is_last_mday (
struct tm * tm)
641 return (tm->tm_mday ==
642 g_date_get_days_in_month (tm->tm_mon + 1, tm->tm_year + 1900));
650 time_t t_secs = t.tv_sec + (t.tv_nsec /
QOF_NSECS);
651 result = localtime (&t_secs);
652 return date_get_last_mday (result);
656 gnc_tm_get_today_start (
struct tm *tm)
658 gnc_tm_get_day_start (tm, time (NULL));
662 gnc_tm_get_today_end (
struct tm *tm)
664 gnc_tm_get_day_end (tm, time (NULL));
668 gnc_timet_get_today_start (
void)
672 gnc_tm_get_day_start (&tm, time (NULL));
677 gnc_timet_get_today_end (
void)
681 gnc_tm_get_day_end (&tm, time (NULL));
686 xaccDateUtilGetStamp (time_t thyme)
690 stm = localtime (&thyme);
691 return g_strdup_printf (
"%04d%02d%02d%02d%02d%02d",
692 (stm->tm_year + 1900),
694 stm->tm_mday, stm->tm_hour, stm->tm_min, stm->tm_sec);
707 flen = g_snprintf (buff, len,
"%2d/%2d/%-4d", day, month, year);
710 flen = g_snprintf (buff, len,
"%2d.%2d.%-4d", day, month, year);
716 tm_str.tm_mday = day;
717 tm_str.tm_mon = month - 1;
718 tm_str.tm_year = year - 1900;
719 gnc_tm_set_day_start (&tm_str);
720 t = mktime (&tm_str);
721 localtime_r (&t, &tm_str);
722 flen = strftime (buff, len, QOF_D_FMT, &tm_str);
728 flen = g_snprintf (buff, len,
"%04d-%02d-%02d", year, month, day);
732 flen = g_snprintf (buff, len,
"%2d/%2d/%-4d", month, day, year);
739 qof_print_date_buff (
char *buff,
size_t len, time_t t)
744 theTime = localtime (&t);
746 theTime->tm_mday, theTime->tm_mon + 1, theTime->tm_year + 1900);
767 qof_print_date (time_t t)
788 ENTER (
" using date format %d", df);
789 time = timespecToQofTime (ts);
792 g_stpcpy (buff, str);
794 LEAVE (
" printing %s", buff);
803 qof_scan_date_internal (
const char *buff,
int *day,
int *month,
int *year,
806 char *dupe, *tmp, *first_field, *second_field, *third_field;
807 int iday, imonth, iyear;
811 if (!buff)
return(FALSE);
817 *month = utc.tm_mon + 1;
818 *year = utc.tm_year + 1900;
821 else {
return FALSE; }
823 dupe = g_strdup (buff);
832 static char *delims =
".,-+/\\() ";
834 first_field = strtok (tmp, delims);
836 second_field = strtok (NULL, delims);
838 third_field = strtok (NULL, delims);
845 now = localtime (&secs);
847 imonth = now->tm_mon+1;
848 iyear = now->tm_year+1900;
851 switch (which_format)
859 memset(&thetime, -1,
sizeof(
struct tm));
860 strptime (buff, QOF_D_FMT, &thetime);
864 iyear = thetime.tm_year + 1900;
865 iday = thetime.tm_mday;
866 imonth = thetime.tm_mon + 1;
867 }
else if (second_field) {
869 if (thetime.tm_year == -1) {
871 iday = thetime.tm_mday;
872 imonth = thetime.tm_mon + 1;
873 }
else if (thetime.tm_mon != -1) {
875 imonth = atoi(first_field);
876 iday = atoi(second_field);
879 iday = atoi(first_field);
880 imonth = atoi(second_field);
882 }
else if (first_field) {
883 iday = atoi(first_field);
890 iday = atoi(first_field);
891 imonth = atoi(second_field);
892 iyear = atoi(third_field);
893 }
else if (second_field) {
894 iday = atoi(first_field);
895 imonth = atoi(second_field);
896 }
else if (first_field) {
897 iday = atoi(first_field);
902 iyear = atoi(first_field);
903 imonth = atoi(second_field);
904 iday = atoi(third_field);
905 }
else if (second_field) {
906 imonth = atoi(first_field);
907 iday = atoi(second_field);
908 }
else if (first_field) {
909 iday = atoi(first_field);
915 imonth = atoi(first_field);
916 iday = atoi(second_field);
917 iyear = atoi(third_field);
918 }
else if (second_field) {
919 imonth = atoi(first_field);
920 iday = atoi(second_field);
921 }
else if (first_field) {
922 iday = atoi(first_field);
929 if ((12 < imonth) || (31 < iday))
944 if ((which_format != prevQofDateFormat) &&
945 qof_scan_date_internal(buff, day, month, year, prevQofDateFormat))
949 if ((12 < imonth) && (12 >= iday))
951 int tmp = imonth; imonth = iday; iday = tmp;
962 iyear += ((int) ((now->tm_year+1950-iyear)/100)) * 100;
964 if (year) *year=iyear;
965 if (month) *month=imonth;
971 qof_scan_date (
const char *buff,
int *day,
int *month,
int *year)
973 return qof_scan_date_internal(buff, day, month, year, dateFormat);
980 int day, month, year;
982 rc = qof_scan_date_internal(buff, &day, &month, &year, dateFormat);
989 gnc_dmy2timespec (gint day, gint month, gint year)
995 if (!g_date_valid_dmy (day, month, year))
996 return null_timespec ();
1003 ts = qof_time_to_Timespec (qt);
1010 gnc_dmy2timespec_end (gint day, gint month, gint year)
1016 if (!g_date_valid_dmy (day, month, year))
1017 return null_timespec ();
1022 qof_date_set_day_end (qd);
1024 ts = qof_time_to_Timespec (qt);
1031 gnc_iso8601_to_timespec_gmt (
const gchar * str)
1043 dupe = g_strdup (str);
1044 stm.tm_year = atoi (str) - 1900;
1045 str = strchr (str,
'-');
1054 stm.tm_mon = atoi (str) - 1;
1055 str = strchr (str,
'-');
1064 stm.tm_mday = atoi (str);
1066 str = strchr (str,
' ');
1075 stm.tm_hour = atoi (str);
1076 str = strchr (str,
':');
1085 stm.tm_min = atoi (str);
1086 str = strchr (str,
':');
1095 stm.tm_sec = atoi (str);
1097 if (strchr (str,
'.'))
1099 gint decimals, i, multiplier = 1000000000;
1100 str = strchr (str,
'.') + 1;
1101 decimals = strcspn (str,
"+- ");
1102 for (i = 0; i < decimals; i++)
1104 nsec = atoi (str) * multiplier;
1108 str += strcspn (str,
"+-");
1115 stm.tm_hour -= atoi (buf);
1120 if (isdigit ((guchar) * str) && isdigit ((guchar) * (str + 1)))
1135 stm.tm_min += cyn * atoi (buf);
1147 tmp_tm.tm_isdst = -1;
1149 secs = mktime (&tmp_tm);
1153 PWARN (
" mktime failed to handle daylight saving: "
1154 "tm_hour=%d tm_year=%d tm_min=%d tm_sec=%d tm_isdst=%d for string=%s",
1155 stm.tm_hour, stm.tm_year, stm.tm_min,
1156 stm.tm_sec, stm.tm_isdst, dupe);
1158 secs = mktime (&tmp_tm);
1161 tmp_tm.tm_hour -= 2;
1162 secs = mktime (&tmp_tm);
1166 PERR (
" unable to recover from buggy mktime ");
1172 tm = *localtime_r (&secs, &tm);
1174 tz = gnc_timezone (&tmp_tm);
1176 tz_hour = tz / 3600;
1177 stm.tm_hour -= tz_hour;
1178 stm.tm_min -= (tz % 3600) / 60;
1179 stm.tm_isdst = tmp_tm.tm_isdst;
1180 ts.tv_sec = mktime (&stm);
1197 gnc_timespec_to_iso8601_buff (
Timespec ts, gchar * buff)
1199 gint len, tz_hour, tz_min;
1206 localtime_r (&tmp, &parsed);
1208 secs = gnc_timezone (&parsed);
1209 tz_hour = secs / 3600;
1210 tz_min = (secs % 3600) / 60;
1219 len = sprintf (buff,
"%4d-%02d-%02d %02d:%02d:%02d.%06ld %c%02d%02d",
1220 parsed.tm_year + 1900,
1225 parsed.tm_sec, ts.tv_nsec / 1000, cyn, tz_hour, tz_min);
1232 gnc_timespec2dmy (
Timespec ts, gint * day, gint * month, gint * year)
1237 time = timespecToQofTime (ts);
1249 gnc_timezone (
struct tm *tm)
1251 g_return_val_if_fail (tm != NULL, 0);
1253 return -(tm->tm_gmtoff);
1260 ts = inst->last_update;
1269 g_return_if_fail (inst);
1270 inst->last_update = ts;
1271 time = timespecToQofTime (ts);
1272 qof_instance_set_update_time (inst, time);
1280 stm.tm_year = year - 1900;
1281 stm.tm_mon = month - 1;
1283 gnc_tm_set_day_start(&stm);
1285 secs = mktime (&stm);
1289 void date_add_months (
struct tm *tm,
int months, gboolean track_last_day)
1291 gboolean was_last_day;
1294 was_last_day = date_is_last_mday(tm);
1296 tm->tm_mon += months;
1297 while (tm->tm_mon > 11) {
1302 if (!track_last_day)
1305 new_last_mday = date_get_last_mday(tm);
1306 if (was_last_day || (tm->tm_mday > new_last_mday))
1307 tm->tm_mday = new_last_mday;
1309 char dateSeparator (
void)
1356 g_return_val_if_fail(ts, FALSE);
1357 tt = timespecToTime_t(*ts);
1358 #ifdef HAVE_GMTIME_R
1359 tm = *gmtime_r(&tt, &tm);
1365 if(tt < 0) {
return FALSE; }
1366 timespecFromTime_t(ts, tt);
1371 qof_date_add_months(
Timespec *ts, gint months, gboolean track_last_day)
1376 gboolean was_last_day;
1378 g_return_val_if_fail(ts, FALSE);
1379 tt = timespecToTime_t(*ts);
1380 #ifdef HAVE_GMTIME_R
1381 tm = *gmtime_r(&tt, &tm);
1385 was_last_day = date_is_last_mday(&tm);
1386 tm.tm_mon += months;
1387 while (tm.tm_mon > 11) {
1391 if (track_last_day) {
1392 new_last_mday = date_get_last_mday(&tm);
1393 if (was_last_day || (tm.tm_mday > new_last_mday)) {
1394 tm.tm_mday = new_last_mday;
1398 if(tt < 0) {
return FALSE; }
1399 timespecFromTime_t(ts, tt);
1418 return "%Y-%m-%dT%H:%M:%SZ";
1430 PERR (
" unable to set current format, %d", df);
1439 xaccDateUtilGetStampNow (
void)
1448 value = kvp_value_new_timespec (ts);
1458 value = kvp_value_new_timespec (ts);
1459 frame = kvp_frame_add_value_nc (frame, path, value);
1466 const char *path __attribute__ ((unused)))
1475 qt = kvp_value_get_time (kvp_frame_get_slot (frame, key));
1478 return qof_time_to_Timespec (qt);
1487 qt = timespecToQofTime (value);
1488 retval = kvp_value_new_time (qt);
1501 qt = kvp_value_get_time (value);
1502 ts = qof_time_to_Timespec (qt);
1505 #define NUM_CLOCKS 10
1506 static struct timeval qof_clock[NUM_CLOCKS] = {
1507 {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0},
1508 {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0},
1511 static struct timeval qof_clock_total[NUM_CLOCKS] = {
1512 {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0},
1513 {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0},
1520 const gchar * function_name,
const gchar * format, ...)
1524 if ((0 > clockno) || (NUM_CLOCKS <= clockno))
1526 #ifdef HAVE_GETTIMEOFDAY
1527 gettimeofday (&qof_clock[clockno], NULL);
1529 time (&(qof_clock[clockno].tv_sec));
1530 qof_clock[clockno].tv_usec = 0;
1536 fprintf (fout,
"Clock %d Start: %s: ",
1539 va_start (ap, format);
1541 vfprintf (fout, format, ap);
1545 fprintf (fout,
"\n");
1553 const gchar * function_name,
const gchar * format, ...)
1558 if ((0 > clockno) || (NUM_CLOCKS <= clockno))
1560 #ifdef HAVE_GETTIMEOFDAY
1561 gettimeofday (&now, NULL);
1563 time (&(now.tv_sec));
1567 if (now.tv_usec < qof_clock[clockno].tv_usec)
1570 now.tv_usec += 1000000;
1572 now.tv_sec -= qof_clock[clockno].tv_sec;
1573 now.tv_usec -= qof_clock[clockno].tv_usec;
1575 qof_clock_total[clockno].tv_sec += now.tv_sec;
1576 qof_clock_total[clockno].tv_usec += now.tv_usec;
1581 fprintf (fout,
"Clock %d Elapsed: %ld.%06lds %s: ",
1582 clockno, (
long int) now.tv_sec, (
long int) now.tv_usec,
1585 va_start (ap, format);
1587 vfprintf (fout, format, ap);
1591 fprintf (fout,
"\n");
1599 const gchar * function_name,
const gchar * format, ...)
1603 if ((0 > clockno) || (NUM_CLOCKS <= clockno))
1606 while (qof_clock_total[clockno].tv_usec >= 1000000)
1608 qof_clock_total[clockno].tv_sec++;
1609 qof_clock_total[clockno].tv_usec -= 1000000;
1615 fprintf (fout,
"Clock %d Total Elapsed: %ld.%06lds %s: ",
1617 (
long int) qof_clock_total[clockno].tv_sec,
1618 (
long int) qof_clock_total[clockno].tv_usec,
1621 va_start (ap, format);
1623 vfprintf (fout, format, ap);
1627 fprintf (fout,
"\n");
1633 qof_session_get_current_session (
void)
1635 if (!current_session)
1638 current_session = qof_session_new ();
1642 return current_session;
1648 current_session = session;
1652 qof_session_clear_current_session (
void)
1654 current_session = NULL;
1658 gnc_strisnum (
const guchar * s)
1665 time_t secs,
const char *first_name, ...)
1672 va_start (ap, first_name);
1680 const gchar *guid_name,
GUID * desired_guid)
1683 guid_name, desired_guid);
1687 gnc_kvp_bag_remove_frame (
KvpFrame * root,
const char *path,
1694 gnc_kvp_bag_merge (
KvpFrame * kvp_into,
const char *intopath,
1695 KvpFrame * kvp_from,
const char *frompath)
1700 static gboolean param_flag = TRUE;
1702 param_edit_cb (
QofParam * param, gpointer user_data)
1711 param_commit_cb (
QofParam * param, gpointer user_data)
1743 void (*on_error) (
QofInstance *, QofBackendError),
1751 if (be && qof_backend_commit_exists(be))
1753 QofBackendError errcode;
1755 errcode = qof_backend_get_error (be);
1756 }
while (ERR_BACKEND_NO_ERR != errcode);
1757 qof_backend_run_commit(be, inst);
1758 errcode = qof_backend_get_error (be);
1759 if (ERR_BACKEND_NO_ERR != errcode)
1761 inst->do_free = FALSE;
1763 qof_backend_set_error (be, errcode);
1765 on_error (inst, errcode);
1766 LEAVE (
" errcode=%d", errcode);
1769 inst->dirty = FALSE;
1771 if (inst->do_free) {
1788 double_to_gnc_numeric (
double in, gint64 denom, gint how)
1854 gint64 denom, gint how)
1860 gint64 denom, gint how)
1866 gint64 denom, gint how)
1872 gint64 denom, gint how)
1878 gint64 denom, gint how)
1892 gint64 denom, gint how,
1899 gint64 denom, gint how,
1906 gint64 denom, gint how,
1913 gint64 denom, gint how,
1930 qof_session_push_error (
QofSession * session, QofBackendError err,
1931 const gchar *message)
1959 return ERR_BACKEND_NO_BACKEND;
1962 if (ERR_BACKEND_NO_ERR != session->
last_err)
1968 if (!session->backend)
1969 return ERR_BACKEND_NO_ERR;
1971 err = qof_backend_get_error (session->backend);
1980 qof_error_set_be (be, err);
1987 return ERR_BACKEND_NO_BACKEND;
1995 qof_backend_set_message (
QofBackend * be,
const gchar * format, ...)
2013 va_start (args, format);
2014 buffer = (gchar *) g_strdup_vprintf (format, args);
2023 return g_strdup (
"ERR_BACKEND_NO_BACKEND");
2036 set_deprecated_errors (
void)
2040 for (err = 0;err < ERR_LAST; err++)
2044 case ERR_BACKEND_NO_ERR:
2048 case ERR_BACKEND_NO_HANDLER:
2049 case ERR_BACKEND_NO_BACKEND:
2050 case ERR_BACKEND_BAD_URL:
2051 case ERR_BACKEND_CANT_CONNECT:
2052 case ERR_BACKEND_CONN_LOST:
2053 case ERR_BACKEND_TOO_NEW:
2054 case ERR_BACKEND_NO_SUCH_DB:
2055 case ERR_BACKEND_LOCKED:
2056 case ERR_BACKEND_READONLY:
2057 case ERR_BACKEND_DATA_CORRUPT:
2058 case ERR_BACKEND_SERVER_ERR:
2059 case ERR_BACKEND_PERM:
2060 case ERR_BACKEND_MISC:
2061 case ERR_QSF_INVALID_OBJ:
2062 case ERR_QSF_INVALID_MAP:
2063 case ERR_QSF_BAD_QOF_VERSION:
2064 case ERR_QSF_BAD_MAP:
2065 case ERR_QSF_BAD_OBJ_GUID:
2066 case ERR_QSF_NO_MAP:
2067 case ERR_QSF_WRONG_MAP:
2068 case ERR_QSF_MAP_NOT_OBJ:
2069 case ERR_QSF_OVERFLOW:
2070 case ERR_QSF_OPEN_NOT_MERGE:
2071 case ERR_FILEIO_FILE_BAD_READ:
2072 case ERR_FILEIO_PARSE_ERROR:
2073 case ERR_FILEIO_FILE_EMPTY:
2074 case ERR_FILEIO_FILE_NOT_FOUND:
2075 case ERR_FILEIO_FILE_TOO_OLD:
2076 case ERR_FILEIO_UNKNOWN_FILE_TYPE:
2077 case ERR_FILEIO_BACKUP_ERROR:
2078 case ERR_FILEIO_WRITE_ERROR:
2079 case ERR_SQL_DB_TOO_OLD:
2080 case ERR_SQL_DB_BUSY:
2082 deprecated_support (err, QofBackendErrorasString(err));
2091 gint double_compare (gdouble d1, gdouble d2)