]> git.sur5r.net Git - bacula/bacula/commitdiff
Add native win32 bconsole
authorKern Sibbald <kern@sibbald.com>
Fri, 23 Apr 2004 16:19:06 +0000 (16:19 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 23 Apr 2004 16:19:06 +0000 (16:19 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1273 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/autoconf/configure.in
bacula/configure
bacula/src/console/console.c
bacula/src/console/console_conf.c
bacula/src/lib/message.c

index 87c4f3fc1edddd23c31ec36dd792e204247ce15a..37ca9a59d4ef7fbcef6034414bec6c9a2ac6f596 100644 (file)
@@ -1,4 +1,4 @@
-dnl#
+lal#
 dnl#
 dnl# Process this file with autoconf to produce a configure script.
 dnl#
@@ -1662,8 +1662,9 @@ AC_OUTPUT([autoconf/Make.common \
           src/findlib/Makefile \
           src/tools/Makefile \
           src/win32/winbacula.nsi \
-          src/win32/bacula-fd.conf \
+          src/win32/baculafd/bacula-fd.conf \
           src/win32/Makefile \
+          src/win32/console/bconsole.conf.in \
           $PFILES ],  
          [(echo "Doing make of dependencies"; make depend;) ]
 )
index 9c953a795133ce926dcfe81efedfc3bbb4961e87..217ad1b53a9cc66b00f25337f0769fd5e1ef3243 100755 (executable)
@@ -18186,7 +18186,7 @@ if test "x${subsysdir}" = "x${sbindir}" ; then
    exit 1
 fi
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ac_config_files="$ac_config_files autoconf/Make.common Makefile rescue/Makefile rescue/linux/Makefile rescue/freebsd/Makefile rescue/solaris/Makefile scripts/startmysql scripts/stopmysql scripts/btraceback scripts/startit scripts/stopit scripts/bconsole scripts/gconsole scripts/bacula scripts/devel_bacula scripts/fd scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu scripts/bacula.desktop.gnome2.xsu scripts/gnome-console.console_apps scripts/mtx-changer doc/Makefile src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/gnome-console/Makefile src/gnome-console/gnome-console.conf src/gnome2-console/Makefile src/gnome2-console/gnome-console.conf src/wx-console/Makefile src/wx-console/wx-console.conf src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/filed/win32/Makefile src/cats/Makefile src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite_database src/cats/update_sqlite_tables src/cats/make_sqlite_tables src/cats/grant_sqlite_privileges src/cats/drop_sqlite_tables src/cats/drop_sqlite_database src/cats/sqlite src/cats/mysql src/cats/create_bdb_database src/cats/update_bdb_tables src/cats/make_bdb_tables src/cats/grant_bdb_privileges src/cats/drop_bdb_tables src/cats/drop_bdb_database src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile src/tools/Makefile src/win32/winbacula.nsi src/win32/bacula-fd.conf src/win32/Makefile $PFILES"
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ac_config_files="$ac_config_files autoconf/Make.common Makefile rescue/Makefile rescue/linux/Makefile rescue/freebsd/Makefile rescue/solaris/Makefile scripts/startmysql scripts/stopmysql scripts/btraceback scripts/startit scripts/stopit scripts/bconsole scripts/gconsole scripts/bacula scripts/devel_bacula scripts/fd scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu scripts/bacula.desktop.gnome2.xsu scripts/gnome-console.console_apps scripts/mtx-changer doc/Makefile src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/gnome-console/Makefile src/gnome-console/gnome-console.conf src/gnome2-console/Makefile src/gnome2-console/gnome-console.conf src/wx-console/Makefile src/wx-console/wx-console.conf src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/filed/win32/Makefile src/cats/Makefile src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite_database src/cats/update_sqlite_tables src/cats/make_sqlite_tables src/cats/grant_sqlite_privileges src/cats/drop_sqlite_tables src/cats/drop_sqlite_database src/cats/sqlite src/cats/mysql src/cats/create_bdb_database src/cats/update_bdb_tables src/cats/make_bdb_tables src/cats/grant_bdb_privileges src/cats/drop_bdb_tables src/cats/drop_bdb_database src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile src/tools/Makefile src/win32/winbacula.nsi src/win32/baculafd/bacula-fd.conf src/win32/Makefile src/win32/console/bconsole.conf.in $PFILES"
           ac_config_commands="$ac_config_commands default"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -18798,8 +18798,9 @@ do
   "src/findlib/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/findlib/Makefile" ;;
   "src/tools/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/tools/Makefile" ;;
   "src/win32/winbacula.nsi" ) CONFIG_FILES="$CONFIG_FILES src/win32/winbacula.nsi" ;;
-  "src/win32/bacula-fd.conf" ) CONFIG_FILES="$CONFIG_FILES src/win32/bacula-fd.conf" ;;
+  "src/win32/baculafd/bacula-fd.conf" ) CONFIG_FILES="$CONFIG_FILES src/win32/baculafd/bacula-fd.conf" ;;
   "src/win32/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/win32/Makefile" ;;
+  "src/win32/console/bconsole.conf.in" ) CONFIG_FILES="$CONFIG_FILES src/win32/console/bconsole.conf.in" ;;
   "$PFILES" ) CONFIG_FILES="$CONFIG_FILES $PFILES" ;;
   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
   "src/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/config.h:autoconf/config.h.in" ;;
index 2116aae67348c269494a519c3f991bc4d0ff15e0..d3f0fcd4e054fa00bd5568a754c1b76a87c8cbe7 100644 (file)
@@ -44,7 +44,7 @@
 
 #ifdef HAVE_WIN32
 #include <windows.h>
-#define isatty(fd) (fd==1)
+#define isatty(fd) (fd==0)
 DWORD  g_platform_id = VER_PLATFORM_WIN32_WINDOWS;
 #endif
  
@@ -381,6 +381,10 @@ Without that I don't how to speak to the Director :-(\n"), configfile);
    memset(&jcr, 0, sizeof(jcr));
 
 
+#ifdef HAVE_WIN32
+   WSA_Init();                       /* Initialize Windows sockets */
+#endif
+
    if (ndir > 1) {
       struct sockaddr_in client_addr;
       memset(&client_addr, 0, sizeof(client_addr));
@@ -519,6 +523,9 @@ wait_for_data(int fd, int sec)
 {
    fd_set fdset;
    struct timeval tv;
+#ifdef HAVE_WIN32
+   return 1;                          /* select doesn't seem to work on Win32 */
+#endif
 
    tv.tv_sec = sec;
    tv.tv_usec = 0;
@@ -731,6 +738,8 @@ void sendit(char *buf)
     if (tee) {
        fputs(buf, stdout);
     }
-    fflush(stdout);
+    if (output == stdout || tee) {
+       fflush(stdout);
+    }
 #endif
 }
index 48e460b5819d69c20b2bb806473824b0fee42de4..1fade95c5fc9336eb823d3c9a09e042f1d28504c 100644 (file)
@@ -56,8 +56,15 @@ int r_last  = R_LAST;
  * then move it to allocated memory when the resource
  * scan is complete.
  */
+#if defined(HAVE_WIN32) && !defined(HAVE_CYGWIN)  && !defined(HAVE_MINGW)
+extern "C" { // work around visual compiler mangling variables
+    URES res_all;
+    int  res_all_size = sizeof(res_all);
+}
+#else
 URES res_all;
 int  res_all_size = sizeof(res_all);
+#endif
 
 /* Definition of records permitted within each
  * resource with the routine to process the record 
index f9742687492cf20d35103af4ba4f98775ca61f3f..697fc59220d2d224d0934f1a55808406c8dbabe6 100755 (executable)
 #include "bacula.h"
 #include "jcr.h"
 
+#if !define(HAVE_CONSOLE)
 #if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
 #include <windows.h>
 #endif
+#endif
 
 #define FULL_LOCATION 1              /* set for file:line in Debug messages */
 
@@ -560,8 +562,10 @@ void dispatch_message(JCR *jcr, int type, int level, char *msg)
     if (type == M_ABORT || type == M_ERROR_TERM) {
        fputs(msg, stdout);        /* print this here to INSURE that it is printed */
        fflush(stdout);
+#if !defined(HAVE_CONSOLE)
 #if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
        MessageBox(NULL, msg, "Bacula", MB_OK);
+#endif
 #endif
     }