1.1 --- a/librazor/razor-internal.h Thu Feb 09 20:42:08 2012 +0000
1.2 +++ b/librazor/razor-internal.h Sat Feb 11 23:50:26 2012 +0000
1.3 @@ -242,6 +242,23 @@
1.4 wchar_t *razor_utf8_to_utf16(const char *utf8, int len);
1.5 #endif
1.6
1.7 +/* Error functions */
1.8 +struct razor_error {
1.9 + char *path;
1.10 + char *str;
1.11 + char *msg;
1.12 +};
1.13 +
1.14 +#ifdef MSWIN_API
1.15 +struct razor_error *razor_error_new_mswin(const wchar_t *path, DWORD error);
1.16 +#endif
1.17 +
1.18 +#if HAVE_WINDOWS_KTM
1.19 +struct razor_error *razor_error_new_str(const wchar_t *path, const char *str);
1.20 +#else
1.21 +struct razor_error *razor_error_new_str(const char *path, const char *str);
1.22 +#endif
1.23 +
1.24 /* Atomic functions */
1.25
1.26 #if HAVE_WINDOWS_KTM
1.27 @@ -253,9 +270,7 @@
1.28 HANDLE h;
1.29 } *files;
1.30 int in_undo;
1.31 - char *error_path;
1.32 - char *error_str;
1.33 - char *error_msg;
1.34 + struct razor_error *error;
1.35 };
1.36 #elif ENABLE_ATOMIC
1.37 struct atomic_action {
1.38 @@ -298,9 +313,7 @@
1.39 char *toplevel;
1.40 unsigned next_file_tag;
1.41 int in_undo;
1.42 - char *error_path;
1.43 - char *error_str;
1.44 - char *error_msg;
1.45 + struct razor_error *error;
1.46 };
1.47
1.48 char *atomic_action_attic_tmpnam(struct razor_atomic *atomic);
1.49 @@ -317,29 +330,11 @@
1.50 #else /* !HAVE_WINDOWS_KTM && !ENABLE_ATOMIC */
1.51 struct razor_atomic {
1.52 int in_undo;
1.53 - char *error_path;
1.54 - char *error_str;
1.55 - char *error_msg;
1.56 + struct razor_error *error;
1.57 };
1.58 #endif
1.59
1.60 int razor_allow_all_root_names(void);
1.61 int razor_valid_root_name(const char *name);
1.62
1.63 -#ifdef MSWIN_API
1.64 -void
1.65 -razor_atomic_set_error_mswin(struct razor_atomic *atomic, const wchar_t *path,
1.66 - DWORD error);
1.67 -#endif
1.68 -
1.69 -#if HAVE_WINDOWS_KTM
1.70 -void
1.71 -razor_atomic_set_error_str(struct razor_atomic *atomic, const wchar_t *path,
1.72 - const char *str);
1.73 -#else
1.74 -void
1.75 -razor_atomic_set_error_str(struct razor_atomic *atomic, const char *path,
1.76 - const char *str);
1.77 -#endif
1.78 -
1.79 #endif /* _RAZOR_INTERNAL_H_ */