]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix header file includes.
authorRobert Nelson <robertn@the-nelsons.org>
Mon, 3 Jul 2006 07:51:06 +0000 (07:51 +0000)
committerRobert Nelson <robertn@the-nelsons.org>
Mon, 3 Jul 2006 07:51:06 +0000 (07:51 +0000)
Move externs from source files to header files.
Fix the old mingw Makefile so it builds with the new dependencies.
Replace #ifdef'ed InitWinAPIWrapper with OSDependentInit macro.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3114 91ce42f0-d328-0410-95d8-f526ca767f89

53 files changed:
bacula/src/baconfig.h
bacula/src/bacula.h
bacula/src/console/console.c
bacula/src/dird/authenticate.c
bacula/src/dird/fd_cmds.c
bacula/src/dird/job.c
bacula/src/dird/ua_cmds.c
bacula/src/dird/ua_dotcmds.c
bacula/src/dird/ua_output.c
bacula/src/dird/ua_server.c
bacula/src/dird/ua_status.c
bacula/src/dird/verify.c
bacula/src/filed/filed.c
bacula/src/filed/filed.h
bacula/src/filed/job.c
bacula/src/filed/status.c
bacula/src/filed/win32/winabout.cpp
bacula/src/filed/win32/winbacula.h
bacula/src/filed/win32/winevents.cpp
bacula/src/filed/win32/winmain.cpp
bacula/src/filed/win32/winservice.cpp
bacula/src/filed/win32/winstat.cpp
bacula/src/filed/win32/wintray.cpp
bacula/src/findlib/Makefile.in
bacula/src/findlib/attribs.c
bacula/src/findlib/bfile.h
bacula/src/findlib/match.c
bacula/src/jcr.h
bacula/src/lib/attr.c
bacula/src/lib/events.c
bacula/src/lib/lib.h
bacula/src/lib/message.c
bacula/src/lib/message.h
bacula/src/lib/parse_conf.c
bacula/src/lib/smartall.h
bacula/src/lib/var.c
bacula/src/lib/watchdog.h
bacula/src/stored/bcopy.c
bacula/src/stored/bextract.c
bacula/src/stored/block.c
bacula/src/stored/bls.c
bacula/src/stored/bscan.c
bacula/src/stored/btape.c
bacula/src/stored/device.c
bacula/src/stored/label.c
bacula/src/stored/record.c
bacula/src/stored/status.c
bacula/src/stored/stored_conf.c
bacula/src/tools/bregex.c
bacula/src/tools/bwild.c
bacula/src/tools/dbcheck.c
bacula/src/tools/fstype.c
bacula/src/tools/testls.c

index f052b13cdead87fc852e32849673cfcfc8584b17..c6c6854e771e54cbba4744777482a5e995399e14 100644 (file)
 #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
@@ -476,7 +486,7 @@ int  m_msg(const char *file, int line, POOLMEM *&pool_buf, const char *fmt, ...)
 
 
 /* Use our strdup with smartalloc */
-#ifndef __WXGTK__
+#ifndef HAVE_WXCONSOLE
 #undef strdup
 #define strdup(buf) bad_call_on_strdup_use_bstrdup(buf)
 #endif
index f677f2458a5cd44c0002499046633a18872a1878..69b43828af159dadc700e311511e80970be527ae 100644 (file)
 #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
index b4392f2b06748d9e843bf4c5feec80e2739a632b..abdfc8f0f51fc97693a1425600835b39c3dd04c3 100644 (file)
@@ -37,8 +37,6 @@
 #endif
 
 #ifdef HAVE_WIN32
-#include <windows.h>
-#include "../lib/winapi.h"
 #define isatty(fd) (fd==0)
 #endif
 
@@ -388,10 +386,9 @@ int main(int argc, char *argv[])
    signal(SIGTTIN, got_sigtin);
    signal(SIGTTOU, got_sigtout);
    trapctlc();
-#else
-   InitWinAPIWrapper();
 #endif
-     
+
+   OSDependentInit();
 
    if (argc) {
       usage();
index 93d33ce29f3717fff8f727388b592df6a906e948..f0bcd4f026b149cab5619ca09e1192b490499bd4 100644 (file)
@@ -29,7 +29,6 @@
 #include "dird.h"
 
 extern DIRRES *director;
-extern char my_name[];
 
 /* Commands sent to Storage daemon and File daemon and received
  *  from the User Agent */
index 3d884f4663b81140e4628e5a65915eb7dcd27f0e..4a858abdc59b9b541947d3cd889666ca01f5455b 100644 (file)
@@ -49,7 +49,6 @@ static char OKRunBeforeNow[] = "2000 OK RunBeforeNow\n";
 /* Forward referenced functions */
 
 /* External functions */
-extern int debug_level;
 extern DIRRES *director;
 extern int FDConnectTimeout;
 
index 984f932041df1e7dda2ff5a823e36afc2d0c9a8b..44812a1d7b375efe9d47ff8ba1382f9b3d3dc9c7 100644 (file)
@@ -36,7 +36,6 @@ extern void term_scheduler();
 extern void term_ua_server();
 
 /* Imported variables */
-extern time_t watchdog_time;
 
 jobq_t job_queue;
 
index 7e71408bb4f3ccf0d4cdb6f91c601033d8d60b7a..f2d2bf2f8d654ac778368565d0121fed4a0080ab 100644 (file)
@@ -30,7 +30,6 @@
 extern int r_first;
 extern int r_last;
 extern struct s_res resources[];
-extern char my_name[];
 extern jobq_t job_queue;              /* job queue */
 
 
index 613d17c7ed91c215c2f85c8210a6f992c9751b6c..f39d3a5d0644a24052531d31cb72a8eb7ea7006a 100644 (file)
@@ -32,9 +32,7 @@
 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);
index a738dfe326aab085c81c65efc16304ee70ef9d28..f53628e974032130f25c14191a0f47a9d54bf8d9 100644 (file)
@@ -33,9 +33,6 @@ extern int r_first;
 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 */
 
index 7f0c6b795cfb0e0ef674bf8a4af5abb388cb177b..5ebaa79f75246142fb06f9c59f7b82d8fbe99d65 100644 (file)
@@ -28,8 +28,6 @@
 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 */
index c69d2526ad209d8eac7412dfb888ed6091271ca5..49ddebd316e4c8f4b680649e4c40f2621ba0a1d5 100644 (file)
 #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);
index 3a46402ba65c1966d1794609eaf0669fc280c306..84a2ba196c88efeed50e20f05e33f71a873222fd 100644 (file)
@@ -33,9 +33,6 @@
 #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";
index 5145735a1cab7b41c4428a31f52d59b018b55302..623de061a32d95f75225c99cd162fe7292231ef0 100644 (file)
@@ -27,9 +27,6 @@
 /* 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();
index 2c59f340c180545e0627b44f37483b9e409ee0b7..c107d30ff5fb19c015e29831a5a023c186ed9525 100644 (file)
@@ -33,6 +33,4 @@
 #define uLongf uint32_t
 #endif
 
-extern int win32_client;              /* Are we running on Windows? */
-
 extern CLIENT *me;                    /* "Global" Client resource */
index 5b88dd67729646844273160c199592b49f5eccbf..9768fe2e30f7d66eb0a1b7f14e28b64ee1c2f3c4 100644 (file)
@@ -28,7 +28,6 @@
 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 */
index 2c90d7a0a9d1d810891d77ee204e9bbdc185e9f1..7df988108cba8f14e9d14afa5e4756f68446ff9a 100755 (executable)
 #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);
@@ -403,8 +398,6 @@ static const char *level_to_str(int level)
 
 
 #if defined(HAVE_WIN32)
-#include <windows.h>
-
 int bacstat = 0;
 
 struct s_win32_arg {
index 69ace2286a3863a42e8bef55642044be31170d4f..5fbccae3a93b561bceb3d91a414d4b2303fdae8a 100755 (executable)
    Kern E. Sibbald, 2000
 */
 
+#include "bacula.h"
 #include "winbacula.h"
 #include "winabout.h"
+#include "winres.h"
 
 bacAbout::bacAbout()
 {
index c61d39e8d4d7138569cfc87215207c4ee1788392..088205be332f6589bafb604ba8c69d4ed7464e3c 100755 (executable)
 //
 
 
-// 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
index c41cf7cd983065abfcce4ea99fcb03d65a64c93d..50edd0a5f5c0507b8394a3015ae7743224a40a81 100755 (executable)
 
 /* 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);
 
index 2cda05ad2b52cf3e01cd44f68446827f1690de17..4a662a56e7dcb4bed1526635b407bf97926eb793 100755 (executable)
   
 */
 
-#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);
@@ -40,7 +35,7 @@ extern void d_msg(const char *, int, int, const char *, ...);
 HINSTANCE       hAppInstance;
 const char      *szAppName = "Bacula";
 DWORD           mainthreadId;
-bool silent = false;
+bool            silent = false;
 
 /* Imported variables */
 extern DWORD    g_servicethread;
index a1c7ddd009c2b2b6ac458d9ca61aaf8c04fa2a37..7fc85b2e7dacaf3a005b2b64a5379c93a14ef4b7 100755 (executable)
 // 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);
index 79da6dcc7ed8ecbdd3c68c82dd3e90aa6e2e9737..45e3c41ad180efac253094a4f4a49b8e8117c63a 100755 (executable)
    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);
 
index 3a5518de106bb46c83e4f0db6eed40fe41746c75..044d34b7ce86b76b4188ad5b39ef2e8c6be0f568 100755 (executable)
 
 // 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
index b0fe8cbefef802f06fec9ba1180bfffcd5af1493..a9e4a4ff764904da3094dbf32de89412f936a585 100644 (file)
@@ -34,7 +34,7 @@ LIBOBJS = find.o match.o find_one.o attribs.o create_file.o \
 # 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 ===="
index fdf0c67322c1bc3bd3a47524e6e2e4d7ccf2ec0e..6a81ac5dac3e77b4275c9548334af0415cd9a386 100755 (executable)
 #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);
index 69cce6fb68540aa8a50149d5d3647d681d27677a..e6d4c34a0608f28de25a424e0c808c1895247283 100644 (file)
@@ -66,9 +66,6 @@ typedef struct _PROCESS_WIN32_BACKUPAPIBLOCK_CONTEXT {
  */
 #if defined(HAVE_WIN32)
 
-#include <windows.h>
-#include "../lib/winapi.h"
-
 enum {
    BF_CLOSED,
    BF_READ,                           /* BackupRead */
index 4c239840a953d1ad2b36e79f6496a62ff6a5f36f..2e5bc262407655b0c1e7a433b86fbc85eab575e7 100644 (file)
@@ -49,7 +49,6 @@ static const int fnmode = 0;
 #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)
@@ -366,13 +365,15 @@ int file_is_excluded(FF_PKT *ff, const char *file)
 {
    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;
index effa5580a048254544ddf42e979e1339650d9c11..f5f45ad74ed1cc7f4520bbcc627371c58fc1b680 100644 (file)
@@ -350,7 +350,7 @@ struct s_last_job {
 };
 
 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 */
@@ -362,6 +362,7 @@ extern JCR *get_jcr_by_partial_name(char *Job);
 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);
index c041f5fd566eb2297b04dbaef45e42c3013fd187..2e30a11b62ceea322176ea3a05d4ca99a43e01e6 100644 (file)
@@ -23,7 +23,6 @@
 #include "bacula.h"
 #include "jcr.h"
 
-extern int win32_client;
 
 ATTR *new_attr()
 {
@@ -141,9 +140,11 @@ void build_attr_output_fnames(JCR *jcr, ATTR *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] != '/') {
@@ -166,9 +167,12 @@ void build_attr_output_fnames(JCR *jcr, ATTR *attr)
             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] != '/') {
@@ -177,10 +181,10 @@ void build_attr_output_fnames(JCR *jcr, ATTR *attr)
          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);
index 782778e12ad8809240ecefa350e5cb485c007aed..c89c413f02437dcc2d86771a5a0f65dccbeca31a 100644 (file)
@@ -140,8 +140,6 @@ bailout:
 
 #if defined(HAVE_WIN32)
 
-#include <windows.h>
-
 extern UPSINFO myUPS;
 extern int shm_OK;
 
index 244bdc576fcbadb6ba4cb97f38b0bcec49c3a543..9f86b25a83ade2e35be58d28847bc3516f33a7de 100644 (file)
 #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
index 1c4b685d9a96b3530cabec342bf24c366960ea7c..bac2f479da39e9a7b546f2f34098ad8661fc1d1c 100755 (executable)
 #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 */
 
 /*
index e49a69741823548dbf634eda1bbfd43473c16c43..7f73169d680245f86627a0e71041711d0f443b40 100644 (file)
@@ -129,10 +129,16 @@ void d_msg(const char *file, int line, int level, const char *fmt,...);
 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 */
index f95b60948510ce01f15eebad25186c7de04a7a89..1ad44371e6f8b78f093c3c2b30fb06f8bfeacfd1 100755 (executable)
@@ -50,8 +50,6 @@
 
 #include "bacula.h"
 
-extern int debug_level;
-
 /* Each daemon has a slightly different set of
  * resources, so it will define the following
  * global values.
index 429549b9d1cfac67a673e99f217c1a3decdc2ea9..1ddd3cacffa0aa2f89adbb14898ab3a11db32cd7 100644 (file)
 
  */
 
-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
index 14a59227c1a1e25030e369d759a46d9a3407616c..14289b19a8edece5f81d4415241a08e9abc6ad04 100644 (file)
 
  */
 
-#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
@@ -2716,4 +2717,3 @@ const char *var_strerror(var_t *var, var_rc_t rc)
     }
     return str;
 }
-#endif
index c8e1cebb582297dedf58a3d713a6f78867206543..8763928e0bbae3eede27121ed4a9ade1368069ba 100644 (file)
@@ -43,3 +43,7 @@ struct s_watchdog_t {
        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 */
index b072bd9a935b6dcba88be5c7c2cc297c723badb1..a23cd2547a72b5522a4321d1a66455f095669d45 100644 (file)
@@ -138,6 +138,8 @@ int main (int argc, char *argv[])
       usage();
    }
 
+   OSDependentInit();
+
    working_directory = wd;
 
    if (configfile == NULL) {
index 1856539ac306cfe3cc4c55f8cdc4645e7e9b62f0..71a0b2512a440eccb3ded7ffd26e11d8a96edb1c 100644 (file)
 #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);
 
@@ -98,6 +92,8 @@ int main (int argc, char *argv[])
    my_name_is(argc, argv, "bextract");
    init_msg(NULL, NULL);              /* setup message handler */
 
+   OSDependentInit();
+
    ff = init_find_files();
    binit(&bfd);
 
index 2917c0fb73c7c73adf2afeec3334c56c05dafa76..a3d354da1e337c5da0f10edf4906c8a30aa9bb26 100644 (file)
@@ -27,7 +27,6 @@
 #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);
index 40d348ccaebf74a79b03a8ceb5fe1b7a6c1fc01b..e12f6d47cf684b56dda88d88b16b34b348a1b5cc 100644 (file)
 #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; }
 
@@ -102,6 +96,8 @@ int main (int argc, char *argv[])
    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) {
index 6d979c96f5ee62805b991f8cb4c9fe981db55ebf..397a86c43762e7d226ef54e23025bf03709e1fea 100644 (file)
@@ -51,14 +51,6 @@ static JCR *create_jcr(JOB_DBR *jr, DEV_RECORD *rec, uint32_t JobId);
 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;
index 0198ed0687773d4b95fc0f50ad3637e4b46e7f2b..a69a3d2e3abf5ddb7656207e6f930bd2d256f9fc 100644 (file)
@@ -188,6 +188,8 @@ int main(int margc, char *margv[])
    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 */
index 30f6c403f6309a6ec211397ea79ff1236a62dff6..be6ef15fb1153867c8621f99810d1cc6f7aafab0 100644 (file)
@@ -48,9 +48,6 @@
 
 /* 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.
index 43afb8933abaac0f89bef5d68371351f5cbd843b..030a7ca2c2af62900b0000eee23d12e06033bc01 100644 (file)
@@ -28,9 +28,6 @@
 /* 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
  *
index 130a2884b71a6f3e38e978aa0b60d48550662912..8eb05094923dc0975f7ed6705c924f9d9a91dbad 100644 (file)
@@ -27,8 +27,6 @@
 #include "bacula.h"
 #include "stored.h"
 
-extern int debug_level;
-
 /*
  * Convert a FileIndex into a printable
  *   ASCII string.  Not reentrant.
index 46a72d95d6ae4a46f9006cdeebdb6138a0347bf0..5edd913ac1484bdb473de33457ae6df1e6c693af 100644 (file)
 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";
index cb9766cd6f443f930f4fff6a944849f265d1a567..e392d0b3d198ce17f2dcc8e7616f91e276112be6 100644 (file)
@@ -23,9 +23,6 @@
 #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;
index 9587658f38b8194cfa7dc27260268e09294e7dfa..f21240e0e09c860d2eaf89217c5f5973182c2f4b 100644 (file)
@@ -109,6 +109,8 @@ int main(int argc, char *const *argv)
       usage();
    }
 
+   OSDependentInit();
+
    for ( ;; ) {
       printf("Enter regex pattern: ");
       if (fgets(pat, sizeof(pat)-1, stdin) == NULL) {
index a7b09770463be16199cc949b57dd125a4a8aec38..a1f579e91eb5c7c93ed37ef0eba9af4aa20e500f 100644 (file)
@@ -90,6 +90,8 @@ int main(int argc, char *const *argv)
       usage();
    }
 
+   OSDependentInit();
+
    for ( ;; ) {
       printf("Enter a wild-card: ");
       if (fgets(pat, sizeof(pat)-1, stdin) == NULL) {
index c7eaa5a0f6cd9b320dd956b960009e500ef6ad15..66ae3858cd343c46a85feac6b1144592425d9c54 100644 (file)
@@ -152,6 +152,8 @@ int main (int argc, char *argv[])
    argc -= optind;
    argv += optind;
 
+   OSDependentInit();
+
    if (configfile) {
       CAT *catalog = NULL;
       int found = 0;
index 796588d9a6f590d78bd191623fb1e1b33933acb4..3f1430a72a08af11bddf18a0e583ec3db7a4a9c0 100644 (file)
@@ -75,6 +75,8 @@ main (int argc, char *const *argv)
       usage();
    }
 
+   OSDependentInit();
+
    for (i = 0; i < argc; --argc, ++argv) {
       if (fstype(*argv, fs, sizeof(fs))) {
          if (verbose) {
index 78ff15d3ecdef49109f7d8cd12117b48e86108c8..54d46fa0f16a965ca316cb5063870567ed370971 100755 (executable)
 #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; }