Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- Bacula® is a registered trademark of John Walker.
+ Bacula® is a registered trademark of Kern Sibbald.
The licensor of Bacula is the Free Software Foundation Europe
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
#endif
#include <sys/types.h>
+
+#if defined(HAVE_WIN32)
+#if defined(HAVE_MINGW)
+#include "mingwconfig.h"
+#else
+#include "winconfig.h"
+#endif
+#else
#ifndef __CONFIG_H
-#define __CONFIG_H
#include "config.h"
+#define __CONFIG_H
#endif
+#endif
+
#include "bc_types.h"
#include "lib/plugins.h"
#include <sys/stat.h>
* This packet is used for file save info transfer.
*/
struct save_pkt {
- char *fname; /* Full path and filename */
- char *link; /* Link name if any */
- struct stat statp; /* System stat() packet for file */
- int32_t type; /* FT_xx for this file */
- uint32_t flags; /* Bacula internal flags */
- bool portable; /* set if data format is portable */
- char *cmd; /* command */
+ int32_t pkt_size; /* size of this packet */
+ char *fname; /* Full path and filename */
+ char *link; /* Link name if any */
+ struct stat statp; /* System stat() packet for file */
+ int32_t type; /* FT_xx for this file */
+ uint32_t flags; /* Bacula internal flags */
+ bool portable; /* set if data format is portable */
+ char *cmd; /* command */
+ int32_t pkt_end; /* end packet sentinel */
};
/*
* This packet is used for file restore info transfer.
*/
struct restore_pkt {
+ int32_t pkt_size; /* size of this packet */
int32_t stream; /* attribute stream id */
int32_t data_stream; /* id of data stream to follow */
int32_t type; /* file type FT */
const char *where; /* where */
const char *RegexWhere; /* regex where */
int replace; /* replace flag */
+ int create_status; /* status from createFile() */
+ int32_t pkt_end; /* end packet sentinel */
};
enum {
};
struct io_pkt {
+ int32_t pkt_size; /* Size of this packet */
int32_t func; /* Function code */
int32_t count; /* read/write count */
+ int32_t flags; /* Open flags */
mode_t mode; /* permissions for created files */
- int32_t flags; /* open flags (e.g. O_WRONLY ...) */
char *buf; /* read/write buffer */
+ const char *fname; /* open filename */
int32_t status; /* return status */
int32_t io_errno; /* errno code */
- int32_t whence;
- boffset_t offset;
+ int32_t lerror; /* Win32 error code */
+ int32_t whence; /* lseek argument */
+ boffset_t offset; /* lseek argument */
+ bool win32; /* Win32 GetLastError returned */
+ int32_t pkt_end; /* end packet sentinel */
};
/****************************************************************************
bEventRestoreCommand = 10,
bEventLevel = 11,
bEventSince = 12,
+ bEventCancelCommand = 13,
} bEventType;
typedef struct s_bEvent {
uint32_t version;
} bInfo;
-/* Bacula Core Routines -- not used by plugins */
+/* Bacula Core Routines -- not used within a plugin */
+#ifdef FILE_DAEMON
struct BFILE; /* forward referenced */
struct FF_PKT;
void load_fd_plugins(const char *plugin_dir);
void free_plugins(JCR *jcr);
void generate_plugin_event(JCR *jcr, bEventType event, void *value=NULL);
bool send_plugin_name(JCR *jcr, BSOCK *sd, bool start);
-void plugin_name_stream(JCR *jcr, char *name);
+bool plugin_name_stream(JCR *jcr, char *name);
int plugin_create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace);
bool plugin_set_attributes(JCR *jcr, ATTR *attr, BFILE *ofd);
int plugin_save(JCR *jcr, FF_PKT *ff_pkt, bool top_level);
+#endif
#ifdef __cplusplus
extern "C" {
typedef struct s_pluginInfo {
uint32_t size;
uint32_t version;
- char *plugin_magic;
- char *plugin_license;
- char *plugin_author;
- char *plugin_date;
- char *plugin_version;
- char *plugin_description;
+ const char *plugin_magic;
+ const char *plugin_license;
+ const char *plugin_author;
+ const char *plugin_date;
+ const char *plugin_version;
+ const char *plugin_description;
} pInfo;
/*