#define NPRT(x) (x)?(x):_("*None*")
#if defined(HAVE_WIN32)
+void InitWinAPIWrapper();
+
+#define OSDependentInit() InitWinAPIWrapper()
+
#undef ENABLE_NLS
+# define DLL_IMP_EXP
+#else
+
+#define DLL_IMP_EXP
+
+#define OSDependentInit()
#endif
#ifdef ENABLE_NLS
/* Use our strdup with smartalloc */
-#ifndef __WXGTK__
+#ifndef HAVE_WXCONSOLE
#undef strdup
#define strdup(buf) bad_call_on_strdup_use_bstrdup(buf)
#endif
#if defined(HAVE_WIN32)
#if defined(HAVE_MINGW)
#include "mingwconfig.h"
-#include "winhost.h"
#define _STAT_H /* don't pull in MinGW stat.h */
#define _STAT_DEFINED /* don't pull in MinGW stat.h */
#else
#include "winconfig.h"
-#include "winhost.h"
#endif
+#include "winhost.h"
#else
#include "config.h"
#include "host.h"
/* Local Bacula includes. Be sure to put all the system
* includes before these.
*/
+#if defined(HAVE_WIN32)
+#include <windows.h>
+#include "win32/compat/compat.h"
+#endif
+
#include "version.h"
#include "bc_types.h"
#include "baconfig.h"
#include "lib/lib.h"
+#ifdef HAVE_WXCONSOLE
+#undef New
+#undef _
+#endif
+
+#if defined(HAVE_WIN32)
+#include "lib/winapi.h"
+#endif
+
#ifndef HAVE_ZLIB_H
#undef HAVE_LIBZ /* no good without headers */
#endif
#endif
#ifdef HAVE_WIN32
-#include <windows.h>
-#include "../lib/winapi.h"
#define isatty(fd) (fd==0)
#endif
signal(SIGTTIN, got_sigtin);
signal(SIGTTOU, got_sigtout);
trapctlc();
-#else
- InitWinAPIWrapper();
#endif
-
+
+ OSDependentInit();
if (argc) {
usage();
#include "dird.h"
extern DIRRES *director;
-extern char my_name[];
/* Commands sent to Storage daemon and File daemon and received
* from the User Agent */
/* Forward referenced functions */
/* External functions */
-extern int debug_level;
extern DIRRES *director;
extern int FDConnectTimeout;
extern void term_ua_server();
/* Imported variables */
-extern time_t watchdog_time;
jobq_t job_queue;
extern int r_first;
extern int r_last;
extern struct s_res resources[];
-extern char my_name[];
extern jobq_t job_queue; /* job queue */
extern int r_first;
extern int r_last;
extern struct s_res resources[];
-extern char my_name[];
extern const char *client_backups;
-extern int console_msg_pending;
/* Imported functions */
extern void do_messages(UAContext *ua, const char *cmd);
extern int r_last;
extern RES_TABLE resources[];
extern RES **res_head;
-extern int console_msg_pending;
-extern FILE *con_fd;
-extern brwlock_t con_lock;
/* Imported functions */
extern int r_first;
extern int r_last;
extern struct s_res resources[];
-extern int console_msg_pending;
-extern char my_name[];
/* Forward referenced functions */
#include "bacula.h"
#include "dird.h"
-extern char my_name[];
-extern time_t daemon_start_time;
-extern int num_jobs_run;
-
static void list_scheduled_jobs(UAContext *ua);
static void list_running_jobs(UAContext *ua);
static void list_terminated_jobs(UAContext *ua);
#include "dird.h"
#include "findlib/find.h"
-/* Imported Global Variables */
-extern int debug_level;
-
/* Commands sent to File daemon */
static char verifycmd[] = "verify level=%s\n";
static char storaddr[] = "storage address=%s port=%d ssl=0\n";
/* Imported Functions */
extern void *handle_client_request(void *dir_sock);
-/* Imported Variables */
-extern time_t watchdog_sleep_time;
-
/* Forward referenced functions */
void terminate_filed(int sig);
static int check_resources();
#define uLongf uint32_t
#endif
-extern int win32_client; /* Are we running on Windows? */
-
extern CLIENT *me; /* "Global" Client resource */
static pthread_mutex_t vss_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif
-extern char my_name[];
extern CLIENT *me; /* our client resource */
int enable_vss = 0; /* set to use vss */
#include "bacula.h"
#include "filed.h"
-extern char my_name[];
-extern int num_jobs_run;
-extern time_t daemon_start_time;
-extern bool get_trace(void);
-
/* Forward referenced functions */
static void list_terminated_jobs(void sendit(const char *msg, int len, void *sarg), void *arg);
static void bsock_sendit(const char *msg, int len, void *arg);
#if defined(HAVE_WIN32)
-#include <windows.h>
-
int bacstat = 0;
struct s_win32_arg {
Kern E. Sibbald, 2000
*/
+#include "bacula.h"
#include "winbacula.h"
#include "winabout.h"
+#include "winres.h"
bacAbout::bacAbout()
{
//
-// WinUPS header file
-
-#ifdef HAVE_MINGW
-#include "compat.h"
-#endif
-
-#define STRICT 1
-#include <windows.h>
-#include <stdio.h>
-#include <process.h>
-#include "winres.h"
-
-
// Application specific messages
// Message used for system tray notifications
/* Code for the Events dialogue */
+#include "bacula.h"
#include "winbacula.h"
#include "winevents.h"
+#include "winres.h"
extern "C" void FillEventsBox(HWND hwnd, int id_list);
*/
-#ifndef HAVE_WIN32
-#define HAVE_CYGWIN 1
-#endif
-
#include <unistd.h>
-#include <lmcons.h>
#include <ctype.h>
+
+#include "bacula.h"
#include "winbacula.h"
#include "wintray.h"
#include "winservice.h"
#include <signal.h>
#include <pthread.h>
-#include "../../lib/winapi.h"
-#include "baconfig.h"
extern int BaculaMain(int argc, char *argv[]);
extern void terminate_filed(int sig);
HINSTANCE hAppInstance;
const char *szAppName = "Bacula";
DWORD mainthreadId;
-bool silent = false;
+bool silent = false;
/* Imported variables */
extern DWORD g_servicethread;
// show events, ...)
-#include <lmcons.h>
-#undef PASCAL
+#include "bacula.h"
#include "winbacula.h"
#include "winservice.h"
#include "wintray.h"
-#include "bacula.h"
void set_service_description(SC_HANDLE hSCManager, SC_HANDLE hService,
LPSTR lpDesc);
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include "bacula.h"
#include "winbacula.h"
#include "winstat.h"
+#include "winres.h"
extern void FillStatusBox(HWND hwnd, int id_list);
// Implementation of a system tray icon & menu for Bacula
+#include "bacula.h"
+#include "jcr.h"
#include "winbacula.h"
#include "winservice.h"
-#include <lmcons.h>
-
-// Header
-
+#include "winres.h"
#include "wintray.h"
-#include "bacula.h"
-#include "jcr.h"
// Constants
#ifdef properties_implemented
# inference rules
.c.o:
@echo "Compiling $<"
- $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(OPENSSL_INC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
+ $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
#-------------------------------------------------------------------------
all: Makefile libfind.a ../lib/libbac.a
@echo "==== Make of findlib is good ===="
#include "find.h"
#if defined(HAVE_WIN32)
-
-#include "../lib/winapi.h"
-
-
/* Forward referenced subroutines */
static bool set_win32_attributes(JCR *jcr, ATTR *attr, BFILE *ofd);
void unix_name_to_win32(POOLMEM **win32_name, char *name);
*/
#if defined(HAVE_WIN32)
-#include <windows.h>
-#include "../lib/winapi.h"
-
enum {
BF_CLOSED,
BF_READ, /* BackupRead */
#undef bmalloc
#define bmalloc(x) sm_malloc(__FILE__, __LINE__, x)
-extern int win32_client;
int
match_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt, bool), void *his_pkt)
{
const char *p;
+#if defined(HAVE_WIN32)
/*
* ***NB*** this removes the drive from the exclude
* rule. Why?????
*/
- if (win32_client && file[1] == ':') {
+ if (file[1] == ':') {
file += 2;
}
+#endif
if (file_in_excluded_list(ff->excluded_paths_list, file)) {
return 1;
};
extern struct s_last_job last_job;
-extern dlist *last_jobs;
+extern dlist * DLL_IMP_EXP last_jobs;
/* The following routines are found in lib/jcr.c */
extern JCR *get_jcr_by_full_name(char *Job);
extern JCR *get_next_jcr(JCR *jcr);
extern void set_jcr_job_status(JCR *jcr, int JobStatus);
+extern int DLL_IMP_EXP num_jobs_run;
#ifdef DEBUG
extern void b_free_jcr(const char *file, int line, JCR *jcr);
#include "bacula.h"
#include "jcr.h"
-extern int win32_client;
ATTR *new_attr()
{
const char *fn;
int wherelen = strlen(jcr->where);
pm_strcpy(attr->ofname, jcr->where); /* copy prefix */
- if (win32_client && attr->fname[1] == ':') {
+#if defined(HAVE_WIN32)
+ if (attr->fname[1] == ':') {
attr->fname[1] = '/'; /* convert : to / */
}
+#endif
fn = attr->fname; /* take whole name */
/* Ensure where is terminated with a slash */
if (jcr->where[wherelen-1] != '/' && fn[0] != '/') {
attr->olname[0] = 0;
add_link = false;
}
- if (win32_client && attr->lname[1] == ':') {
+
+#if defined(HAVE_WIN32)
+ if (attr->lname[1] == ':') {
attr->lname[1] = '/'; /* turn : into / */
}
+#endif
fn = attr->lname; /* take whole name */
/* Ensure where is terminated with a slash */
if (add_link && jcr->where[wherelen-1] != '/' && fn[0] != '/') {
pm_strcat(attr->olname, fn); /* copy rest of link */
}
}
- if (win32_client) {
+#if defined(HAVE_WIN32)
strip_double_slashes(attr->ofname);
strip_double_slashes(attr->olname);
- }
+#endif
}
extern char *getuser(uid_t uid, char *name, int len);
#if defined(HAVE_WIN32)
-#include <windows.h>
-
extern UPSINFO myUPS;
extern int shm_OK;
#include "btime.h"
#include "crypto.h"
#include "mem_pool.h"
+#include "rwlock.h"
+#include "semlock.h"
+#include "queue.h"
+#include "serial.h"
#include "message.h"
#include "openssl.h"
#include "lex.h"
#include "bsock.h"
#include "bshm.h"
#include "workq.h"
-#include "rwlock.h"
-#include "semlock.h"
-#include "queue.h"
-#include "serial.h"
#ifndef HAVE_FNMATCH
#include "fnmatch.h"
#endif
#include "bacula.h"
#include "jcr.h"
-#if !defined(HAVE_CONSOLE) && defined(HAVE_WIN32)
-#include <windows.h>
-#endif
-
#define FULL_LOCATION 1 /* set for file:line in Debug messages */
/*
void e_msg(const char *file, int line, int type, int level, const char *fmt,...);
void Jmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...);
void Qmsg(JCR *jcr, int type, time_t mtime, const char *fmt,...);
+bool get_trace(void);
-extern int debug_level;
-extern int verbose;
-extern char my_name[];
-extern const char *working_directory;
-extern time_t daemon_start_time;
-extern char catalog_db[];
+
+extern int DLL_IMP_EXP debug_level;
+extern int DLL_IMP_EXP verbose;
+extern char DLL_IMP_EXP my_name[];
+extern const char * DLL_IMP_EXP working_directory;
+extern time_t DLL_IMP_EXP daemon_start_time;
+extern char catalog_db[];
+
+extern int DLL_IMP_EXP console_msg_pending;
+extern FILE * DLL_IMP_EXP con_fd; /* Console file descriptor */
+extern brwlock_t DLL_IMP_EXP con_lock; /* Console lock structure */
#include "bacula.h"
-extern int debug_level;
-
/* Each daemon has a slightly different set of
* resources, so it will define the following
* global values.
*/
-extern uint64_t sm_max_bytes;
-extern uint64_t sm_bytes;
-extern uint32_t sm_max_buffers;
-extern uint32_t sm_buffers;
+extern uint64_t DLL_IMP_EXP sm_max_bytes;
+extern uint64_t DLL_IMP_EXP sm_bytes;
+extern uint32_t DLL_IMP_EXP sm_max_buffers;
+extern uint32_t DLL_IMP_EXP sm_buffers;
#ifdef SMARTALLOC
#undef SMARTALLOC
*/
-#ifndef HAVE_WIN32
#include "bacula.h"
#if defined(HAVE_PCREPOSIX)
# include <pcreposix.h>
+#elif defined(HAVE_WIN32)
+# include "bregex.h"
#else
# include <regex.h>
#endif
}
return str;
}
-#endif
time_t next_fire;
};
typedef struct s_watchdog_t watchdog_t;
+
+/* Exported globals */
+extern time_t DLL_IMP_EXP watchdog_time; /* this has granularity of SLEEP_TIME */
+extern time_t DLL_IMP_EXP watchdog_sleep_time; /* examine things every 60 seconds */
usage();
}
+ OSDependentInit();
+
working_directory = wd;
if (configfile == NULL) {
#include "stored.h"
#include "findlib/find.h"
-#if defined(HAVE_WIN32)
-int win32_client = 1;
-#else
-int win32_client = 0;
-#endif
-
static void do_extract(char *fname);
static bool record_cb(DCR *dcr, DEV_RECORD *rec);
my_name_is(argc, argv, "bextract");
init_msg(NULL, NULL); /* setup message handler */
+ OSDependentInit();
+
ff = init_find_files();
binit(&bfd);
#include "bacula.h"
#include "stored.h"
-extern int debug_level;
static bool terminate_writing_volume(DCR *dcr);
static bool do_new_file_bookkeeping(DCR *dcr);
static bool do_dvd_size_checks(DCR *dcr);
#include "stored.h"
#include "findlib/find.h"
-#if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
-int win32_client = 1;
-#else
-int win32_client = 0;
-#endif
-
/* Dummy functions */
int generate_daemon_event(JCR *jcr, const char *event) { return 1; }
my_name_is(argc, argv, "bls");
init_msg(NULL, NULL); /* initialize message handler */
+ OSDependentInit();
+
ff = init_find_files();
while ((ch = getopt(argc, argv, "b:c:d:e:i:jkLpvV:?")) != -1) {
static int update_digest_record(B_DB *db, char *digest, DEV_RECORD *rec, int type);
-/* Global variables */
-#if defined(HAVE_WIN32)
-int win32_client = 1;
-#else
-int win32_client = 0;
-#endif
-
-
/* Local variables */
static DEVICE *dev = NULL;
static B_DB *db;
my_name_is(margc, margv, "btape");
init_msg(NULL, NULL);
+ OSDependentInit();
+
while ((ch = getopt(margc, margv, "b:c:d:psv?")) != -1) {
switch (ch) {
case 'b': /* bootstrap file */
/* Forward referenced functions */
-extern char my_name[];
-extern int debug_level;
-
/*
* This is the dreaded moment. We either have an end of
* medium condition or worse, and error condition.
/* Forward referenced functions */
static void create_volume_label_record(DCR *dcr, DEV_RECORD *rec);
-extern char my_name[];
-extern int debug_level;
-
/*
* Read the volume label
*
#include "bacula.h"
#include "stored.h"
-extern int debug_level;
-
/*
* Convert a FileIndex into a printable
* ASCII string. Not reentrant.
extern BSOCK *filed_chan;
extern int r_first, r_last;
extern struct s_res resources[];
-extern char my_name[];
-extern time_t daemon_start_time;
-extern int num_jobs_run;
-
/* Static variables */
static char qstatus[] = ".status %127s\n";
#include "bacula.h"
#include "stored.h"
-extern int debug_level;
-
-
/* First and last resource ids */
int r_first = R_FIRST;
int r_last = R_LAST;
usage();
}
+ OSDependentInit();
+
for ( ;; ) {
printf("Enter regex pattern: ");
if (fgets(pat, sizeof(pat)-1, stdin) == NULL) {
usage();
}
+ OSDependentInit();
+
for ( ;; ) {
printf("Enter a wild-card: ");
if (fgets(pat, sizeof(pat)-1, stdin) == NULL) {
argc -= optind;
argv += optind;
+ OSDependentInit();
+
if (configfile) {
CAT *catalog = NULL;
int found = 0;
usage();
}
+ OSDependentInit();
+
for (i = 0; i < argc; --argc, ++argv) {
if (fstype(*argv, fs, sizeof(fs))) {
if (verbose) {
#include "bacula.h"
#include "findlib/find.h"
-#if defined(HAVE_WIN32)
-int win32_client = 1;
-#else
-int win32_client = 0;
-#endif
-
/* Dummy functions */
int generate_daemon_event(JCR *jcr, const char *event) { return 1; }
int generate_job_event(JCR *jcr, const char *event) { return 1; }