2 Bacula(R) - The Network Backup Solution
4 Copyright (C) 2000-2018 Kern Sibbald
6 The original author of Bacula is Kern Sibbald, with contributions
7 from many others, a complete list can be found in the file AUTHORS.
9 You may use this file and others of this release according to the
10 license defined in the LICENSE file, which includes the Affero General
11 Public License, v3.0 ("AGPLv3") and some additional permissions and
12 terms pursuant to its AGPLv3 Section 7.
14 This notice must be preserved when any source code is
15 conveyed and/or propagated.
17 Bacula(R) is a registered trademark of Kern Sibbald.
20 * Written by James Harper, July 2010
23 #ifndef _EXCHANGE_FD_H
24 #define _EXCHANGE_FD_H
28 #if defined(BUILDING_DLL)
29 # define DLL_IMP_EXP __declspec(dllexport)
30 #elif defined(USING_DLL)
31 # define DLL_IMP_EXP __declspec(dllimport)
36 #if defined(HAVE_WIN32)
37 #if defined(HAVE_MINGW)
40 #include "winconfig.h"
48 /* Keep M_ABORT=1 for dlist.h */
49 M_ABORT = 1, /* MUST abort immediately */
50 M_DEBUG, /* debug message */
51 M_FATAL, /* Fatal error, stopping job */
52 M_ERROR, /* Error, but recoverable */
53 M_WARNING, /* Warning message */
54 M_INFO, /* Informational message */
55 M_SAVED, /* Info on saved file */
56 M_NOTSAVED, /* Info on notsaved file */
57 M_SKIPPED, /* File skipped during backup by option setting */
58 M_MOUNT, /* Mount requests */
59 M_ERROR_TERM, /* Error termination request (no dump) */
60 M_TERM, /* Terminating daemon normally */
61 M_RESTORED, /* ls -l of restored files */
62 M_SECURITY, /* security violation */
63 M_ALERT, /* tape alert messages */
64 M_VOLMGMT /* Volume management messages */
71 #define _THREAD_SAFE 1
72 #define _POSIX_PTHREAD_SEMANTICS 1
79 #include <sys/types.h>
80 #ifdef HAVE_SYS_BITYPES_H
81 #include <sys/bitypes.h>
88 typedef int64_t boffset_t;
89 //#define bstrdup(str) strcpy((char *)bmalloc(strlen((str))+1),(str))
90 #define bstrdup(str) strdup(str)
92 #include "fd_plugins.h"
95 #if defined(HAVE_WIN32)
102 #define EXCHANGE_PLUGIN_VERSION 1
104 #define JOB_TYPE_BACKUP 1
105 #define JOB_TYPE_RESTORE 2
107 #define JOB_LEVEL_FULL ((int)'F')
108 #define JOB_LEVEL_INCREMENTAL ((int)'I')
109 #define JOB_LEVEL_DIFFERENTIAL ((int)'D')
111 struct exchange_fd_context_t;
113 #include "exch_node.h"
115 struct exchange_fd_context_t {
116 struct bpContext *bpContext;
117 WCHAR *computer_name;
119 root_node_t *root_node;
120 node_t *current_node;
124 bool notrunconfull_option;
130 static inline char *tocharstring(WCHAR *src)
132 char *tmp = new char[wcslen(src) + 1];
133 wcstombs(tmp, src, wcslen(src) + 1);
137 static inline WCHAR *towcharstring(char *src)
139 WCHAR *tmp = new WCHAR[strlen(src) + 1];
140 mbstowcs(tmp, src, strlen(src) + 1);
144 #define safe_delete(buf) if (buf) { delete buf; buf=NULL; }
146 extern bFuncs *bfuncs;
149 #define _DebugMessage(level, message, ...) bfuncs->DebugMessage(context->bpContext, __FILE__, __LINE__, level, message, ##__VA_ARGS__)
150 #define _JobMessage(type, message, ...) bfuncs->JobMessage(context->bpContext, __FILE__, __LINE__, type, 0, message, ##__VA_ARGS__)
151 #define _JobMessageNull(type, message, ...) bfuncs->JobMessage(NULL, __FILE__, __LINE__, type, 0, message, ##__VA_ARGS__)
153 #define PLUGIN_PATH_PREFIX_BASE "@EXCHANGE"
154 #define PLUGIN_PATH_PREFIX_SERVICE "Microsoft Information Store"
155 #define PLUGIN_PATH_PREFIX_SERVICE_W L"Microsoft Information Store"
157 #endif /* _EXCHANGE_FD_H */