00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef QOF_DISABLE_DEPRECATED
00024
00025 #ifndef _DEPRECATED_H
00026 #define _DEPRECATED_H
00027 #include "qof.h"
00028
00034 #define gncLogLevel QofLogLevel
00035
00037 void gnc_log_init (void);
00038
00040 void gnc_set_log_level (QofLogModule module, gncLogLevel level);
00041
00043 void gnc_set_log_level_global (gncLogLevel level);
00044
00057 void qof_log_set_level_global (QofLogLevel level);
00058
00060 void gnc_set_logfile (FILE * outfile);
00061
00063 const char *gnc_log_prettify (const char *name);
00064
00066 gboolean gnc_should_log (QofLogModule log_module, gncLogLevel log_level);
00067
00069 #define GNC_LOG_FATAL QOF_LOG_FATAL
00070
00071 #define GNC_LOG_ERROR QOF_LOG_ERROR
00072
00073 #define GNC_LOG_WARNING QOF_LOG_WARNING
00074
00075 #define GNC_LOG_INFO QOF_LOG_INFO
00076
00077 #define GNC_LOG_DEBUG QOF_LOG_DEBUG
00078
00079 #define GNC_LOG_DETAIL QOF_LOG_DETAIL
00080
00081 #define GNC_LOG_TRACE QOF_LOG_TRACE
00082
00084 void gnc_start_clock (int, QofLogModule, gncLogLevel, const char *,
00085 const char *, ...);
00087 void gnc_report_clock (int, QofLogModule, gncLogLevel, const char *,
00088 const char *, ...);
00090 void gnc_report_clock_total (int, QofLogModule, gncLogLevel, const char *,
00091 const char *, ...);
00092
00094 #define GNC_EVENT_NONE QOF_EVENT_NONE
00095
00096 #define GNC_EVENT_CREATE QOF_EVENT_CREATE
00097
00098 #define GNC_EVENT_MODIFY QOF_EVENT_MODIFY
00099
00100 #define GNC_EVENT_DESTROY QOF_EVENT_DESTROY
00101
00102 #define GNC_EVENT_ADD QOF_EVENT_ADD
00103
00104 #define GNC_EVENT_REMOVE QOF_EVENT_REMOVE
00105
00106 #define GNC_EVENT_ALL QOF_EVENT_ALL
00107
00108 #define GNCEngineEventType QofEventId
00109
00110 typedef void (*GNCEngineEventHandler) (GUID * entity, QofIdType type,
00111 GNCEngineEventType event_type,
00112 gpointer user_data);
00116 gint qof_event_register_old_handler (GNCEngineEventHandler old_handler,
00117 gpointer user_data);
00119 gint gnc_engine_register_event_handler (GNCEngineEventHandler handler,
00120 gpointer user_data);
00122 void gnc_engine_unregister_event_handler (gint handler_id);
00124 void gnc_engine_gen_event (QofEntity * entity, GNCEngineEventType event_type);
00126 void gnc_engine_suspend_events (void);
00128 void gnc_engine_resume_events (void);
00130 void gnc_engine_generate_event (const GUID * guid, QofIdType e_type,
00131 GNCEngineEventType event_type);
00133 #define qof_book_mergeResult QofBookMergeResult
00134
00135 #define qof_book_mergeRule QofBookMergeRule
00136
00137 #define qof_book_mergeData QofBookMergeData
00138
00139 QofBookMergeData *qof_book_mergeInit (QofBook * importBook,
00140 QofBook * targetBook);
00142 typedef void (*qof_book_mergeRuleForeachCB) (QofBookMergeData *,
00143 QofBookMergeRule *, guint);
00145 void qof_book_mergeRuleForeach (QofBookMergeData * mergeData,
00146 QofBookMergeRuleForeachCB callback,
00147 QofBookMergeResult mergeResult);
00149 QofBookMergeData *qof_book_mergeUpdateResult (QofBookMergeData * mergeData,
00150 QofBookMergeResult tag);
00152 gint qof_book_mergeCommit (QofBookMergeData * mergeData);
00155 #define SAFE_STRCMP_REAL(fcn,da,db) { \
00156 if ((da) && (db)) { \
00157 if ((da) != (db)) { \
00158 gint retval = fcn ((da), (db)); \
00159 \
00160 if (retval) return retval; \
00161 } \
00162 } else \
00163 if ((!(da)) && (db)) { \
00164 return -1; \
00165 } else \
00166 if ((da) && (!(db))) { \
00167 return +1; \
00168 } \
00169 }
00170
00171 #define SAFE_STRCMP(da,db) SAFE_STRCMP_REAL(strcmp,(da),(db))
00172
00173 #define SAFE_STRCASECMP(da,db) SAFE_STRCMP_REAL(strcasecmp,(da),(db))
00174
00175 gpointer gnc_string_cache_insert (gconstpointer key);
00177 #define GNC_SCANF_LLD QOF_SCANF_LLD
00178
00179 gchar *gnc_stpcpy (gchar * dest, const gchar * src);
00181 GCache *gnc_engine_get_string_cache (void);
00183 GCache *qof_util_get_string_cache (void);
00185 void gnc_engine_string_cache_destroy (void);
00187 void gnc_string_cache_remove (gconstpointer key);
00189 void qof_book_set_schedxactions (QofBook * book, GList * newList);
00191 typedef enum
00192 {
00194 GNCDATE_MONTH_NUMBER,
00196 GNCDATE_MONTH_ABBREV,
00198 GNCDATE_MONTH_NAME
00199 } GNCDateMonthFormat;
00201 const gchar* gnc_date_dateformat_to_string(QofDateFormat format);
00203 const gchar* gnc_date_monthformat_to_string(GNCDateMonthFormat format);
00212 gboolean gnc_date_string_to_dateformat (const gchar * format_string,
00213 QofDateFormat * format);
00215 gboolean gnc_date_string_to_monthformat (const gchar * format_string,
00216 GNCDateMonthFormat * format);
00218 gboolean timespec_equal (const Timespec * ta, const Timespec * tb);
00220 gint timespec_cmp (const Timespec * ta, const Timespec * tb);
00222 Timespec timespec_diff (const Timespec * ta, const Timespec * tb);
00224 Timespec timespec_abs (const Timespec * t);
00226 Timespec timespecCanonicalDayTime (Timespec t);
00228 time_t timespecToTime_t (Timespec ts);
00230 void timespecFromTime_t (Timespec * ts, time_t t);
00232 Timespec gnc_dmy2timespec (gint day, gint month, gint year);
00234 Timespec gnc_dmy2timespec_end (gint day, gint month, gint year);
00236 Timespec gnc_iso8601_to_timespec_gmt (const gchar *);
00238 gchar *gnc_timespec_to_iso8601_buff (Timespec ts, gchar * buff);
00240 void gnc_timespec2dmy (Timespec ts, gint * day, gint * month, gint * year);
00242 void date_add_months (struct tm *tm, gint months, gboolean track_last_day);
00244 gboolean qof_date_add_days(Timespec *ts, gint days);
00246 gboolean qof_date_add_months(Timespec *ts, gint months, gboolean track_last_day);
00248 const gchar *qof_date_format_get_string(QofDateFormat df);
00250 time_t xaccDMYToSec (gint day, gint month, gint year);
00252 glong gnc_timezone (struct tm *tm);
00254 QofDateFormat qof_date_format_get(void);
00256 void qof_date_format_set(QofDateFormat df);
00258 const gchar *qof_date_text_format_get_string(QofDateFormat df);
00260 char dateSeparator (void);
00263 time_t qof_date_dmy_to_sec (gint day, gint month, gint year);
00265 size_t qof_print_hours_elapsed_buff (char *buff, size_t len, int secs,
00266 gboolean show_secs);
00268 size_t qof_print_minutes_elapsed_buff (char *buff, size_t len, int secs,
00269 gboolean show_secs);
00271 size_t qof_print_time_buff (char *buff, size_t len, time_t secs);
00273 size_t qof_print_date_time_buff (char *buff, size_t len, time_t secs);
00275 gboolean qof_is_same_day (time_t, time_t);
00277 void gnc_tm_get_day_start (struct tm *tm, time_t time_val);
00279 void gnc_tm_set_day_start (struct tm *tm);
00281 void gnc_tm_set_day_middle (struct tm *tm);
00283 void gnc_tm_set_day_end (struct tm *tm);
00285 void gnc_tm_get_day_end (struct tm *tm, time_t time_val);
00287 time_t gnc_timet_get_day_start (time_t time_val);
00289 time_t gnc_timet_get_day_end (time_t time_val);
00291 void gnc_tm_get_today_start (struct tm *tm);
00293 void gnc_tm_get_today_end (struct tm *tm);
00295 time_t gnc_timet_get_today_start (void);
00297 time_t gnc_timet_get_today_end (void);
00298 #ifndef GNUCASH_MAJOR_VERSION
00299
00300 time_t gnc_timet_get_day_start_gdate (GDate * date);
00302 time_t gnc_timet_get_day_end_gdate (GDate * date);
00303 #endif
00304
00305 int date_get_last_mday (struct tm *tm);
00307 gboolean date_is_last_mday (struct tm *tm);
00309 int gnc_date_my_last_mday (int month, int year);
00311 int gnc_timespec_last_mday (Timespec ts);
00313 char * xaccDateUtilGetStampNow (void);
00315 char *xaccDateUtilGetStamp (time_t thyme);
00317 size_t qof_print_date_dmy_buff (gchar * buff, size_t buflen,
00318 gint day, gint month, gint year);
00320 size_t qof_print_date_buff (char *buff, size_t buflen, time_t secs);
00322 size_t qof_print_gdate (char *buf, size_t bufflen, GDate * gd);
00324 char *qof_print_date (time_t secs);
00326 const char *gnc_print_date (Timespec ts);
00328 gboolean qof_scan_date (const char *buff, int *day, int *month, int *year);
00330 gboolean qof_scan_date_secs (const char *buff, time_t * secs);
00333 #define qof_book_set_guid(book,guid) \
00334 qof_entity_set_guid(QOF_ENTITY(book), guid)
00335
00336 #define QOF_TYPE_DATE "date"
00337
00338 Timespec qof_instance_get_last_update (QofInstance * inst);
00339 void qof_instance_set_last_update (QofInstance * inst, Timespec ts);
00341 void kvp_frame_set_timespec (KvpFrame * frame, const gchar * path,
00342 Timespec ts);
00344 void kvp_frame_add_timespec (KvpFrame * frame, const gchar * path,
00345 Timespec ts);
00347 Timespec kvp_value_get_timespec (const KvpValue * value);
00349 Timespec kvp_frame_get_timespec (const KvpFrame * frame, const gchar * path);
00351 KvpValue *kvp_value_new_timespec (Timespec timespec);
00353 #define qof_book_get_guid(X) qof_entity_get_guid (QOF_ENTITY(X))
00354
00355 void qof_start_clock (gint clockno, QofLogModule log_module,
00356 QofLogLevel log_level, const gchar * function_name,
00357 const gchar * format, ...);
00359 void qof_report_clock (gint clockno,
00360 QofLogModule log_module,
00361 QofLogLevel log_level,
00362 const gchar * function_name,
00363 const gchar * format, ...);
00365 void qof_report_clock_total (gint clockno,
00366 QofLogModule log_module,
00367 QofLogLevel log_level,
00368 const gchar * function_name,
00369 const gchar * format, ...);
00371 #define START_CLOCK(clockno,format, args...) do { \
00372 if (qof_log_check (log_module, QOF_LOG_INFO)) \
00373 qof_start_clock (clockno, log_module, QOF_LOG_INFO, \
00374 __FUNCTION__, format , ## args); \
00375 } while (0)
00376
00377 #define REPORT_CLOCK(clockno,format, args...) do { \
00378 if (qof_log_check (log_module, QOF_LOG_INFO)) \
00379 qof_report_clock (clockno, log_module, QOF_LOG_INFO, \
00380 __FUNCTION__, format , ## args); \
00381 } while (0)
00382
00383 #define REPORT_CLOCK_TOTAL(clockno,format, args...) do { \
00384 if (qof_log_check (log_module, QOF_LOG_INFO)) \
00385 qof_report_clock_total (clockno, log_module, QOF_LOG_INFO, \
00386 __FUNCTION__, format , ## args); \
00387 } while (0)
00388
00390 void qof_query_print (QofQuery * query);
00392 typedef struct
00393 {
00394 QofQueryPredData pd;
00395 QofDateMatch options;
00396 Timespec date;
00397 } query_date_def, *query_date_t;
00399 QofQueryPredData *
00400 qof_query_date_predicate (QofQueryCompare how,
00401 QofDateMatch options,
00402 Timespec date);
00404 gboolean
00405 qof_query_date_predicate_get_date (QofQueryPredData * pd,
00406 Timespec * date);
00409 QofSession *qof_session_get_current_session (void);
00412 void qof_session_set_current_session (QofSession * session);
00415 void
00416 qof_session_clear_current_session (void);
00418 gboolean gnc_strisnum (const guchar * s);
00420 KvpFrame *
00421 gnc_kvp_bag_add (KvpFrame * pwd, const char *path,
00422 time_t secs, const char *first_name, ...);
00424 KvpFrame *
00425 gnc_kvp_bag_find_by_guid (KvpFrame * root, const char *path,
00426 const char *guid_name, GUID * desired_guid);
00428 void
00429 gnc_kvp_bag_remove_frame (KvpFrame * root, const char *path,
00430 KvpFrame * fr);
00432 void
00433 gnc_kvp_bag_merge (KvpFrame * kvp_into, const char *intopath,
00434 KvpFrame * kvp_from, const char *frompath);
00445 #define QOF_BEGIN_EDIT(inst) qof_begin_edit (inst)
00446
00458 gboolean qof_begin_edit (QofInstance * inst);
00460 #define QOF_COMMIT_EDIT_PART1(inst) qof_commit_edit (inst)
00461
00472 gboolean qof_commit_edit (QofInstance * inst);
00473
00479 #define QOF_COMMIT_EDIT_PART2(inst,on_error,on_done,on_free) { \
00480 QofBackend * be; \
00481 \
00482 be = qof_book_get_backend ((inst)->book); \
00483 if (be) \
00484 { \
00485 QofBackendError errcode; \
00486 \
00487 errcode = qof_backend_get_error (be); \
00488 if (ERR_BACKEND_NO_ERR != errcode) \
00489 { \
00490 (inst)->do_free = FALSE; \
00491 qof_backend_set_error (be, errcode); \
00492 (on_error)((inst), errcode); \
00493 } \
00494 (inst)->dirty = FALSE; \
00495 } \
00496 (on_done)(inst); \
00497 \
00498 if ((inst)->do_free) { \
00499 (on_free)(inst); \
00500 return; \
00501 } \
00502 }
00503
00505 gchar *
00506 qof_util_param_as_string (QofEntity * ent, QofParam * param);
00508 typedef struct _QofNumeric gnc_numeric;
00510 #define GNC_NUMERIC_RND_MASK QOF_NUMERIC_RND_MASK
00511
00512 #define GNC_NUMERIC_DENOM_MASK QOF_NUMERIC_DENOM_MASK
00513
00514 #define GNC_NUMERIC_SIGFIGS_MASK QOF_NUMERIC_SIGFIGS_MASK
00515
00516 #define GNC_HOW_RND_FLOOR QOF_HOW_RND_FLOOR
00517
00518 #define GNC_HOW_RND_CEIL QOF_HOW_RND_CEIL
00519
00520 #define GNC_HOW_RND_TRUNC QOF_HOW_RND_TRUNC
00521
00522 #define GNC_HOW_RND_PROMOTE QOF_HOW_RND_PROMOTE
00523
00524 #define GNC_HOW_RND_ROUND_HALF_DOWN QOF_HOW_RND_ROUND_HALF_DOWN
00525
00526 #define GNC_HOW_RND_ROUND_HALF_UP QOF_HOW_RND_ROUND_HALF_UP
00527
00528 #define GNC_HOW_RND_ROUND QOF_HOW_RND_ROUND
00529
00530 #define GNC_HOW_RND_NEVER QOF_HOW_RND_NEVER
00531
00532 #define GNC_HOW_DENOM_EXACT QOF_HOW_DENOM_EXACT
00533
00534 #define GNC_HOW_DENOM_REDUCE QOF_HOW_DENOM_REDUCE
00535
00536 #define GNC_HOW_DENOM_LCD QOF_HOW_DENOM_LCD
00537
00538 #define GNC_HOW_DENOM_FIXED QOF_HOW_DENOM_FIXED
00539
00540 #define GNC_HOW_DENOM_SIGFIG QOF_HOW_DENOM_SIGFIG
00541
00542 #define GNC_HOW_DENOM_SIGFIGS QOF_HOW_DENOM_SIGFIGS
00543
00544 #define GNC_HOW_GET_SIGFIGS QOF_HOW_GET_SIGFIGS
00545
00546 #define GNC_ERROR_OK QOF_ERROR_OK
00547
00548 #define GNC_ERROR_ARG QOF_ERROR_ARG
00549
00550 #define GNC_ERROR_OVERFLOW QOF_ERROR_OVERFLOW
00551
00552 #define GNC_ERROR_DENOM_DIFF QOF_ERROR_DENOM_DIFF
00553
00554 #define GNC_ERROR_REMAINDER QOF_ERROR_REMAINDER
00555
00556 #define GNCNumericErrorCode QofNumericErrorCode
00557
00558 #define GNC_DENOM_AUTO QOF_DENOM_AUTO
00559
00560 #define GNC_DENOM_RECIPROCAL QOF_DENOM_RECIPROCAL
00561
00562 static inline gnc_numeric
00563 gnc_numeric_create (gint64 num, gint64 denom)
00564 {
00565 QofNumeric out;
00566 out.num = num;
00567 out.denom = denom;
00568 return out;
00569 }
00571 static inline gnc_numeric
00572 gnc_numeric_zero (void)
00573 {
00574 return qof_numeric_create (0, 1);
00575 }
00577 gnc_numeric
00578 double_to_gnc_numeric (double in, gint64 denom, gint how);
00580 gboolean
00581 string_to_gnc_numeric (const gchar * str, gnc_numeric * n);
00583 gnc_numeric
00584 gnc_numeric_error (GNCNumericErrorCode error_code);
00586 static inline gint64
00587 gnc_numeric_num (gnc_numeric a)
00588 {
00589 return a.num;
00590 }
00592 static inline gint64
00593 gnc_numeric_denom (gnc_numeric a)
00594 {
00595 return a.denom;
00596 }
00598 gdouble
00599 gnc_numeric_to_double (gnc_numeric in);
00601 gchar *
00602 gnc_numeric_to_string (gnc_numeric n);
00604 gchar *
00605 gnc_num_dbg_to_string (gnc_numeric n);
00607 GNCNumericErrorCode
00608 gnc_numeric_check (gnc_numeric a);
00610 gint
00611 gnc_numeric_compare (gnc_numeric a, gnc_numeric b);
00613 gboolean
00614 gnc_numeric_zero_p (gnc_numeric a);
00616 gboolean
00617 gnc_numeric_negative_p (gnc_numeric a);
00619 gboolean
00620 gnc_numeric_positive_p (gnc_numeric a);
00622 gboolean
00623 gnc_numeric_eq (gnc_numeric a, gnc_numeric b);
00625 gboolean
00626 gnc_numeric_equal (gnc_numeric a, gnc_numeric b);
00628 gint
00629 gnc_numeric_same (gnc_numeric a, gnc_numeric b,
00630 gint64 denom, gint how);
00632 gnc_numeric
00633 gnc_numeric_add (gnc_numeric a, gnc_numeric b,
00634 gint64 denom, gint how);
00636 gnc_numeric
00637 gnc_numeric_sub (gnc_numeric a, gnc_numeric b,
00638 gint64 denom, gint how);
00640 gnc_numeric
00641 gnc_numeric_mul (gnc_numeric a, gnc_numeric b,
00642 gint64 denom, gint how);
00644 gnc_numeric
00645 gnc_numeric_div (gnc_numeric x, gnc_numeric y,
00646 gint64 denom, gint how);
00648 gnc_numeric gnc_numeric_neg (gnc_numeric a);
00650 gnc_numeric gnc_numeric_abs (gnc_numeric a);
00652 static inline gnc_numeric
00653 gnc_numeric_add_fixed (gnc_numeric a, gnc_numeric b)
00654 {
00655 return qof_numeric_add (a, b, QOF_DENOM_AUTO,
00656 QOF_HOW_DENOM_FIXED | QOF_HOW_RND_NEVER);
00657 }
00659 static inline gnc_numeric
00660 gnc_numeric_sub_fixed (gnc_numeric a, gnc_numeric b)
00661 {
00662 return gnc_numeric_sub (a, b, QOF_DENOM_AUTO,
00663 QOF_HOW_DENOM_FIXED | QOF_HOW_RND_NEVER);
00664 }
00666 gnc_numeric
00667 gnc_numeric_add_with_error (gnc_numeric a, gnc_numeric b,
00668 gint64 denom, gint how,
00669 gnc_numeric * error);
00671 gnc_numeric
00672 gnc_numeric_sub_with_error (gnc_numeric a, gnc_numeric b,
00673 gint64 denom, gint how,
00674 gnc_numeric * error);
00676 gnc_numeric
00677 gnc_numeric_mul_with_error (gnc_numeric a, gnc_numeric b,
00678 gint64 denom, gint how,
00679 gnc_numeric * error);
00681 gnc_numeric
00682 gnc_numeric_div_with_error (gnc_numeric a, gnc_numeric b,
00683 gint64 denom, gint how,
00684 gnc_numeric * error);
00686 gnc_numeric
00687 gnc_numeric_convert (gnc_numeric in, gint64 denom, gint how);
00689 gnc_numeric
00690 gnc_numeric_convert_with_error (gnc_numeric in, gint64 denom,
00691 gint how, gnc_numeric * error);
00693 gnc_numeric gnc_numeric_reduce (gnc_numeric in);
00695 #define GNC_RND_FLOOR QOF_HOW_RND_FLOOR
00696
00697 #define GNC_RND_CEIL QOF_HOW_RND_CEIL
00698
00699 #define GNC_RND_TRUNC QOF_HOW_RND_TRUNC
00700
00701 #define GNC_RND_PROMOTE QOF_HOW_RND_PROMOTE
00702
00703 #define GNC_RND_ROUND_HALF_DOWN QOF_HOW_RND_ROUND_HALF_DOWN
00704
00705 #define GNC_RND_ROUND_HALF_UP QOF_HOW_RND_ROUND_HALF_UP
00706
00707 #define GNC_RND_ROUND QOF_HOW_RND_ROUND
00708
00709 #define GNC_RND_NEVER QOF_HOW_RND_NEVER
00710
00711 #define GNC_DENOM_EXACT QOF_HOW_DENOM_EXACT
00712
00713 #define GNC_DENOM_REDUCE QOF_HOW_DENOM_REDUCE
00714
00715 #define GNC_DENOM_LCD QOF_HOW_DENOM_LCD
00716
00717 #define GNC_DENOM_FIXED QOF_HOW_DENOM_FIXED
00718
00719 #define GNC_DENOM_SIGFIG QOF_HOW_DENOM_SIGFIG
00720
00721 #define GNC_DENOM_SIGFIGS(X) QOF_HOW_DENOM_SIGFIGS(X)
00722
00723 #define GNC_NUMERIC_GET_SIGFIGS(X) QOF_HOW_GET_SIGFIGS(X)
00724
00725 QofBackend *gncBackendInit_file (const char *book_id, void *data);
00726
00731 #define ENUM_LIST_DEP(_) \
00732 _(ERR_BACKEND_NO_ERR, =0) \
00733 _(ERR_BACKEND_NO_HANDLER,) \
00734 _(ERR_BACKEND_NO_BACKEND,) \
00735 _(ERR_BACKEND_BAD_URL,) \
00736 _(ERR_BACKEND_NO_SUCH_DB,) \
00737 _(ERR_BACKEND_CANT_CONNECT,) \
00738 _(ERR_BACKEND_CONN_LOST,) \
00739 _(ERR_BACKEND_LOCKED,) \
00740 _(ERR_BACKEND_READONLY,) \
00741 _(ERR_BACKEND_TOO_NEW,) \
00742 _(ERR_BACKEND_DATA_CORRUPT,) \
00743 _(ERR_BACKEND_SERVER_ERR,) \
00744 _(ERR_BACKEND_ALLOC,) \
00745 _(ERR_BACKEND_PERM,) \
00746 _(ERR_BACKEND_MODIFIED,) \
00747 _(ERR_BACKEND_MOD_DESTROY,) \
00748 _(ERR_BACKEND_MISC,) \
00749 _(ERR_QSF_INVALID_OBJ,) \
00750 _(ERR_QSF_INVALID_MAP,) \
00751 _(ERR_QSF_BAD_OBJ_GUID,) \
00752 _(ERR_QSF_BAD_QOF_VERSION,) \
00753 _(ERR_QSF_BAD_MAP,) \
00754 _(ERR_QSF_NO_MAP,) \
00755 _(ERR_QSF_WRONG_MAP,) \
00756 _(ERR_QSF_MAP_NOT_OBJ,) \
00757 _(ERR_QSF_OVERFLOW,) \
00758 _(ERR_QSF_OPEN_NOT_MERGE,) \
00759 _(ERR_FILEIO_FILE_BAD_READ, =1000) \
00760 _(ERR_FILEIO_FILE_EMPTY,) \
00761 _(ERR_FILEIO_FILE_LOCKERR,) \
00762 _(ERR_FILEIO_FILE_NOT_FOUND,) \
00763 _(ERR_FILEIO_FILE_TOO_OLD,) \
00764 _(ERR_FILEIO_UNKNOWN_FILE_TYPE,) \
00765 _(ERR_FILEIO_PARSE_ERROR,) \
00766 _(ERR_FILEIO_BACKUP_ERROR,) \
00767 _(ERR_FILEIO_WRITE_ERROR,) \
00768 _(ERR_FILEIO_READ_ERROR,) \
00769 _(ERR_FILEIO_NO_ENCODING,) \
00770 _(ERR_NETIO_SHORT_READ, =2000) \
00771 _(ERR_NETIO_WRONG_CONTENT_TYPE,) \
00772 _(ERR_NETIO_NOT_GNCXML,) \
00773 _(ERR_SQL_MISSING_DATA, =3000) \
00774 _(ERR_SQL_DB_TOO_OLD,) \
00775 _(ERR_SQL_DB_BUSY,) \
00776 _(ERR_RPC_HOST_UNK, =4000) \
00777 _(ERR_RPC_CANT_BIND,) \
00778 _(ERR_RPC_CANT_ACCEPT,) \
00779 _(ERR_RPC_NO_CONNECTION,) \
00780 _(ERR_RPC_BAD_VERSION,) \
00781 _(ERR_RPC_FAILED,) \
00782 _(ERR_RPC_NOT_ADDED,)
00783
00784 DEFINE_ENUM(QofBackendError, ENUM_LIST_DEP)
00785
00786 AS_STRING_DEC(QofBackendError, ENUM_LIST_DEP)
00787
00789 gboolean
00790 qof_commit_edit_part2 (QofInstance * inst,
00791 void (*on_error) (QofInstance *, QofBackendError),
00792 void (*on_done) (QofInstance *),
00793 void (*on_free) (QofInstance *));
00794
00796 void
00797 qof_session_push_error (QofSession * session, QofBackendError err,
00798 const gchar *message);
00801 const gchar *
00802 qof_session_get_error_message (QofSession * session);
00805 QofErrorId
00806 qof_session_pop_error (QofSession * session);
00807 QofErrorId
00808 qof_session_get_error (QofSession * session);
00810 void
00811 qof_backend_set_error (QofBackend * be, QofErrorId err);
00813 QofErrorId
00814 qof_backend_get_error (QofBackend * be);
00816 void
00817 qof_backend_set_message (QofBackend * be, const gchar * format, ...);
00825 gchar *
00826 qof_backend_get_message (QofBackend * be);
00828 #define kvp_frame KvpFrame
00829
00830 #define kvp_value KvpValue
00831
00832 #define kvp_value_t KvpValueType
00833
00834 #define kvp_frame_set_gnc_numeric kvp_frame_set_numeric
00835
00836 #define kvp_frame_set_str kvp_frame_set_string
00837
00838 #define kvp_frame_add_gnc_numeric kvp_frame_add_numeric
00839
00840 #define kvp_frame_add_str kvp_frame_add_string
00841
00842 #define kvp_value_new_gnc_numeric kvp_value_new_numeric
00843
00844 gint double_compare (gdouble d1, gdouble d2);
00845
00846 #endif
00847 #endif