From: Kern Sibbald Date: Tue, 10 Feb 2004 13:47:35 +0000 (+0000) Subject: Add win32 directory X-Git-Tag: Release-1.34.0~142 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=67b22e4a59f95b85e029dc243526105594da0722;p=bacula%2Fbacula Add win32 directory git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1036 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index 146be78624..d004f023d0 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -429,9 +429,28 @@ eod_dev(DEVICE *dev) return 0; } #ifdef MTEOM + + if (dev_cap(dev, CAP_FASTFSF) && !dev_cap(dev, CAP_EOM)) { + struct mtget mt_stat; + Dmsg0(200,"PAPED using FAST FSF for EOM\n"); + if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) == 0 && mt_stat.mt_fileno <= 0) { + if (!rewind_dev(dev)) { + return 0; + } + } + mt_com.mt_op = MTFSF; + mt_com.mt_count = INT32_MAX; /* use big positive number */ + if (mt_com.mt_count < 0) { + mt_com.mt_count = INT16_MAX; /* brain damaged system */ + } + } + if (dev_cap(dev, CAP_EOM)) { + Dmsg0(200,"PAPED using EOM for EOM\n"); mt_com.mt_op = MTEOM; mt_com.mt_count = 1; + } + if(dev_cap(dev, CAP_FASTFSF) || dev_cap(dev, CAP_EOM)) { if ((stat=ioctl(dev->fd, MTIOCTOP, (char *)&mt_com)) < 0) { Dmsg1(50, "ioctl error: %s\n", strerror(dev->dev_errno)); clrerror_dev(dev, mt_com.mt_op); @@ -440,6 +459,7 @@ eod_dev(DEVICE *dev) dev->dev_name, strerror(dev->dev_errno)); return 0; } + if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) < 0) { dev->dev_errno = errno; Mmsg2(&dev->errmsg, _("ioctl MTIOCGET error on %s. ERR=%s.\n"), diff --git a/bacula/src/win32/License.txt b/bacula/src/win32/License.txt new file mode 100644 index 0000000000..19cc8b13be --- /dev/null +++ b/bacula/src/win32/License.txt @@ -0,0 +1,19 @@ +Copyright © 2002-2004 + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + +2. Altered versions must be plainly marked as such, and must not be + misrepresented as being the original software. + +3. This notice may not be removed or altered from any distribution. diff --git a/bacula/src/win32/bacula.nsi b/bacula/src/win32/bacula.nsi new file mode 100644 index 0000000000..5de4a6ddc0 --- /dev/null +++ b/bacula/src/win32/bacula.nsi @@ -0,0 +1,160 @@ +;NSIS Modern User Interface version 1.63 +;Start Menu Folder Selection Example Script +;Written by Joost Verburg + +!define MUI_PRODUCT "Bacula" ;Define your own software name here +!define MUI_VERSION "1.32f-3" ;Define your own software version here + +!include "MUI.nsh" +!include "util.nsh" + +;-------------------------------- +;Configuration + + ;General + OutFile "bacula-install.exe" + + ;Folder selection page + InstallDir "$PROGRAMFILES\${MUI_PRODUCT}" + + ;Remember install folder + InstallDirRegKey HKCU "Software\${MUI_PRODUCT}" "" + + ;$9 is being used to store the Start Menu Folder. + ;Do not use this variable in your script (or Push/Pop it)! + + ;To change this variable, use MUI_STARTMENUPAGE_VARIABLE. + ;Have a look at the Readme for info about other options (default folder, + ;registry). + + ;Remember the Start Menu Folder + !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" + !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${MUI_PRODUCT}" + !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" + + !define TEMP $R0 + +;-------------------------------- +;Modern UI Configuration + + !define MUI_LICENSEPAGE + !define MUI_COMPONENTSPAGE + !define MUI_DIRECTORYPAGE + !define MUI_STARTMENUPAGE + + !define MUI_ABORTWARNING + + !define MUI_UNINSTALLER + !define MUI_UNCONFIRMPAGE + +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +;Language Strings + + ;Description + LangString DESC_SecCopyUI ${LANG_ENGLISH} "Install Bacula client on this system." + +;-------------------------------- +;Data + + LicenseData "License.txt" + +;-------------------------------- +;Installer Sections + +Section "Bacula File Service" SecCopyUI + + ;ADD YOUR OWN STUFF HERE! + + SetOutPath "$INSTDIR" + File baculafd\Release\bacula-fd.exe + File pthreads\pthreadVCE.dll + IfFileExists "$INSTDIR\bacula-fd.conf" sconf + File bacula-fd.conf + goto doDir + sconf: + File /oname=bacula-fd.conf.N bacula-fd.conf + doDir: + CreateDirectory "$INSTDIR\working" + + ;Store install folder + WriteRegStr HKCU "Software\${MUI_PRODUCT}" "" $INSTDIR + + !insertmacro MUI_STARTMENU_WRITE_BEGIN + + ;Create shortcuts + CreateDirectory "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}" + CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" + Call IsNT + Pop $R0 + StrCmp $R0 "false" do98sc + + CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Start Service.lnk" "$SYSDIR\net.exe" "start bacula" "$INSTDIR\bacula-fd.exe" 2 + CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Stop Service.lnk" "$SYSDIR\net.exe" "stop bacula" "$INSTDIR\bacula-fd.exe" 3 + goto scend + do98sc: + + CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Start Service.lnk" "$INSTDIR\bacula-fd.exe" "-c bacula-fd.conf" "$INSTDIR\bacula-fd.exe" 2 + CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Stop Service.lnk" "$INSTDIR\bacula-fd.exe" "/kill" "$INSTDIR\bacula-fd.exe" 3 + scend: + !insertmacro MUI_STARTMENU_WRITE_END + + ;Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + + ; Install service + ExecWait '"$INSTDIR\bacula-fd.exe" /install -c "$INSTDIR\bacula-fd.conf"' + +SectionEnd + +;Display the Finish header +;Insert this macro after the sections if you are not using a finish page +!insertmacro MUI_SECTIONS_FINISHHEADER + +;-------------------------------- +;Descriptions + +!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN +!insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI) +!insertmacro MUI_FUNCTIONS_DESCRIPTION_END + +;-------------------------------- +;Uninstaller Section + +Section "Uninstall" + + ;ADD YOUR OWN STUFF HERE! + ExecWait '"$INSTDIR\bacula-fd.exe" /kill' + Sleep 1000 + ExecWait '"$INSTDIR\bacula-fd.exe" /remove' + Sleep 1000 + + Delete "$INSTDIR\bacula-fd.exe" + Delete "$INSTDIR\bacula-fd.conf.N" + Delete "$INSTDIR\pthreadVCE.dll" + Delete "$INSTDIR\Uninstall.exe" + RMDir "$INSTDIR\working" + ;Remove shortcut + ReadRegStr ${TEMP} "${MUI_STARTMENUPAGE_REGISTRY_ROOT}" "${MUI_STARTMENUPAGE_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}" + + StrCmp ${TEMP} "" noshortcuts + + Delete "$SMPROGRAMS\${TEMP}\Uninstall.lnk" + Delete "$SMPROGRAMS\${TEMP}\Start Service.lnk" + Delete "$SMPROGRAMS\${TEMP}\Stop Service.lnk" + RMDir "$SMPROGRAMS\${TEMP}" ;Only if empty, so it won't delete other shortcuts + + noshortcuts: + + RMDir "$INSTDIR" + + DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}" + + ;Display the Finish header + !insertmacro MUI_UNFINISHHEADER + +SectionEnd \ No newline at end of file diff --git a/bacula/src/win32/baculafd/GNUmakefile b/bacula/src/win32/baculafd/GNUmakefile new file mode 100644 index 0000000000..1f4d92db3f --- /dev/null +++ b/bacula/src/win32/baculafd/GNUmakefile @@ -0,0 +1,5 @@ +default: + env MAKEFLAGS= nmake CFG="baculafd - Win32 Release" /f baculafd.mak +clean: + env MAKEFLAGS= nmake CFG="baculafd - Win32 Release" /f baculafd.mak clean + diff --git a/bacula/src/win32/baculafd/StdAfx.cpp b/bacula/src/win32/baculafd/StdAfx.cpp new file mode 100644 index 0000000000..3bbf8ec8ea --- /dev/null +++ b/bacula/src/win32/baculafd/StdAfx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// baculaService.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/bacula/src/win32/baculafd/StdAfx.h b/bacula/src/win32/baculafd/StdAfx.h new file mode 100644 index 0000000000..b48aad0f65 --- /dev/null +++ b/bacula/src/win32/baculafd/StdAfx.h @@ -0,0 +1,30 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#if !defined(AFX_STDAFX_H__566FE838_69B8_4101_923D_4BAE2C46AD51__INCLUDED_) +#define AFX_STDAFX_H__566FE838_69B8_4101_923D_4BAE2C46AD51__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers + +#include +#include // MFC core and standard components +#include // MFC extensions +#include // MFC support for Internet Explorer 4 Common Controls +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC support for Windows Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT + +#include + +// TODO: reference additional headers your program requires here + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STDAFX_H__566FE838_69B8_4101_923D_4BAE2C46AD51__INCLUDED_) diff --git a/bacula/src/win32/baculafd/baculafd.dsp b/bacula/src/win32/baculafd/baculafd.dsp new file mode 100644 index 0000000000..2115fddf84 --- /dev/null +++ b/bacula/src/win32/baculafd/baculafd.dsp @@ -0,0 +1,505 @@ +# Microsoft Developer Studio Project File - Name="baculafd" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=baculafd - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "baculafd.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "baculafd.mak" CFG="baculafd - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "baculafd - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "baculafd - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "baculafd - Win32 Release" + +# PROP BASE Use_MFC 2 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 1 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../compat" /I "../.." /I "../pthreads" /I "../zlib" /I "." /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_WIN32" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 wsock32.lib pthreadVCE.lib zlib.lib /nologo /subsystem:windows /pdb:none /machine:I386 /nodefaultlib:"MSVCRT.lib" /out:"Release/bacula-fd.exe" /libpath:"../pthreads" /libpath:"../zlib" + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + +# PROP BASE Use_MFC 2 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 2 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../compat" /I "../.." /I "../pthreads" /I "../zlib" /I "." /D "_DEBUG" /D "_WINMAIN_" /D "PTW32_BUILD" /D "_AFXDLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_WIN32" /FR /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 wsock32.lib pthreadVCE.lib zlib.lib /nologo /subsystem:windows /pdb:none /debug /machine:I386 /out:"Debug/bacula-fd.exe" /libpath:"../pthreads" /libpath:"../zlib" +# SUBTRACT LINK32 /nodefaultlib + +!ENDIF + +# Begin Target + +# Name "baculafd - Win32 Release" +# Name "baculafd - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\lib\alist.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\alloc.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\attr.cpp +# End Source File +# Begin Source File + +SOURCE=..\findlib\attribs.cpp +# End Source File +# Begin Source File + +SOURCE=..\filed\authenticate.cpp +# End Source File +# Begin Source File + +SOURCE=..\filed\backup.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\base64.cpp +# End Source File +# Begin Source File + +SOURCE=..\findlib\bfile.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\bget_msg.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\bnet.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\bnet_server.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\bshm.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\bsys.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\btime.cpp +# End Source File +# Begin Source File + +SOURCE=..\compat\compat.cpp +# End Source File +# Begin Source File + +SOURCE="..\lib\cram-md5.cpp" +# End Source File +# Begin Source File + +SOURCE=..\lib\crc32.cpp +# End Source File +# Begin Source File + +SOURCE=..\findlib\create_file.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\daemon.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\dlist.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\edit.cpp +# End Source File +# Begin Source File + +SOURCE=..\findlib\enable_priv.cpp +# End Source File +# Begin Source File + +SOURCE=..\filed\estimate.cpp +# End Source File +# Begin Source File + +SOURCE=..\filed\filed.cpp +# End Source File +# Begin Source File + +SOURCE=..\filed\filed_conf.cpp +# End Source File +# Begin Source File + +SOURCE=..\findlib\find.cpp +# End Source File +# Begin Source File + +SOURCE=..\findlib\find_one.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\fnmatch.cpp +# End Source File +# Begin Source File + +SOURCE=..\compat\getopt.c +# End Source File +# Begin Source File + +SOURCE=..\filed\heartbeat.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\hmac.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\htable.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\idcache.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\jcr.cpp +# End Source File +# Begin Source File + +SOURCE=..\filed\job.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\lex.cpp +# End Source File +# Begin Source File + +SOURCE=..\findlib\makepath.cpp +# End Source File +# Begin Source File + +SOURCE=..\findlib\match.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\md5.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\mem_pool.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\message.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\parse_conf.cpp +# End Source File +# Begin Source File + +SOURCE=..\compat\print.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\queue.cpp +# End Source File +# Begin Source File + +SOURCE=..\filed\restore.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\rwlock.cpp +# End Source File +# Begin Source File + +SOURCE="..\findlib\save-cwd.cpp" +# End Source File +# Begin Source File + +SOURCE=..\lib\scan.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\semlock.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\serial.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\sha1.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\signal.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\smartall.cpp +# End Source File +# Begin Source File + +SOURCE=..\filed\status.cpp +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\timers.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\tree.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\util.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\var.cpp +# End Source File +# Begin Source File + +SOURCE=..\filed\verify.cpp +# End Source File +# Begin Source File + +SOURCE=..\filed\verify_vol.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\watchdog.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\filed\win32\winabout.cpp +# End Source File +# Begin Source File + +SOURCE=..\findlib\winapi.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\filed\win32\winevents.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\filed\win32\winmain.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\filed\win32\winres.rc +# End Source File +# Begin Source File + +SOURCE=..\..\filed\win32\winservice.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\filed\win32\winstat.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\filed\win32\wintray.cpp +# End Source File +# Begin Source File + +SOURCE=..\lib\workq.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\compat\alloca.h +# End Source File +# Begin Source File + +SOURCE=..\compat\compat.h +# End Source File +# Begin Source File + +SOURCE=..\compat\config.h +# End Source File +# Begin Source File + +SOURCE=..\compat\dirent.h +# End Source File +# Begin Source File + +SOURCE=..\compat\getopt.h +# End Source File +# Begin Source File + +SOURCE=..\compat\grp.h +# End Source File +# Begin Source File + +SOURCE=..\compat\host.h +# End Source File +# Begin Source File + +SOURCE=..\compat\mswinver.h +# End Source File +# Begin Source File + +SOURCE=..\compat\netdb.h +# End Source File +# Begin Source File + +SOURCE=..\compat\pwd.h +# End Source File +# Begin Source File + +SOURCE=..\compat\sched.h +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.h +# End Source File +# Begin Source File + +SOURCE=..\compat\stdint.h +# End Source File +# Begin Source File + +SOURCE=..\compat\strings.h +# End Source File +# Begin Source File + +SOURCE=..\compat\syslog.h +# End Source File +# Begin Source File + +SOURCE=..\compat\unistd.h +# End Source File +# Begin Source File + +SOURCE=..\..\filed\win32\winabout.h +# End Source File +# Begin Source File + +SOURCE=..\..\filed\win32\winbacula.h +# End Source File +# Begin Source File + +SOURCE=..\..\filed\win32\winevents.h +# End Source File +# Begin Source File + +SOURCE=..\..\filed\win32\winres.h +# End Source File +# Begin Source File + +SOURCE=..\..\filed\win32\winservice.h +# End Source File +# Begin Source File + +SOURCE=..\..\filed\win32\winstat.h +# End Source File +# Begin Source File + +SOURCE=..\..\filed\win32\wintray.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=..\..\src\filed\win32\bacula.bmp +# End Source File +# Begin Source File + +SOURCE=..\..\src\filed\win32\bacula.ico +# End Source File +# Begin Source File + +SOURCE=..\..\src\filed\win32\error.ico +# End Source File +# Begin Source File + +SOURCE=..\..\src\filed\win32\idle.ico +# End Source File +# Begin Source File + +SOURCE=..\..\src\filed\win32\running.ico +# End Source File +# Begin Source File + +SOURCE=..\..\src\filed\win32\saving.ico +# End Source File +# End Group +# Begin Source File + +SOURCE=.\ReadMe.txt +# End Source File +# End Target +# End Project diff --git a/bacula/src/win32/baculafd/baculafd.dsw b/bacula/src/win32/baculafd/baculafd.dsw new file mode 100644 index 0000000000..93d7af8652 --- /dev/null +++ b/bacula/src/win32/baculafd/baculafd.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "baculafd"=.\baculafd.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/bacula/src/win32/baculafd/baculafd.mak b/bacula/src/win32/baculafd/baculafd.mak new file mode 100644 index 0000000000..8341ae1e6e --- /dev/null +++ b/bacula/src/win32/baculafd/baculafd.mak @@ -0,0 +1,1882 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on baculafd.dsp +!IF "$(CFG)" == "" +CFG=baculafd - Win32 Debug +!MESSAGE No configuration specified. Defaulting to baculafd - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "baculafd - Win32 Release" && "$(CFG)" != "baculafd - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "baculafd.mak" CFG="baculafd - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "baculafd - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "baculafd - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +!IF "$(CFG)" == "baculafd - Win32 Release" + +OUTDIR=.\Release +INTDIR=.\Release +# Begin Custom Macros +OutDir=.\Release +# End Custom Macros + +ALL : "$(OUTDIR)\bacula-fd.exe" + + +CLEAN : + -@erase "$(INTDIR)\alist.obj" + -@erase "$(INTDIR)\alloc.obj" + -@erase "$(INTDIR)\attr.obj" + -@erase "$(INTDIR)\attribs.obj" + -@erase "$(INTDIR)\authenticate.obj" + -@erase "$(INTDIR)\backup.obj" + -@erase "$(INTDIR)\base64.obj" + -@erase "$(INTDIR)\bfile.obj" + -@erase "$(INTDIR)\bget_msg.obj" + -@erase "$(INTDIR)\bnet.obj" + -@erase "$(INTDIR)\bnet_server.obj" + -@erase "$(INTDIR)\bshm.obj" + -@erase "$(INTDIR)\bsys.obj" + -@erase "$(INTDIR)\btime.obj" + -@erase "$(INTDIR)\compat.obj" + -@erase "$(INTDIR)\cram-md5.obj" + -@erase "$(INTDIR)\crc32.obj" + -@erase "$(INTDIR)\create_file.obj" + -@erase "$(INTDIR)\daemon.obj" + -@erase "$(INTDIR)\dlist.obj" + -@erase "$(INTDIR)\edit.obj" + -@erase "$(INTDIR)\enable_priv.obj" + -@erase "$(INTDIR)\estimate.obj" + -@erase "$(INTDIR)\filed.obj" + -@erase "$(INTDIR)\filed_conf.obj" + -@erase "$(INTDIR)\find.obj" + -@erase "$(INTDIR)\find_one.obj" + -@erase "$(INTDIR)\fnmatch.obj" + -@erase "$(INTDIR)\getopt.obj" + -@erase "$(INTDIR)\heartbeat.obj" + -@erase "$(INTDIR)\hmac.obj" + -@erase "$(INTDIR)\htable.obj" + -@erase "$(INTDIR)\idcache.obj" + -@erase "$(INTDIR)\jcr.obj" + -@erase "$(INTDIR)\job.obj" + -@erase "$(INTDIR)\lex.obj" + -@erase "$(INTDIR)\makepath.obj" + -@erase "$(INTDIR)\match.obj" + -@erase "$(INTDIR)\md5.obj" + -@erase "$(INTDIR)\mem_pool.obj" + -@erase "$(INTDIR)\message.obj" + -@erase "$(INTDIR)\parse_conf.obj" + -@erase "$(INTDIR)\print.obj" + -@erase "$(INTDIR)\queue.obj" + -@erase "$(INTDIR)\restore.obj" + -@erase "$(INTDIR)\rwlock.obj" + -@erase "$(INTDIR)\save-cwd.obj" + -@erase "$(INTDIR)\scan.obj" + -@erase "$(INTDIR)\semlock.obj" + -@erase "$(INTDIR)\serial.obj" + -@erase "$(INTDIR)\sha1.obj" + -@erase "$(INTDIR)\signal.obj" + -@erase "$(INTDIR)\smartall.obj" + -@erase "$(INTDIR)\status.obj" + -@erase "$(INTDIR)\StdAfx.obj" + -@erase "$(INTDIR)\timers.obj" + -@erase "$(INTDIR)\tree.obj" + -@erase "$(INTDIR)\util.obj" + -@erase "$(INTDIR)\var.obj" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\verify.obj" + -@erase "$(INTDIR)\verify_vol.obj" + -@erase "$(INTDIR)\watchdog.obj" + -@erase "$(INTDIR)\winabout.obj" + -@erase "$(INTDIR)\winapi.obj" + -@erase "$(INTDIR)\winevents.obj" + -@erase "$(INTDIR)\winmain.obj" + -@erase "$(INTDIR)\winres.res" + -@erase "$(INTDIR)\winservice.obj" + -@erase "$(INTDIR)\winstat.obj" + -@erase "$(INTDIR)\wintray.obj" + -@erase "$(INTDIR)\workq.obj" + -@erase "$(OUTDIR)\bacula-fd.exe" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP=cl.exe +CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "../compat" /I "../.." /I "../pthreads" /I "../zlib" /I "." /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_WIN32" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +RSC=rc.exe +RSC_PROJ=/l 0x409 /fo"$(INTDIR)\winres.res" /d "NDEBUG" +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\baculafd.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=wsock32.lib pthreadVCE.lib zlib.lib /nologo /subsystem:windows /pdb:none /machine:I386 /nodefaultlib:"MSVCRT.lib" /out:"$(OUTDIR)\bacula-fd.exe" /libpath:"../pthreads" /libpath:"../zlib" +LINK32_OBJS= \ + "$(INTDIR)\compat.obj" \ + "$(INTDIR)\getopt.obj" \ + "$(INTDIR)\print.obj" \ + "$(INTDIR)\authenticate.obj" \ + "$(INTDIR)\backup.obj" \ + "$(INTDIR)\estimate.obj" \ + "$(INTDIR)\filed.obj" \ + "$(INTDIR)\filed_conf.obj" \ + "$(INTDIR)\heartbeat.obj" \ + "$(INTDIR)\job.obj" \ + "$(INTDIR)\restore.obj" \ + "$(INTDIR)\status.obj" \ + "$(INTDIR)\verify.obj" \ + "$(INTDIR)\verify_vol.obj" \ + "$(INTDIR)\attribs.obj" \ + "$(INTDIR)\bfile.obj" \ + "$(INTDIR)\create_file.obj" \ + "$(INTDIR)\enable_priv.obj" \ + "$(INTDIR)\find.obj" \ + "$(INTDIR)\find_one.obj" \ + "$(INTDIR)\makepath.obj" \ + "$(INTDIR)\match.obj" \ + "$(INTDIR)\save-cwd.obj" \ + "$(INTDIR)\winapi.obj" \ + "$(INTDIR)\alist.obj" \ + "$(INTDIR)\alloc.obj" \ + "$(INTDIR)\attr.obj" \ + "$(INTDIR)\base64.obj" \ + "$(INTDIR)\bget_msg.obj" \ + "$(INTDIR)\bnet.obj" \ + "$(INTDIR)\bnet_server.obj" \ + "$(INTDIR)\bshm.obj" \ + "$(INTDIR)\bsys.obj" \ + "$(INTDIR)\btime.obj" \ + "$(INTDIR)\cram-md5.obj" \ + "$(INTDIR)\crc32.obj" \ + "$(INTDIR)\daemon.obj" \ + "$(INTDIR)\dlist.obj" \ + "$(INTDIR)\edit.obj" \ + "$(INTDIR)\fnmatch.obj" \ + "$(INTDIR)\hmac.obj" \ + "$(INTDIR)\htable.obj" \ + "$(INTDIR)\idcache.obj" \ + "$(INTDIR)\jcr.obj" \ + "$(INTDIR)\lex.obj" \ + "$(INTDIR)\md5.obj" \ + "$(INTDIR)\mem_pool.obj" \ + "$(INTDIR)\message.obj" \ + "$(INTDIR)\parse_conf.obj" \ + "$(INTDIR)\queue.obj" \ + "$(INTDIR)\rwlock.obj" \ + "$(INTDIR)\scan.obj" \ + "$(INTDIR)\semlock.obj" \ + "$(INTDIR)\serial.obj" \ + "$(INTDIR)\sha1.obj" \ + "$(INTDIR)\signal.obj" \ + "$(INTDIR)\smartall.obj" \ + "$(INTDIR)\timers.obj" \ + "$(INTDIR)\tree.obj" \ + "$(INTDIR)\util.obj" \ + "$(INTDIR)\var.obj" \ + "$(INTDIR)\watchdog.obj" \ + "$(INTDIR)\workq.obj" \ + "$(INTDIR)\StdAfx.obj" \ + "$(INTDIR)\winabout.obj" \ + "$(INTDIR)\winevents.obj" \ + "$(INTDIR)\winmain.obj" \ + "$(INTDIR)\winres.res" \ + "$(INTDIR)\winservice.obj" \ + "$(INTDIR)\winstat.obj" \ + "$(INTDIR)\wintray.obj" + +"$(OUTDIR)\bacula-fd.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + +OUTDIR=.\Debug +INTDIR=.\Debug +# Begin Custom Macros +OutDir=.\Debug +# End Custom Macros + +ALL : "$(OUTDIR)\bacula-fd.exe" "$(OUTDIR)\baculafd.bsc" + + +CLEAN : + -@erase "$(INTDIR)\alist.obj" + -@erase "$(INTDIR)\alist.sbr" + -@erase "$(INTDIR)\alloc.obj" + -@erase "$(INTDIR)\alloc.sbr" + -@erase "$(INTDIR)\attr.obj" + -@erase "$(INTDIR)\attr.sbr" + -@erase "$(INTDIR)\attribs.obj" + -@erase "$(INTDIR)\attribs.sbr" + -@erase "$(INTDIR)\authenticate.obj" + -@erase "$(INTDIR)\authenticate.sbr" + -@erase "$(INTDIR)\backup.obj" + -@erase "$(INTDIR)\backup.sbr" + -@erase "$(INTDIR)\base64.obj" + -@erase "$(INTDIR)\base64.sbr" + -@erase "$(INTDIR)\bfile.obj" + -@erase "$(INTDIR)\bfile.sbr" + -@erase "$(INTDIR)\bget_msg.obj" + -@erase "$(INTDIR)\bget_msg.sbr" + -@erase "$(INTDIR)\bnet.obj" + -@erase "$(INTDIR)\bnet.sbr" + -@erase "$(INTDIR)\bnet_server.obj" + -@erase "$(INTDIR)\bnet_server.sbr" + -@erase "$(INTDIR)\bshm.obj" + -@erase "$(INTDIR)\bshm.sbr" + -@erase "$(INTDIR)\bsys.obj" + -@erase "$(INTDIR)\bsys.sbr" + -@erase "$(INTDIR)\btime.obj" + -@erase "$(INTDIR)\btime.sbr" + -@erase "$(INTDIR)\compat.obj" + -@erase "$(INTDIR)\compat.sbr" + -@erase "$(INTDIR)\cram-md5.obj" + -@erase "$(INTDIR)\cram-md5.sbr" + -@erase "$(INTDIR)\crc32.obj" + -@erase "$(INTDIR)\crc32.sbr" + -@erase "$(INTDIR)\create_file.obj" + -@erase "$(INTDIR)\create_file.sbr" + -@erase "$(INTDIR)\daemon.obj" + -@erase "$(INTDIR)\daemon.sbr" + -@erase "$(INTDIR)\dlist.obj" + -@erase "$(INTDIR)\dlist.sbr" + -@erase "$(INTDIR)\edit.obj" + -@erase "$(INTDIR)\edit.sbr" + -@erase "$(INTDIR)\enable_priv.obj" + -@erase "$(INTDIR)\enable_priv.sbr" + -@erase "$(INTDIR)\estimate.obj" + -@erase "$(INTDIR)\estimate.sbr" + -@erase "$(INTDIR)\filed.obj" + -@erase "$(INTDIR)\filed.sbr" + -@erase "$(INTDIR)\filed_conf.obj" + -@erase "$(INTDIR)\filed_conf.sbr" + -@erase "$(INTDIR)\find.obj" + -@erase "$(INTDIR)\find.sbr" + -@erase "$(INTDIR)\find_one.obj" + -@erase "$(INTDIR)\find_one.sbr" + -@erase "$(INTDIR)\fnmatch.obj" + -@erase "$(INTDIR)\fnmatch.sbr" + -@erase "$(INTDIR)\getopt.obj" + -@erase "$(INTDIR)\getopt.sbr" + -@erase "$(INTDIR)\heartbeat.obj" + -@erase "$(INTDIR)\heartbeat.sbr" + -@erase "$(INTDIR)\hmac.obj" + -@erase "$(INTDIR)\hmac.sbr" + -@erase "$(INTDIR)\htable.obj" + -@erase "$(INTDIR)\htable.sbr" + -@erase "$(INTDIR)\idcache.obj" + -@erase "$(INTDIR)\idcache.sbr" + -@erase "$(INTDIR)\jcr.obj" + -@erase "$(INTDIR)\jcr.sbr" + -@erase "$(INTDIR)\job.obj" + -@erase "$(INTDIR)\job.sbr" + -@erase "$(INTDIR)\lex.obj" + -@erase "$(INTDIR)\lex.sbr" + -@erase "$(INTDIR)\makepath.obj" + -@erase "$(INTDIR)\makepath.sbr" + -@erase "$(INTDIR)\match.obj" + -@erase "$(INTDIR)\match.sbr" + -@erase "$(INTDIR)\md5.obj" + -@erase "$(INTDIR)\md5.sbr" + -@erase "$(INTDIR)\mem_pool.obj" + -@erase "$(INTDIR)\mem_pool.sbr" + -@erase "$(INTDIR)\message.obj" + -@erase "$(INTDIR)\message.sbr" + -@erase "$(INTDIR)\parse_conf.obj" + -@erase "$(INTDIR)\parse_conf.sbr" + -@erase "$(INTDIR)\print.obj" + -@erase "$(INTDIR)\print.sbr" + -@erase "$(INTDIR)\queue.obj" + -@erase "$(INTDIR)\queue.sbr" + -@erase "$(INTDIR)\restore.obj" + -@erase "$(INTDIR)\restore.sbr" + -@erase "$(INTDIR)\rwlock.obj" + -@erase "$(INTDIR)\rwlock.sbr" + -@erase "$(INTDIR)\save-cwd.obj" + -@erase "$(INTDIR)\save-cwd.sbr" + -@erase "$(INTDIR)\scan.obj" + -@erase "$(INTDIR)\scan.sbr" + -@erase "$(INTDIR)\semlock.obj" + -@erase "$(INTDIR)\semlock.sbr" + -@erase "$(INTDIR)\serial.obj" + -@erase "$(INTDIR)\serial.sbr" + -@erase "$(INTDIR)\sha1.obj" + -@erase "$(INTDIR)\sha1.sbr" + -@erase "$(INTDIR)\signal.obj" + -@erase "$(INTDIR)\signal.sbr" + -@erase "$(INTDIR)\smartall.obj" + -@erase "$(INTDIR)\smartall.sbr" + -@erase "$(INTDIR)\status.obj" + -@erase "$(INTDIR)\status.sbr" + -@erase "$(INTDIR)\StdAfx.obj" + -@erase "$(INTDIR)\StdAfx.sbr" + -@erase "$(INTDIR)\timers.obj" + -@erase "$(INTDIR)\timers.sbr" + -@erase "$(INTDIR)\tree.obj" + -@erase "$(INTDIR)\tree.sbr" + -@erase "$(INTDIR)\util.obj" + -@erase "$(INTDIR)\util.sbr" + -@erase "$(INTDIR)\var.obj" + -@erase "$(INTDIR)\var.sbr" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\vc60.pdb" + -@erase "$(INTDIR)\verify.obj" + -@erase "$(INTDIR)\verify.sbr" + -@erase "$(INTDIR)\verify_vol.obj" + -@erase "$(INTDIR)\verify_vol.sbr" + -@erase "$(INTDIR)\watchdog.obj" + -@erase "$(INTDIR)\watchdog.sbr" + -@erase "$(INTDIR)\winabout.obj" + -@erase "$(INTDIR)\winabout.sbr" + -@erase "$(INTDIR)\winapi.obj" + -@erase "$(INTDIR)\winapi.sbr" + -@erase "$(INTDIR)\winevents.obj" + -@erase "$(INTDIR)\winevents.sbr" + -@erase "$(INTDIR)\winmain.obj" + -@erase "$(INTDIR)\winmain.sbr" + -@erase "$(INTDIR)\winres.res" + -@erase "$(INTDIR)\winservice.obj" + -@erase "$(INTDIR)\winservice.sbr" + -@erase "$(INTDIR)\winstat.obj" + -@erase "$(INTDIR)\winstat.sbr" + -@erase "$(INTDIR)\wintray.obj" + -@erase "$(INTDIR)\wintray.sbr" + -@erase "$(INTDIR)\workq.obj" + -@erase "$(INTDIR)\workq.sbr" + -@erase "$(OUTDIR)\bacula-fd.exe" + -@erase "$(OUTDIR)\baculafd.bsc" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP=cl.exe +CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "../compat" /I "../.." /I "../pthreads" /I "../zlib" /I "." /D "_DEBUG" /D "_WINMAIN_" /D "PTW32_BUILD" /D "_AFXDLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "HAVE_WIN32" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +RSC=rc.exe +RSC_PROJ=/l 0x409 /fo"$(INTDIR)\winres.res" /d "_DEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\baculafd.bsc" +BSC32_SBRS= \ + "$(INTDIR)\compat.sbr" \ + "$(INTDIR)\getopt.sbr" \ + "$(INTDIR)\print.sbr" \ + "$(INTDIR)\authenticate.sbr" \ + "$(INTDIR)\backup.sbr" \ + "$(INTDIR)\estimate.sbr" \ + "$(INTDIR)\filed.sbr" \ + "$(INTDIR)\filed_conf.sbr" \ + "$(INTDIR)\heartbeat.sbr" \ + "$(INTDIR)\job.sbr" \ + "$(INTDIR)\restore.sbr" \ + "$(INTDIR)\status.sbr" \ + "$(INTDIR)\verify.sbr" \ + "$(INTDIR)\verify_vol.sbr" \ + "$(INTDIR)\attribs.sbr" \ + "$(INTDIR)\bfile.sbr" \ + "$(INTDIR)\create_file.sbr" \ + "$(INTDIR)\enable_priv.sbr" \ + "$(INTDIR)\find.sbr" \ + "$(INTDIR)\find_one.sbr" \ + "$(INTDIR)\makepath.sbr" \ + "$(INTDIR)\match.sbr" \ + "$(INTDIR)\save-cwd.sbr" \ + "$(INTDIR)\winapi.sbr" \ + "$(INTDIR)\alist.sbr" \ + "$(INTDIR)\alloc.sbr" \ + "$(INTDIR)\attr.sbr" \ + "$(INTDIR)\base64.sbr" \ + "$(INTDIR)\bget_msg.sbr" \ + "$(INTDIR)\bnet.sbr" \ + "$(INTDIR)\bnet_server.sbr" \ + "$(INTDIR)\bshm.sbr" \ + "$(INTDIR)\bsys.sbr" \ + "$(INTDIR)\btime.sbr" \ + "$(INTDIR)\cram-md5.sbr" \ + "$(INTDIR)\crc32.sbr" \ + "$(INTDIR)\daemon.sbr" \ + "$(INTDIR)\dlist.sbr" \ + "$(INTDIR)\edit.sbr" \ + "$(INTDIR)\fnmatch.sbr" \ + "$(INTDIR)\hmac.sbr" \ + "$(INTDIR)\htable.sbr" \ + "$(INTDIR)\idcache.sbr" \ + "$(INTDIR)\jcr.sbr" \ + "$(INTDIR)\lex.sbr" \ + "$(INTDIR)\md5.sbr" \ + "$(INTDIR)\mem_pool.sbr" \ + "$(INTDIR)\message.sbr" \ + "$(INTDIR)\parse_conf.sbr" \ + "$(INTDIR)\queue.sbr" \ + "$(INTDIR)\rwlock.sbr" \ + "$(INTDIR)\scan.sbr" \ + "$(INTDIR)\semlock.sbr" \ + "$(INTDIR)\serial.sbr" \ + "$(INTDIR)\sha1.sbr" \ + "$(INTDIR)\signal.sbr" \ + "$(INTDIR)\smartall.sbr" \ + "$(INTDIR)\timers.sbr" \ + "$(INTDIR)\tree.sbr" \ + "$(INTDIR)\util.sbr" \ + "$(INTDIR)\var.sbr" \ + "$(INTDIR)\watchdog.sbr" \ + "$(INTDIR)\workq.sbr" \ + "$(INTDIR)\StdAfx.sbr" \ + "$(INTDIR)\winabout.sbr" \ + "$(INTDIR)\winevents.sbr" \ + "$(INTDIR)\winmain.sbr" \ + "$(INTDIR)\winservice.sbr" \ + "$(INTDIR)\winstat.sbr" \ + "$(INTDIR)\wintray.sbr" + +"$(OUTDIR)\baculafd.bsc" : "$(OUTDIR)" $(BSC32_SBRS) + $(BSC32) @<< + $(BSC32_FLAGS) $(BSC32_SBRS) +<< + +LINK32=link.exe +LINK32_FLAGS=wsock32.lib pthreadVCE.lib zlib.lib /nologo /subsystem:windows /pdb:none /debug /machine:I386 /out:"$(OUTDIR)\bacula-fd.exe" /libpath:"../pthreads" /libpath:"../zlib" +LINK32_OBJS= \ + "$(INTDIR)\compat.obj" \ + "$(INTDIR)\getopt.obj" \ + "$(INTDIR)\print.obj" \ + "$(INTDIR)\authenticate.obj" \ + "$(INTDIR)\backup.obj" \ + "$(INTDIR)\estimate.obj" \ + "$(INTDIR)\filed.obj" \ + "$(INTDIR)\filed_conf.obj" \ + "$(INTDIR)\heartbeat.obj" \ + "$(INTDIR)\job.obj" \ + "$(INTDIR)\restore.obj" \ + "$(INTDIR)\status.obj" \ + "$(INTDIR)\verify.obj" \ + "$(INTDIR)\verify_vol.obj" \ + "$(INTDIR)\attribs.obj" \ + "$(INTDIR)\bfile.obj" \ + "$(INTDIR)\create_file.obj" \ + "$(INTDIR)\enable_priv.obj" \ + "$(INTDIR)\find.obj" \ + "$(INTDIR)\find_one.obj" \ + "$(INTDIR)\makepath.obj" \ + "$(INTDIR)\match.obj" \ + "$(INTDIR)\save-cwd.obj" \ + "$(INTDIR)\winapi.obj" \ + "$(INTDIR)\alist.obj" \ + "$(INTDIR)\alloc.obj" \ + "$(INTDIR)\attr.obj" \ + "$(INTDIR)\base64.obj" \ + "$(INTDIR)\bget_msg.obj" \ + "$(INTDIR)\bnet.obj" \ + "$(INTDIR)\bnet_server.obj" \ + "$(INTDIR)\bshm.obj" \ + "$(INTDIR)\bsys.obj" \ + "$(INTDIR)\btime.obj" \ + "$(INTDIR)\cram-md5.obj" \ + "$(INTDIR)\crc32.obj" \ + "$(INTDIR)\daemon.obj" \ + "$(INTDIR)\dlist.obj" \ + "$(INTDIR)\edit.obj" \ + "$(INTDIR)\fnmatch.obj" \ + "$(INTDIR)\hmac.obj" \ + "$(INTDIR)\htable.obj" \ + "$(INTDIR)\idcache.obj" \ + "$(INTDIR)\jcr.obj" \ + "$(INTDIR)\lex.obj" \ + "$(INTDIR)\md5.obj" \ + "$(INTDIR)\mem_pool.obj" \ + "$(INTDIR)\message.obj" \ + "$(INTDIR)\parse_conf.obj" \ + "$(INTDIR)\queue.obj" \ + "$(INTDIR)\rwlock.obj" \ + "$(INTDIR)\scan.obj" \ + "$(INTDIR)\semlock.obj" \ + "$(INTDIR)\serial.obj" \ + "$(INTDIR)\sha1.obj" \ + "$(INTDIR)\signal.obj" \ + "$(INTDIR)\smartall.obj" \ + "$(INTDIR)\timers.obj" \ + "$(INTDIR)\tree.obj" \ + "$(INTDIR)\util.obj" \ + "$(INTDIR)\var.obj" \ + "$(INTDIR)\watchdog.obj" \ + "$(INTDIR)\workq.obj" \ + "$(INTDIR)\StdAfx.obj" \ + "$(INTDIR)\winabout.obj" \ + "$(INTDIR)\winevents.obj" \ + "$(INTDIR)\winmain.obj" \ + "$(INTDIR)\winres.res" \ + "$(INTDIR)\winservice.obj" \ + "$(INTDIR)\winstat.obj" \ + "$(INTDIR)\wintray.obj" + +"$(OUTDIR)\bacula-fd.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("baculafd.dep") +!INCLUDE "baculafd.dep" +!ELSE +!MESSAGE Warning: cannot find "baculafd.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "baculafd - Win32 Release" || "$(CFG)" == "baculafd - Win32 Debug" +SOURCE=..\lib\alist.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\alist.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\alist.obj" "$(INTDIR)\alist.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\alloc.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\alloc.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\alloc.obj" "$(INTDIR)\alloc.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\attr.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\attr.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\attr.obj" "$(INTDIR)\attr.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\findlib\attribs.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\attribs.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\attribs.obj" "$(INTDIR)\attribs.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\filed\authenticate.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\authenticate.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\authenticate.obj" "$(INTDIR)\authenticate.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\filed\backup.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\backup.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\backup.obj" "$(INTDIR)\backup.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\base64.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\base64.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\base64.obj" "$(INTDIR)\base64.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\findlib\bfile.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\bfile.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\bfile.obj" "$(INTDIR)\bfile.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\bget_msg.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\bget_msg.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\bget_msg.obj" "$(INTDIR)\bget_msg.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\bnet.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\bnet.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\bnet.obj" "$(INTDIR)\bnet.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\bnet_server.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\bnet_server.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\bnet_server.obj" "$(INTDIR)\bnet_server.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\bshm.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\bshm.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\bshm.obj" "$(INTDIR)\bshm.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\bsys.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\bsys.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\bsys.obj" "$(INTDIR)\bsys.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\btime.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\btime.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\btime.obj" "$(INTDIR)\btime.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\compat\compat.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\compat.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\compat.obj" "$(INTDIR)\compat.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE="..\lib\cram-md5.cpp" + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\cram-md5.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\cram-md5.obj" "$(INTDIR)\cram-md5.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\crc32.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\crc32.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\crc32.obj" "$(INTDIR)\crc32.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\findlib\create_file.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\create_file.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\create_file.obj" "$(INTDIR)\create_file.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\daemon.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\daemon.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\daemon.obj" "$(INTDIR)\daemon.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\dlist.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\dlist.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\dlist.obj" "$(INTDIR)\dlist.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\edit.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\edit.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\edit.obj" "$(INTDIR)\edit.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\findlib\enable_priv.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\enable_priv.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\enable_priv.obj" "$(INTDIR)\enable_priv.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\filed\estimate.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\estimate.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\estimate.obj" "$(INTDIR)\estimate.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\filed\filed.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\filed.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\filed.obj" "$(INTDIR)\filed.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\filed\filed_conf.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\filed_conf.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\filed_conf.obj" "$(INTDIR)\filed_conf.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\findlib\find.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\find.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\find.obj" "$(INTDIR)\find.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\findlib\find_one.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\find_one.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\find_one.obj" "$(INTDIR)\find_one.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\fnmatch.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\fnmatch.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\fnmatch.obj" "$(INTDIR)\fnmatch.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\compat\getopt.c + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\getopt.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\getopt.obj" "$(INTDIR)\getopt.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\filed\heartbeat.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\heartbeat.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\heartbeat.obj" "$(INTDIR)\heartbeat.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\hmac.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\hmac.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\hmac.obj" "$(INTDIR)\hmac.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\htable.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\htable.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\htable.obj" "$(INTDIR)\htable.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\idcache.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\idcache.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\idcache.obj" "$(INTDIR)\idcache.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\jcr.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\jcr.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\jcr.obj" "$(INTDIR)\jcr.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\filed\job.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\job.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\job.obj" "$(INTDIR)\job.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\lex.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\lex.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\lex.obj" "$(INTDIR)\lex.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\findlib\makepath.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\makepath.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\makepath.obj" "$(INTDIR)\makepath.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\findlib\match.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\match.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\match.obj" "$(INTDIR)\match.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\md5.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\md5.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\md5.obj" "$(INTDIR)\md5.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\mem_pool.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\mem_pool.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\mem_pool.obj" "$(INTDIR)\mem_pool.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\message.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\message.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\message.obj" "$(INTDIR)\message.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\parse_conf.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\parse_conf.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\parse_conf.obj" "$(INTDIR)\parse_conf.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\compat\print.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\print.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\print.obj" "$(INTDIR)\print.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\queue.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\queue.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\queue.obj" "$(INTDIR)\queue.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\filed\restore.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\restore.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\restore.obj" "$(INTDIR)\restore.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\rwlock.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\rwlock.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\rwlock.obj" "$(INTDIR)\rwlock.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE="..\findlib\save-cwd.cpp" + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\save-cwd.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\save-cwd.obj" "$(INTDIR)\save-cwd.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\scan.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\scan.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\scan.obj" "$(INTDIR)\scan.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\semlock.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\semlock.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\semlock.obj" "$(INTDIR)\semlock.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\serial.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\serial.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\serial.obj" "$(INTDIR)\serial.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\sha1.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\sha1.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\sha1.obj" "$(INTDIR)\sha1.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\signal.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\signal.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\signal.obj" "$(INTDIR)\signal.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\smartall.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\smartall.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\smartall.obj" "$(INTDIR)\smartall.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\filed\status.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\status.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\status.obj" "$(INTDIR)\status.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=.\StdAfx.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\StdAfx.obj" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\StdAfx.obj" "$(INTDIR)\StdAfx.sbr" : $(SOURCE) "$(INTDIR)" + + +!ENDIF + +SOURCE=..\lib\timers.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\timers.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\timers.obj" "$(INTDIR)\timers.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\tree.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\tree.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\tree.obj" "$(INTDIR)\tree.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\util.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\util.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\util.obj" "$(INTDIR)\util.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\var.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\var.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\var.obj" "$(INTDIR)\var.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\filed\verify.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\verify.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\verify.obj" "$(INTDIR)\verify.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\filed\verify_vol.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\verify_vol.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\verify_vol.obj" "$(INTDIR)\verify_vol.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\watchdog.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\watchdog.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\watchdog.obj" "$(INTDIR)\watchdog.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\..\filed\win32\winabout.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\winabout.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\winabout.obj" "$(INTDIR)\winabout.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\findlib\winapi.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\winapi.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\winapi.obj" "$(INTDIR)\winapi.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\..\filed\win32\winevents.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\winevents.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\winevents.obj" "$(INTDIR)\winevents.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\..\filed\win32\winmain.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\winmain.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\winmain.obj" "$(INTDIR)\winmain.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\..\filed\win32\winres.rc + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\winres.res" : $(SOURCE) "$(INTDIR)" + $(RSC) /l 0x409 /fo"$(INTDIR)\winres.res" /i "C:\home\csh\sourceforge\bacula\src\filed\win32" /d "NDEBUG" $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\winres.res" : $(SOURCE) "$(INTDIR)" + $(RSC) /l 0x409 /fo"$(INTDIR)\winres.res" /i "C:\home\csh\sourceforge\bacula\src\filed\win32" /d "_DEBUG" /d "_AFXDLL" $(SOURCE) + + +!ENDIF + +SOURCE=..\..\filed\win32\winservice.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\winservice.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\winservice.obj" "$(INTDIR)\winservice.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\..\filed\win32\winstat.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\winstat.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\winstat.obj" "$(INTDIR)\winstat.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\..\filed\win32\wintray.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\wintray.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\wintray.obj" "$(INTDIR)\wintray.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\lib\workq.cpp + +!IF "$(CFG)" == "baculafd - Win32 Release" + + +"$(INTDIR)\workq.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "baculafd - Win32 Debug" + + +"$(INTDIR)\workq.obj" "$(INTDIR)\workq.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + + +!ENDIF + diff --git a/bacula/src/win32/build.bat b/bacula/src/win32/build.bat new file mode 100755 index 0000000000..84d08d10ef --- /dev/null +++ b/bacula/src/win32/build.bat @@ -0,0 +1,14 @@ +REM build release if cygwin make not available. + +cd zlib +nmake /f win32\Makefile.msc +cd .. +cd pthreads +nmake VCE +cd .. +cd baculafd +nmake CFG="baculafd - Win32 Release" /f baculafd.mak +cd .. +makensis bacula.nsi + + diff --git a/bacula/src/win32/compat/alloca.h b/bacula/src/win32/compat/alloca.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bacula/src/win32/compat/arpa/inet.h b/bacula/src/win32/compat/arpa/inet.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bacula/src/win32/compat/compat.cpp b/bacula/src/win32/compat/compat.cpp new file mode 100644 index 0000000000..447971cad5 --- /dev/null +++ b/bacula/src/win32/compat/compat.cpp @@ -0,0 +1,1028 @@ +// -*- Mode: C++ -*- +// compat.cpp -- compatibilty layer to make bacula-fd run +// natively under windows +// +// Copyright (C)2004 Raider Solutions, Inc +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of +// the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public +// License along with this program; if not, write to the Free +// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +// MA 02111-1307, USA. +// +// Author : Christopher S. Hull +// Created On : Sat Jan 31 15:55:00 2004 +// Last Modified By: Christopher S. Hull +// Last Modified On: Mon Feb 9 12:18:04 2004 +// Update Count : 474 +// $Id$ + +#include + +#include "compat.h" +#include "pthread.h" + +extern void d_msg(char *file, int line, int level, char *fmt,...); +extern DWORD g_platform_id; + + +extern "C" void +cygwin_conv_to_win32_path(const char *name, char *win32_name) +{ + while (*name) { + if (*name == '/') + *win32_name++ = '\\'; + else + *win32_name++ = *name; + name++; + } + if (win32_name[-1] == '\\') + win32_name[-1] = 0; + else + *win32_name = 0; +} + + +int +open(const char *file, int flags, int mode) +{ + DWORD access = 0; + DWORD shareMode = 0; + DWORD create = 0; + DWORD msflags = 0; + HANDLE foo; + const char *remap = file; + + if (flags & O_WRONLY) access = GENERIC_WRITE; + else if (flags & O_RDWR) access = GENERIC_READ|GENERIC_WRITE; + else access = GENERIC_READ; + + if (flags & O_CREAT) create = CREATE_NEW; + else create = OPEN_EXISTING; + + if (flags & O_TRUNC) create = TRUNCATE_EXISTING; + + if (!(flags & O_EXCL)) + shareMode = FILE_SHARE_DELETE|FILE_SHARE_READ|FILE_SHARE_WRITE; + + if (flags & O_APPEND) + { + printf("open...APPEND not implemented yet."); + exit(-1); + } + + foo = CreateFile(file, access, shareMode, NULL, create, msflags, NULL); + if (INVALID_HANDLE_VALUE == foo) + return(int) -1; + + return (int)foo; + +} + + +int +close(int fd) +{ + if (!CloseHandle((HANDLE)fd)) + return -1; + + return 0; +} + +int +write(int fd, const void *data, int32_t len) +{ + BOOL status; + DWORD bwrite; + status = WriteFile((HANDLE)fd, data, len, &bwrite, NULL); + if (status) return bwrite; + return -1; +} + + +int +read(int fd, void *data, int32_t len) +{ + BOOL status; + DWORD bread; + + status = ReadFile((HANDLE)fd, data, len, &bread, NULL); + if (status) return bread; + + return -1; +} + +int +umask(int) +{ + return 0; +} + +int +chmod(const char *, mode_t) +{ + return 0; +} + +int +chown(const char *k, uid_t, gid_t) +{ + return 0; +} + +int +lchown(const char *k, uid_t, gid_t) +{ + return 0; +} + +int +utime(const char *, struct utimbuf *) +{ + return -1; +} + + +long int +random(void) +{ + return rand(); +} + +void +srandom(unsigned int seed) +{ + srand(seed); +} +// ///////////////////////////////////////////////////////////////// +// convert from Windows concept of time to Unix concept of time +// ///////////////////////////////////////////////////////////////// +time_t +cvt(const FILETIME &time) +{ + uint64_t mstime = time.dwHighDateTime; + mstime <<= 32; + mstime |= time.dwLowDateTime; + + mstime /= 10000000; // convert to seconds. + mstime -= 3234336I64*3600I64; // difference between jan 1, 1601 and jan, 1 1970 + + return (time_t) (mstime & 0xffffffff); +} + +static const char * +errorString(void) +{ + LPVOID lpMsgBuf; + + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default lang + (LPTSTR) &lpMsgBuf, + 0, + NULL); + + return (const char *) lpMsgBuf; +} + +static int +statDir(const char *file, struct stat *sb) +{ + WIN32_FIND_DATA info; // window's file info + sb->st_mode |= S_IFDIR; + + if (file[1] == ':' && file[2] == 0) + { + d_msg(__FILE__, __LINE__, 99, "faking ROOT attrs(%s).\n", file); + sb->st_mode |= S_IREAD|S_IEXEC|S_IWRITE; + time(&sb->st_ctime); + time(&sb->st_mtime); + time(&sb->st_atime); + return 0; + } + HANDLE h = FindFirstFile(file, &info); + + if (h == INVALID_HANDLE_VALUE) { + const char *err = errorString(); + d_msg(__FILE__, __LINE__, 99, "FindFirstFile(%s):%s\n", file, err); + LocalFree((void *)err); + errno = GetLastError(); + return -1; + } + + sb->st_mode |= (S_IREAD | S_IEXEC); + if (!(info.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + sb->st_mode |= S_IWRITE; + + if (info.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM) + sb->st_mode |= S_IRGRP; + if (info.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) + sb->st_mode |= S_IROTH; + sb->st_size = info.nFileSizeHigh; + sb->st_size <<= 32; + sb->st_size |= info.nFileSizeLow; + sb->st_blksize = 4096; + sb->st_blocks = (uint32_t)(sb->st_size + 4095)/4096; + sb->st_atime = cvt(info.ftLastAccessTime); + sb->st_mtime = cvt(info.ftLastWriteTime); + sb->st_ctime = cvt(info.ftCreationTime); + + return 0; +} + +static int +stat2(const char *file, struct stat *sb) +{ + BY_HANDLE_FILE_INFORMATION info; + HANDLE h; + int rval = 0; + char tmpbuf[1024]; + cygwin_conv_to_win32_path(file, tmpbuf); + + DWORD attr = GetFileAttributes(tmpbuf); + + if (attr == -1) { + const char *err = errorString(); + d_msg(__FILE__, __LINE__, 99, "GetFileAttrubtes(%s): %s\n", tmpbuf, err); + LocalFree((void *)err); + errno = GetLastError(); + return -1; + } + + if (attr & FILE_ATTRIBUTE_DIRECTORY) + return statDir(tmpbuf, sb); + + sb->st_mode |= S_IFREG; + + h = CreateFile(tmpbuf, GENERIC_READ, + FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); + + if (h == INVALID_HANDLE_VALUE) { + const char *err = errorString(); + d_msg(__FILE__, __LINE__, 99, "Cannot open file for stat (%s):%s\n", tmpbuf, err); + LocalFree((void *)err); + rval = -1; + errno = GetLastError(); + goto error; + } + + if (!GetFileInformationByHandle(h, &info)) { + const char *err = errorString(); + d_msg(__FILE__, __LINE__, 99, "GetfileInformationByHandle(%s): %s\n", tmpbuf, err); + LocalFree((void *)err); + rval = -1; + errno = GetLastError(); + goto error; + } + + sb->st_dev = info.dwVolumeSerialNumber; + sb->st_ino = info.nFileIndexHigh; + sb->st_ino <<= 32; + sb->st_ino |= info.nFileIndexLow; + sb->st_nlink = (short)info.nNumberOfLinks; + sb->st_mode |= (S_IREAD | S_IEXEC); + if (!(info.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + sb->st_mode |= S_IWRITE; + + if (info.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM) + sb->st_mode |= S_IRGRP; + if (info.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) + sb->st_mode |= S_IROTH; + sb->st_size = info.nFileSizeHigh; + sb->st_size <<= 32; + sb->st_size |= info.nFileSizeLow; + sb->st_blksize = 4096; + sb->st_blocks = (uint32_t)(sb->st_size + 4095)/4096; + sb->st_atime = cvt(info.ftLastAccessTime); + sb->st_mtime = cvt(info.ftLastWriteTime); + sb->st_ctime = cvt(info.ftCreationTime); + +error: + CloseHandle(h); + return rval; +} +int +stat(const char *file, struct stat *sb) +{ + WIN32_FILE_ATTRIBUTE_DATA data; + errno = 0; + + memset(sb, 0, sizeof(*sb)); + + if (g_platform_id == VER_PLATFORM_WIN32_WINDOWS) + return stat2(file, sb); + + if (!GetFileAttributesEx(file, GetFileExInfoStandard, &data)) + return stat2(file, sb); + + if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + sb->st_mode |= S_IFDIR; + else + sb->st_mode |= S_IFREG; + + sb->st_nlink = 1; + sb->st_mode |= (S_IREAD | S_IEXEC); + if (!(data.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + sb->st_mode |= S_IWRITE; + + if (data.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM) + sb->st_mode |= S_IRGRP; + if (data.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) + sb->st_mode |= S_IROTH; + sb->st_size = data.nFileSizeHigh; + sb->st_size <<= 32; + sb->st_size |= data.nFileSizeLow; + sb->st_blksize = 4096; + sb->st_blocks = (uint32_t)(sb->st_size + 4095)/4096; + sb->st_atime = cvt(data.ftLastAccessTime); + sb->st_mtime = cvt(data.ftLastWriteTime); + sb->st_ctime = cvt(data.ftCreationTime); + return 0; +} + +int +lstat(const char *file, struct stat *sb) +{ + return stat(file, sb); +} +void +sleep(int sec) +{ + Sleep(sec * 1000); +} + +int +geteuid(void) +{ + return 0; +} + +int +execvp(const char *, char *[]) { + return -1; +} + +int +dup2(int, int) +{ + return -1; +} + +int +fork(void) +{ + return -1; +} + +int +pipe(int[]) +{ + return -1; +} + +int +waitpid(int, int*, int) +{ + return -1; +} + +int +readlink(const char *, char *, int) +{ + return -1; +} + +int +lseek(int fd, int offset, int whence) +{ + DWORD method = 0; + switch (whence) { + case SEEK_SET : + method = FILE_BEGIN; + break; + case SEEK_CUR: + method = FILE_CURRENT; + break; + case SEEK_END: + method = FILE_END; + break; + default: + return -1; + } + + return SetFilePointer((HANDLE)fd, (DWORD)offset, NULL, method); +} + +int +strcasecmp(const char *s1, const char *s2) +{ + register int ch1, ch2; + + if (s1==s2) + return 0; /* strings are equal if same object. */ + else if (!s1) + return -1; + else if (!s2) + return 1; + do + { + ch1 = *s1; + ch2 = *s2; + s1++; + s2++; + } while (ch1 != 0 && tolower(ch1) == tolower(ch2)); + + return(ch1 - ch2); +} + +int +strncasecmp(const char *s1, const char *s2, int len) +{ + register int ch1, ch2; + + if (s1==s2) + return 0; /* strings are equal if same object. */ + else if (!s1) + return -1; + else if (!s2) + return 1; + do + { + ch1 = *s1; + ch2 = *s2; + s1++; + s2++; + } while (len-- && ch1 != 0 && tolower(ch1) == tolower(ch2)); + + return(ch1 - ch2); +} + +int +gettimeofday(struct timeval *tv, struct timezone *) +{ + SYSTEMTIME now; + FILETIME tmp; + GetSystemTime(&now); + + if (tv == NULL) return -1; + if (!SystemTimeToFileTime(&now, &tmp)) return -1; + + int64_t _100nsec = tmp.dwHighDateTime; + _100nsec <<= 32; + _100nsec |= tmp.dwLowDateTime; + _100nsec -= (3234336I64*3600I64 * 10000000I64); + tv->tv_sec =(long) (_100nsec / 10000000); + tv->tv_usec = (long) ((_100nsec % 10000000)/10); + return 0; + +} + +int +syslog(int, const char *, const char *) +{ + return 0; +} + +struct passwd * +getpwuid(uid_t) +{ + return NULL; +} +struct group * +getgrgid(uid_t) +{ + return NULL; +} + + +// implement opendir/readdir/closedir on top of window's API +typedef struct _dir +{ + WIN32_FIND_DATA data; // window's file info + const char *spec; // the directory we're traversing + HANDLE dirh; // the search handle + BOOL valid; // the info in data field is valid + UINT32 offset; // pseudo offset for d_off +} _dir; + +DIR * +opendir(const char *path) +{ + _dir *rval = NULL; + if (path == NULL) return NULL; + + rval = (_dir *)malloc(sizeof(_dir)); + if (rval == NULL) return NULL; + char *tspec = (char *)malloc(strlen(path)+16); + if (tspec == NULL) goto err1; + + if (g_platform_id != VER_PLATFORM_WIN32_WINDOWS) { + // allow path to be 32767 bytes + tspec[0] = '\\'; + tspec[1] = '\\'; + tspec[2] = '?'; + tspec[3] = '\\'; + tspec[4] = 0; + cygwin_conv_to_win32_path(path, tspec+4); + } + else { + cygwin_conv_to_win32_path(path, tspec); + } + strcat(tspec, "\\*"); + rval->spec = tspec; + + rval->dirh = FindFirstFile(rval->spec, &rval->data); + d_msg(__FILE__, __LINE__, + 99, "opendir(%s)\n\tspec=%s,\n\tFindFirstFile returns %d\n", + path, rval->spec, rval->dirh); + + rval->offset = 0; + if (rval->dirh == INVALID_HANDLE_VALUE) + goto err; + rval->valid = 1; + d_msg(__FILE__, __LINE__, + 99, "\tFirstFile=%s\n", rval->data.cFileName); + return (DIR *)rval; +err: + free((void *)rval->spec); +err1: + free(rval); + return NULL; +} + +int +closedir(DIR *dirp) +{ + _dir *dp = (_dir *)dirp; + FindClose(dp->dirh); + free((void *)dp->spec); + free((void *)dp); + return 0; +} + +/* + typedef struct _WIN32_FIND_DATA { + DWORD dwFileAttributes; + FILETIME ftCreationTime; + FILETIME ftLastAccessTime; + FILETIME ftLastWriteTime; + DWORD nFileSizeHigh; + DWORD nFileSizeLow; + DWORD dwReserved0; + DWORD dwReserved1; + TCHAR cFileName[MAX_PATH]; + TCHAR cAlternateFileName[14]; +} WIN32_FIND_DATA, *PWIN32_FIND_DATA; +*/ + +static int +copyin(struct dirent &dp, const char *fname) +{ + dp.d_ino = 0; + dp.d_reclen = 0; + char *cp = dp.d_name; + while (*fname) { + *cp++ = *fname++; + dp.d_reclen++; + } + *cp = 0; + return dp.d_reclen; +} +int +readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) +{ + + _dir *dp = (_dir *)dirp; + if (dp->valid) { + entry->d_off = dp->offset; + dp->offset += copyin(*entry, dp->data.cFileName); + d_msg(__FILE__, __LINE__, + 99, "readdir_r(%p, { d_name=\"%s\", d_reclen=%d, d_off=%d\n", + dirp, entry->d_name, entry->d_reclen, entry->d_off); + } + else + return -1; + dp->valid = FindNextFile(dp->dirh, &dp->data); + return 0; +} + + +int +inet_aton(const char *a, struct in_addr *inp) +{ + + const char *cp = a; + uint32_t acc = 0, tmp = 0; + int dotc = 0; + if (!isdigit(*a)) return 0; + while (*cp) { + if (isdigit(*cp)) + tmp = (tmp * 10) + (*cp -'0'); + else if (*cp == '.') { + if (tmp > 255) return 0; + acc = (acc << 8) + tmp; + dotc++; + } + else return 0; + } + + if (dotc != 3) return 0; + inp->s_addr = acc; + return 1; +} + +int +nanosleep(const struct timespec *req, struct timespec *rem) +{ + if (rem) + rem->tv_sec = rem->tv_nsec = 0; + Sleep((req->tv_sec * 1000) + (req->tv_nsec/100000)); + return 0; +} + +void +init_signals(void terminate(int sig)) +{ + +} + +void +init_stack_dump(void) +{ + +} + + +long +pathconf(const char *path, int name) +{ + switch(name) { + case _PC_PATH_MAX : + if (strncmp(path, "\\\\?\\", 4) == 0) + return 32767; + case _PC_NAME_MAX : + return 255; + } + + return -1; +} + +int +WSA_Init(void) +{ + WORD wVersionRequested = MAKEWORD( 1, 1); + WSADATA wsaData; + + int err = WSAStartup(wVersionRequested, &wsaData); + + + if (err != 0) + { + printf("Can not start Windows Sockets\n"); + return -1; + } + + return 0; +} + + +int +win32_chdir(const char *dir) +{ + if (0 == SetCurrentDirectory(dir)) return -1; + return 0; +} + +char * +win32_getcwd(char *buf, int maxlen) +{ + int n = GetCurrentDirectory(maxlen, buf); + + if (n == 0 || n > maxlen) return NULL; + + if (n+1 > maxlen) return NULL; + if (n != 3) { + buf[n] = '\\'; + buf[n+1] = 0; + } + + return buf; +} + +#include "mswinver.h" + +char WIN_VERSION_LONG[64]; +char WIN_VERSION[32]; + +class winver { +public: + winver(void); +}; + +static winver INIT; // cause constructor to be called before main() + +winver::winver(void) +{ + const char *version = ""; + const char *platform = ""; + OSVERSIONINFO osvinfo; + osvinfo.dwOSVersionInfoSize = sizeof(osvinfo); + + // Get the current OS version + if (!GetVersionEx(&osvinfo)) { + version = "Unknown"; + platform = "Unknown"; + } + else + switch (_mkversion(osvinfo.dwPlatformId, osvinfo.dwMajorVersion, osvinfo.dwMinorVersion)) + { + case MS_WINDOWS_95: (version = "Windows 95"); break; + case MS_WINDOWS_98: (version = "Windows 98"); break; + case MS_WINDOWS_ME: (version = "Windows ME"); break; + case MS_WINDOWS_NT4:(version = "Windows NT 4.0"); platform = "NT"; break; + case MS_WINDOWS_2K: (version = "Windows 2000");platform = "NT"; break; + case MS_WINDOWS_XP: (version = "Windows XP");platform = "NT"; break; + case MS_WINDOWS_S2003: (version = "Windows Server 2003");platform = "NT"; break; + } + + strcpy(WIN_VERSION_LONG, version); + snprintf(WIN_VERSION, sizeof(WIN_VERSION), "%s %d.%d.%d", + platform, osvinfo.dwMajorVersion, osvinfo.dwMinorVersion, osvinfo.dwBuildNumber); + +} + + + + + +#define BUFSIZE 4096 + +HANDLE hChildStdinRd, hChildStdinWr, hChildStdinWrDup, + hChildStdoutRd, hChildStdoutWr, hChildStdoutRdDup, + hInputFile, hSaveStdin, hSaveStdout; + +BOOL CreateChildProcess(VOID); +VOID WriteToPipe(VOID); +VOID ReadFromPipe(VOID); +VOID ErrorExit(LPTSTR); +VOID ErrMsg(LPTSTR, BOOL); + + +const char *getArgv0(const char *cmdline) +{ + const char *cp = cmdline; + + while (*cp && !isspace(*cp)) cp++; + + int len = cp - cmdline; + char *rval = (char *)malloc(len+1); + + cp = cmdline; + while (len--) + *rval++ = *cp++; + + *rval = 0; + return rval; +} + +HANDLE +CreateChildProcess(const char *cmdline) +{ + PROCESS_INFORMATION piProcInfo; + STARTUPINFO siStartInfo; + BOOL bFuncRetn = FALSE; + +// Set up members of the PROCESS_INFORMATION structure. + + ZeroMemory( &piProcInfo, sizeof(PROCESS_INFORMATION) ); + +// Set up members of the STARTUPINFO structure. + + ZeroMemory( &siStartInfo, sizeof(STARTUPINFO) ); + siStartInfo.cb = sizeof(STARTUPINFO); + +// Create the child process. + + const char *exeName = getArgv0(cmdline); + if (exeName[1] != ':' + || (strchr(cmdline, '/') == NULL + && strchr(cmdline, '\\') == NULL)) + { + char buf[1024]; + char *file; + DWORD rval = SearchPath(NULL, + exeName, + ".exe", + sizeof(buf), + buf, + &file); + if (rval == 0) + return INVALID_HANDLE_VALUE; + if (rval > sizeof(buf)) + return INVALID_HANDLE_VALUE; + free((void *)exeName); + exeName = strdup(buf); + } + + char *cmdLine = strdup(cmdline); + + bFuncRetn = CreateProcess(exeName, + cmdLine, // command line + NULL, // process security attributes + NULL, // primary thread security attributes + TRUE, // handles are inherited + 0, // creation flags + NULL, // use parent's environment + NULL, // use parent's current directory + &siStartInfo, // STARTUPINFO pointer + &piProcInfo); // receives PROCESS_INFORMATION + free((void *)exeName); + free((void *)cmdLine); + + if (bFuncRetn == 0) { + ErrorExit("CreateProcess failed\n"); + return INVALID_HANDLE_VALUE; + } + + CloseHandle(piProcInfo.hThread); + return piProcInfo.hProcess; +} + + +void +ErrorExit (LPTSTR lpszMessage) +{ + d_msg(__FILE__, __LINE__, 0, "%s", lpszMessage); +} + + +/* +typedef struct s_bpipe { + pid_t worker_pid; + time_t worker_stime; + int wait; + btimer_t *timer_id; + FILE *rfd; + FILE *wfd; +} BPIPE; +*/ + +#include "bacula.h" +#include "jcr.h" +extern "C" { +int __cdecl _open_osfhandle(long, int); +} +BPIPE * +open_bpipe(char *prog, int wait, char *mode) +{ + HANDLE hChildStdinRd, hChildStdinWr, hChildStdinWrDup, + hChildStdoutRd, hChildStdoutWr, hChildStdoutRdDup, + hInputFile, hSaveStdin, hSaveStdout; + + + SECURITY_ATTRIBUTES saAttr; + BOOL fSuccess; + + hChildStdinRd = hChildStdinWr = hChildStdinWrDup = + hChildStdoutRd = hChildStdoutWr = hChildStdoutRdDup = + hInputFile = hSaveStdin = hSaveStdout = INVALID_HANDLE_VALUE; + + BPIPE *bpipe = (BPIPE *)malloc(sizeof(BPIPE)); + memset((void *)bpipe, 0, sizeof(BPIPE)); + + int mode_read = (mode[0] == 'r'); + int mode_write = (mode[0] == 'w' || mode[1] == 'w'); + + + // Set the bInheritHandle flag so pipe handles are inherited. + + saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); + saAttr.bInheritHandle = TRUE; + saAttr.lpSecurityDescriptor = NULL; + + // Save the handle to the current STDOUT. + hSaveStdout = GetStdHandle(STD_OUTPUT_HANDLE); + + + if (mode_read) { + // Create a pipe for the child process's STDOUT. + if (! CreatePipe(&hChildStdoutRd, &hChildStdoutWr, &saAttr, 0)) { + ErrorExit("Stdout pipe creation failed\n"); + goto cleanup; + } + + // Set a write handle to the pipe to be STDOUT. + if (! SetStdHandle(STD_OUTPUT_HANDLE, hChildStdoutWr)) + { + ErrorExit("Redirecting STDOUT failed"); + goto cleanup; + } + // Create noninheritable read handle and close the inheritable read + // handle. + + fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdoutRd, + GetCurrentProcess(), &hChildStdoutRdDup , 0, + FALSE, + DUPLICATE_SAME_ACCESS); + if( !fSuccess ) { + ErrorExit("DuplicateHandle failed"); + goto cleanup; + } + + CloseHandle(hChildStdoutRd); + } + + if (mode_write) { +// Save the handle to the current STDIN. + + hSaveStdin = GetStdHandle(STD_INPUT_HANDLE); + +// Create a pipe for the child process's STDIN. + + if (! CreatePipe(&hChildStdinRd, &hChildStdinWr, &saAttr, 0)) { + ErrorExit("Stdin pipe creation failed\n"); + goto cleanup; + } + +// Set a read handle to the pipe to be STDIN. + + if (! SetStdHandle(STD_INPUT_HANDLE, hChildStdinRd)) { + ErrorExit("Redirecting Stdin failed"); + goto cleanup; + } + +// Duplicate the write handle to the pipe so it is not inherited. + + fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdinWr, + GetCurrentProcess(), &hChildStdinWrDup, 0, + FALSE, // not inherited + DUPLICATE_SAME_ACCESS); + if (!fSuccess) { + ErrorExit("DuplicateHandle failed"); + goto cleanup; + } + + CloseHandle(hChildStdinWr); + } + + bpipe->worker_pid = (pid_t)CreateChildProcess(prog); + + bpipe->wait = wait; + bpipe->worker_stime = time(NULL); + + if (mode_read) { + SetStdHandle(STD_OUTPUT_HANDLE, hSaveStdout); + int rfd = _open_osfhandle((long)hChildStdoutRdDup, O_RDONLY); + bpipe->rfd = fdopen(rfd, "r"); + } + if (mode_write) { + SetStdHandle(STD_INPUT_HANDLE, hSaveStdin); + int wfd = _open_osfhandle((long)hChildStdinWrDup, O_WRONLY); + bpipe->wfd = fdopen(wfd, "w"); + } + + if (wait > 0) { + bpipe->timer_id = start_child_timer(bpipe->worker_pid, wait); + } + + + return bpipe; + +cleanup: + free((void *) bpipe); + return NULL; +} + +int kill(int pid, int signal) +{ + int rval = 0; + if (!TerminateProcess((HANDLE)pid, (UINT) signal)) + rval = -1; + + CloseHandle((HANDLE)pid); + return rval; +} + +int close_bpipe(BPIPE *bpipe) +{ + + return 0; +} + +int close_wpipe(BPIPE *bpipe) +{ + + return 0; +} diff --git a/bacula/src/win32/compat/compat.h b/bacula/src/win32/compat/compat.h new file mode 100644 index 0000000000..443a67452c --- /dev/null +++ b/bacula/src/win32/compat/compat.h @@ -0,0 +1,292 @@ +/* -*- Mode: C -*- + * compat.h -- +// Copyright (C)2004 Raider Solutions, Inc. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation; either version 2 of +// the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public +// License along with this program; if not, write to the Free +// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +// MA 02111-1307, USA. + * + * + * Author : Christopher S. Hull + * Created On : Fri Jan 30 13:00:51 2004 + * Last Modified By: Christopher S. Hull + * Last Modified On: Mon Feb 9 12:08:07 2004 + * Update Count : 201 + * $Id$ + */ + + +#ifndef __COMPAT_H_ +#define __COMPAT_H_ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "getopt.h" + +#ifdef HAVE_CYGWIN +#error should not be used under cygwin... +#else +#define HAVE_WIN32 1 +#endif +typedef UINT64 u_int64_t; +typedef UINT64 uint64_t; +typedef INT64 int64_t; +typedef UINT32 uint32_t; +typedef long int32_t; +typedef INT64 intmax_t; +typedef unsigned char uint8_t; +typedef float float32_t; +typedef unsigned short uint16_t; +typedef signed short int16_t; +typedef long time_t; +typedef long _off_t; +typedef signed char int8_t; +typedef int BOOL; +#define bool BOOL +typedef double float64_t; + +typedef UINT32 u_int32_t; +typedef unsigned char u_int8_t; +typedef unsigned short u_int16_t; + +#undef uint32_t + +void sleep(int); + +typedef UINT32 key_t; +typedef UINT32 uid_t; +typedef UINT32 gid_t; +typedef UINT32 mode_t; +typedef UINT32 ssize_t; + + +typedef void DIR; + + +struct dirent { + uint64_t d_ino; + uint32_t d_off; + uint16_t d_reclen; + char d_name[256]; +}; + +#ifndef __cplusplus +#ifndef true +#define true 1 +#endif +#ifndef false +#define false 0 +#endif +#endif + +struct timezone { + int foo; +}; + +int strcasecmp(const char*, const char *); +int strncasecmp(const char*, const char *, int); +int gettimeofday(struct timeval *, struct timezone *); + +#define ETIMEDOUT 55 + +struct stat +{ + _dev_t st_dev; + uint64_t st_ino; + uint16_t st_mode; + int16_t st_nlink; + uint32_t st_uid; + uint32_t st_gid; + _dev_t st_rdev; + uint64_t st_size; + time_t st_atime; + time_t st_mtime; + time_t st_ctime; + uint32_t st_blksize; + uint64_t st_blocks; +}; + +#define S_IFMT 0170000 /* file type mask */ +#define S_IFDIR 0040000 /* directory */ +#define S_IFCHR 0020000 /* character special */ +#define S_IFIFO 0010000 /* pipe */ +#define S_IFREG 0100000 /* regular */ +#define S_IREAD 0000400 /* read permission, owner */ +#define S_IWRITE 0000200 /* write permission, owner */ +#define S_IEXEC 0000100 /* execute/search permission, owner */ + +#define S_IRUSR S_IREAD +#define S_IWUSR S_IWRITE +#define S_IXUSR S_IEXEC + +#define S_IRGRP 000040 +#define S_IWGRP 000020 +#define S_IXGRP 000010 + +#define S_IROTH 00004 +#define S_IWOTH 00002 +#define S_IXOTH 00001 + +#define S_IRWXO 000007 +#define S_IRWXG 000070 +#define S_ISUID 004000 +#define S_ISGID 002000 +#define S_ISVTX 001000 + + +#define S_ISREG(x) (((x) & S_IFREG) == S_IFREG) +#define S_ISDIR(x) (((x) & S_IFDIR) == S_IFDIR) +#define S_ISCHR(x) 0 +#define S_ISBLK(x) 0 +#define S_ISFIFO(x) 0 +#define S_ISSOCK(x) 0 +#define S_ISLNK(x) 0 + +#define SIGUSR2 9999 + +int umask(int); +int lchown(const char *, uid_t uid, gid_t gid); +int chown(const char *, uid_t uid, gid_t gid); +int chmod(const char *, mode_t mode); +int utime(const char *filename, struct utimbuf *buf); +int open(const char *, int, int); +int lseek(int, int, int); +int read(int fd, void *, int32_t nbytes); +int write(int fd, const void *, int32_t nbytes); +int close(int fd); +int inet_aton(const char *cp, struct in_addr *inp); +int kill(int pid, int signo); +int pipe(int []); +int fork(); +int dup2(int, int); +int waitpid(int, int *, int); +#define WNOHANG 0 +#define WIFEXITED(x) 0 +#define WEXITSTATUS(x) x +#define WIFSIGNALED(x) 0 + +#define SIGKILL 9 + +#define HAVE_OLD_SOCKOPT + + +#define vsnprintf __vsnprintf +int __vsnprintf(char *s, size_t count, const char *format, va_list args); + +#define vsprintf __vsprintf +int __vsprintf(char *s, const char *format, va_list args); + +#define snprintf __snprintf +int __snprintf(char *str, size_t count, const char *fmt, ...); + +#define sprintf __sprintf +int __sprintf(char *str, const char *fmt, ...); + + +int readdir(unsigned int fd, struct dirent *dirp, unsigned int count); +int nanosleep(const struct timespec*, struct timespec *); + +struct tm *localtime_r(const time_t *, struct tm *); +struct tm *gmtime_r(const time_t *, struct tm *); +long int random(void); +void srandom(unsigned int seed); +int lstat(const char *, struct stat *); +long pathconf(const char *, int); +int readlink(const char *, char *, int); +#define _PC_PATH_MAX 1 +#define _PC_NAME_MAX 2 + + + +int geteuid(); +DIR *opendir(const char *name); +int closedir(DIR *dir); + +struct passwd { + char *foo; +}; + +struct group { + char *foo; +}; + +struct passwd *getpwuid(uid_t); +struct group *getgrgid(uid_t); + +#define R_OK 04 +#define W_OK 02 + + +struct sigaction { + int sa_flags; + void (*sa_handler)(int); +}; +#define sigfillset(x) +#define sigaction(a, b, c) + +#define mkdir(p, m) _mkdir(p) +#define chdir win32_chdir + +int stat(const char *, struct stat *); +int syslog(int, const char *, const char *); +#define LOG_DAEMON 0 +#define LOG_ERR 0 + +#ifdef __cplusplus +#define access _access +extern "C" _CRTIMP int __cdecl _access(const char *, int); +int execvp(const char *, char *[]); +extern "C" void * __cdecl _alloca(size_t); +#endif + +#define getpid _getpid + +#define getppid() 0 +#define gethostid() 0 +#define getuid() 0 +#define getgid() 0 + +#define getcwd win32_getcwd +#define chdir win32_chdir +char *win32_getcwd(char *buf, int maxlen); +int win32_chdir(const char *buf); + +int WSA_Init(void); + +#endif /* __COMPAT_H_ */ + diff --git a/bacula/src/win32/compat/dirent.h b/bacula/src/win32/compat/dirent.h new file mode 100644 index 0000000000..7273fef6de --- /dev/null +++ b/bacula/src/win32/compat/dirent.h @@ -0,0 +1 @@ +#include "compat.h" diff --git a/bacula/src/win32/compat/getopt.c b/bacula/src/win32/compat/getopt.c new file mode 100644 index 0000000000..566b8ef97e --- /dev/null +++ b/bacula/src/win32/compat/getopt.c @@ -0,0 +1,736 @@ +/* Getopt for GNU. + NOTE: getopt is now part of the C library, so if you don't know what + "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu + before changing it! + + Copyright (C) 1987, 88, 89, 90, 91, 92, 1993 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* NOTE!!! AIX requires this to be the first thing in the file. + Do not put ANYTHING before it! */ +#if !defined (__GNUC__) && defined (_AIX) + #pragma alloca +#endif + +#include //for strncmp +#if defined (WIN32) +#include +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef __GNUC__ +#define alloca __builtin_alloca +#else /* not __GNUC__ */ +#if defined (HAVE_ALLOCA_H) || (defined(sparc) && (defined(sun) || (!defined(USG) && !defined(SVR4) && !defined(__svr4__)))) +#include +#else +#if !defined (_AIX) && !defined (WIN32) +char *alloca (); +#endif +#endif /* alloca.h */ +#endif /* not __GNUC__ */ + +#if !__STDC__ && !defined(const) && IN_GCC +#define const +#endif + +/* This tells Alpha OSF/1 not to define a getopt prototype in . */ +#ifndef _NO_PROTO +#define _NO_PROTO +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#if defined (_LIBC) || !defined (__GNU_LIBRARY__) + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#undef alloca +/* Don't include stdlib.h for non-GNU C libraries because some of them + contain conflicting prototypes for getopt. */ +#include +#else /* Not GNU C library. */ +#define __alloca alloca +#endif /* GNU C library. */ + +/* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a + long-named option. Because this is not POSIX.2 compliant, it is + being phased out. */ +/* #define GETOPT_COMPAT */ + +/* This version of `getopt' appears to the caller like standard Unix `getopt' + but it behaves differently for the user, since it allows the user + to intersperse the options with the other arguments. + + As `getopt' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Setting the environment variable POSIXLY_CORRECT disables permutation. + Then the behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt.h" + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg = 0; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* XXX 1003.2 says this must be 1 before any call. */ +int optind = 0; + +/* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + +static char *nextchar; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters. + + PERMUTE is the default. We permute the contents of ARGV as we scan, + so that eventually all the non-options are at the end. This allows options + to be given in any order, even with programs that were not written to + expect this. + + RETURN_IN_ORDER is an option available to programs that were written + to expect options and other ARGV-elements in any order and that care about + the ordering of the two. We describe each non-option ARGV-element + as if it were the argument of an option with character code 1. + Using `-' as the first character of the list of option characters + selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return EOF with `optind' != ARGC. */ + +static enum +{ + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER +} ordering; + +#ifdef __GNU_LIBRARY__ +/* We want to avoid inclusion of string.h with non-GNU libraries + because there are many ways it can cause trouble. + On some systems, it contains special magic macros that don't work + in GCC. */ +#include +#define my_index strchr +#define my_bcopy(src, dst, n) memcpy ((dst), (src), (n)) +#else + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +char *getenv (); + +static char * +my_index (str, chr) + const char *str; + int chr; +{ + while (*str) + { + if (*str == chr) + return (char *) str; + str++; + } + return 0; +} + +static void +my_bcopy (from, to, size) + const char *from; + char *to; + int size; +{ + int i; + for (i = 0; i < size; i++) + to[i] = from[i]; +} +#endif /* GNU C library. */ + +/* Handle permutation of arguments. */ + +/* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first of them; + `last_nonopt' is the index after the last of them. */ + +static int first_nonopt; +static int last_nonopt; + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +static void +exchange (argv) + char **argv; +{ + int nonopts_size = (last_nonopt - first_nonopt) * sizeof (char *); + char **temp = (char **) __alloca (nonopts_size); + + /* Interchange the two blocks of data in ARGV. */ + + my_bcopy ((char *) &argv[first_nonopt], (char *) temp, nonopts_size); + my_bcopy ((char *) &argv[last_nonopt], (char *) &argv[first_nonopt], + (optind - last_nonopt) * sizeof (char *)); + my_bcopy ((char *) temp, + (char *) &argv[first_nonopt + optind - last_nonopt], + nonopts_size); + + /* Update records for the slots the non-options now occupy. */ + + first_nonopt += (optind - last_nonopt); + last_nonopt = optind; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns `EOF'. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + The elements of ARGV aren't really const, because we permute them. + But we pretend they're const in the prototype to be compatible + with other systems. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. */ + +int +_getopt_internal (argc, argv, optstring, longopts, longind, long_only) + int argc; + char *const *argv; + const char *optstring; + const struct option *longopts; + int *longind; + int long_only; +{ + int option_index; + + optarg = 0; + + /* Initialize the internal data when the first call is made. + Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + if (optind == 0) + { + first_nonopt = last_nonopt = optind = 1; + + nextchar = NULL; + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } + else if (getenv ("POSIXLY_CORRECT") != NULL) + ordering = REQUIRE_ORDER; + else + ordering = PERMUTE; + } + + if (nextchar == NULL || *nextchar == '\0') + { + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Now skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc + && (argv[optind][0] != '-' || argv[optind][1] == '\0') +#ifdef GETOPT_COMPAT + && (longopts == NULL + || argv[optind][0] != '+' || argv[optind][1] == '\0') +#endif /* GETOPT_COMPAT */ + ) + optind++; + last_nonopt = optind; + } + + /* Special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return EOF; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if ((argv[optind][0] != '-' || argv[optind][1] == '\0') +#ifdef GETOPT_COMPAT + && (longopts == NULL + || argv[optind][0] != '+' || argv[optind][1] == '\0') +#endif /* GETOPT_COMPAT */ + ) + { + if (ordering == REQUIRE_ORDER) + return EOF; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Start decoding its characters. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[optind][1] == '-')); + } + + if (longopts != NULL + && ((argv[optind][0] == '-' + && (argv[optind][1] == '-' || long_only)) +#ifdef GETOPT_COMPAT + || argv[optind][0] == '+' +#endif /* GETOPT_COMPAT */ + )) + { + const struct option *p; + char *s = nextchar; + int exact = 0; + int ambig = 0; + const struct option *pfound = NULL; + int indfound = 0 ; + + while (*s && *s != '=') + s++; + + /* Test all options for either exact match or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; + p++, option_index++) + if (!strncmp (p->name, nextchar, s - nextchar)) + { + if ((size_t)(s - nextchar) == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, "%s: option `%s' is ambiguous\n", + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + optind++; + if (*s) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = s + 1; + else + { + if (opterr) + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + "%s: option `--%s' doesn't allow an argument\n", + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + "%s: option `%c%s' doesn't allow an argument\n", + argv[0], argv[optind - 1][0], pfound->name); + } + nextchar += strlen (nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, "%s: option `%s' requires an argument\n", + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[optind][1] == '-' +#ifdef GETOPT_COMPAT + || argv[optind][0] == '+' +#endif /* GETOPT_COMPAT */ + || my_index (optstring, *nextchar) == NULL) + { + if (opterr) + { + if (argv[optind][1] == '-') + /* --option */ + fprintf (stderr, "%s: unrecognized option `--%s'\n", + argv[0], nextchar); + else + /* +option or -option */ + fprintf (stderr, "%s: unrecognized option `%c%s'\n", + argv[0], argv[optind][0], nextchar); + } + nextchar = (char *) ""; + optind++; + return '?'; + } + } + + /* Look at and handle the next option-character. */ + + { + char c = *nextchar++; + char *temp = my_index (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (opterr) + { +#if 0 + if (c < 040 || c >= 0177) + fprintf (stderr, "%s: unrecognized option, character code 0%o\n", + argv[0], c); + else + fprintf (stderr, "%s: unrecognized option `-%c'\n", argv[0], c); +#else + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c); +#endif + } + optopt = c; + return '?'; + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; + optind++; + } + else + optarg = 0; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { +#if 0 + fprintf (stderr, "%s: option `-%c' requires an argument\n", + argv[0], c); +#else + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, "%s: option requires an argument -- %c\n", + argv[0], c); +#endif + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } +} + +int +getopt (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + return _getopt_internal (argc, argv, optstring, + (const struct option *) 0, + (int *) 0, + 0); +} + +#endif /* _LIBC or not __GNU_LIBRARY__. */ + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == EOF) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/bacula/src/win32/compat/getopt.h b/bacula/src/win32/compat/getopt.h new file mode 100644 index 0000000000..78318e746a --- /dev/null +++ b/bacula/src/win32/compat/getopt.h @@ -0,0 +1,114 @@ +/* Declarations for getopt. + Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef _GETOPT_H +#define _GETOPT_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +#if __STDC__ + const char *name; +#else + char *name; +#endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +extern int getopt (int argc, char *const *argv, const char *shortopts); +extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +extern int getopt_long_only (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind, + int long_only); + +#ifdef __cplusplus +} +#endif + +#endif /* _GETOPT_H */ diff --git a/bacula/src/win32/compat/grp.h b/bacula/src/win32/compat/grp.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bacula/src/win32/compat/mswinver.h b/bacula/src/win32/compat/mswinver.h new file mode 100644 index 0000000000..c30ecdc650 --- /dev/null +++ b/bacula/src/win32/compat/mswinver.h @@ -0,0 +1,37 @@ +#ifndef __MSWINVER_H_ +#define __MSWINVER_H_ + +#include "winbase.h" + +#define MS_MAJOR_WINDOWS_3 3 +#define MS_MAJOR_WINDOWS_95 4 +#define MS_MAJOR_WINDOWS_98 4 +#define MS_MAJOR_WINDOWS_ME 4 +#define MS_MAJOR_WINDOWS_NT4 4 +#define MS_MAJOR_WINDOWS_2K 5 +#define MS_MAJOR_WINDOWS_XP 5 +#define MS_MAJOR_WINDOWS_S2003 5 + + +#define MS_MINOR_WINDOWS_3 51 +#define MS_MINOR_WINDOWS_95 0 +#define MS_MINOR_WINDOWS_98 10 +#define MS_MINOR_WINDOWS_ME 90 +#define MS_MINOR_WINDOWS_NT4 0 +#define MS_MINOR_WINDOWS_2K 0 +#define MS_MINOR_WINDOWS_XP 1 +#define MS_MINOR_WINDOWS_S2003 2 + + +#define _mkversion(p, m, r) (((p)<<24)|((m)<<8)|(r)) + +#define MS_WINDOWS_95 _mkversion(VER_PLATFORM_WIN32_WINDOWS, MS_MAJOR_WINDOWS_95, MS_MINOR_WINDOWS_95) +#define MS_WINDOWS_98 _mkversion(VER_PLATFORM_WIN32_WINDOWS, MS_MAJOR_WINDOWS_98, MS_MINOR_WINDOWS_98) +#define MS_WINDOWS_ME _mkversion(VER_PLATFORM_WIN32_WINDOWS, MS_MAJOR_WINDOWS_ME, MS_MINOR_WINDOWS_ME) +#define MS_WINDOWS_NT4 _mkversion(VER_PLATFORM_WIN32_NT, MS_MAJOR_WINDOWS_NT4, MS_MINOR_WINDOWS_NT4) +#define MS_WINDOWS_2K _mkversion(VER_PLATFORM_WIN32_NT, MS_MAJOR_WINDOWS_2K, MS_MINOR_WINDOWS_2K) +#define MS_WINDOWS_XP _mkversion(VER_PLATFORM_WIN32_NT, MS_MAJOR_WINDOWS_XP, MS_MINOR_WINDOWS_XP) +#define MS_WINDOWS_S2003 _mkversion(VER_PLATFORM_WIN32_NT, MS_MAJOR_WINDOWS_S2003, MS_MINOR_WINDOWS_S2003) + + +#endif diff --git a/bacula/src/win32/compat/netdb.h b/bacula/src/win32/compat/netdb.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bacula/src/win32/compat/netinet/in.h b/bacula/src/win32/compat/netinet/in.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bacula/src/win32/compat/print.cpp b/bacula/src/win32/compat/print.cpp new file mode 100644 index 0000000000..789cf2d0d0 --- /dev/null +++ b/bacula/src/win32/compat/print.cpp @@ -0,0 +1,736 @@ +/************************************************************** + * Original: + * Patrick Powell Tue Apr 11 09:48:21 PDT 1995 + * A bombproof version of doprnt(dopr) included. + * Sigh. This sort of thing is always nasty do deal with. Note that + * the version here does not include floating point... + * + * snprintf() is used instead of sprintf() as it does limit checks + * for string length. This covers a nasty loophole. + * + * The other functions are there to prevent NULL pointers from + * causing nast effects. + * + * More Recently: + * Brandon Long 9/15/96 for mutt 0.43 + * This was ugly. It is still ugly. I opted out of floating point + * numbers, but the formatter understands just about everything + * from the normal C string format, at least as far as I can tell from + * the Solaris 2.5 printf(3S) man page. + * + * Brandon Long 10/22/97 for mutt 0.87.1 + * Ok, added some minimal floating point support, which means this + * probably requires libm on most operating systems. Don't yet + * support the exponent(e, E) and sigfig(g, G). Also, fmtint() + * was pretty badly broken, it just wasn't being exercised in ways + * which showed it, so that's been fixed. Also, formated the code + * to mutt conventions, and removed dead code left over from the + * original. Also, there is now a builtin-test, just compile with: + * gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm + * and run snprintf for results. + * + * Thomas Roessler 01/27/98 for mutt 0.89i + * The PGP code was using unsigned hexadecimal formats. + * Unfortunately, unsigned formats simply didn't work. + * + * Michael Elkins 03/05/98 for mutt 0.90.8 + * The original code assumed that both snprintf() and vsnprintf() were + * missing. Some systems only have snprintf() but not vsnprintf(), so + * the code is now broken down under HAVE_SNPRINTF and HAVE_VSNPRINTF. + * + * Ben Lindstrom 09/27/00 for OpenSSH + * Welcome to the world of %lld and %qd support. With other + * long long support. This is needed for sftp-server to work + * right. + * + * Ben Lindstrom 02/12/01 for OpenSSH + * Removed all hint of VARARGS stuff and banished it to the void, + * and did a bit of KNF style work to make things a bit more + * acceptable. Consider stealing from mutt or enlightenment. + **************************************************************/ + +#include "compat.h" + +typedef void (prfun)(char *, size_t *, size_t, int); + +int +dopr(char *buffer, size_t maxlen, const char *format, va_list args, prfun); + + +static void +fmtstr(char *buffer, size_t *currlen, size_t maxlen, char *value, int flags, + int min, int max, prfun); + +static void +fmtint(char *buffer, size_t *currlen, size_t maxlen, INT64 value, int base, + int min, int max, int flags, prfun); + +static void +fmtfp(char *buffer, size_t *currlen, size_t maxlen, long double fvalue, + int min, int max, int flags, prfun); + +static void +dopr_outch(char *buffer, size_t *currlen, size_t maxlen, int c); + +/* + * dopr(): poor man's version of doprintf + */ + +#define MAX(a,b) ((a)>(b)?(a):(b)) + +/* format read states */ +#define DP_S_DEFAULT 0 +#define DP_S_FLAGS 1 +#define DP_S_MIN 2 +#define DP_S_DOT 3 +#define DP_S_MAX 4 +#define DP_S_MOD 5 +#define DP_S_CONV 6 +#define DP_S_DONE 7 + +/* format flags - Bits */ +#define DP_F_MINUS (1 << 0) +#define DP_F_PLUS (1 << 1) +#define DP_F_SPACE (1 << 2) +#define DP_F_NUM (1 << 3) +#define DP_F_ZERO (1 << 4) +#define DP_F_UP (1 << 5) +#define DP_F_UNSIGNED (1 << 6) + +/* Conversion Flags */ +#define DP_C_SHORT 1 +#define DP_C_LONG 2 +#define DP_C_LDOUBLE 3 +#define DP_C_LONG_LONG 4 + +#define char_to_int(p) (p - '0') +#define abs_val(p) (p < 0 ? -p : p) + +static const char digitval[] = "0123456789abcdef0123456789ABCDEF"; + +int +dopr(char *buffer, size_t maxlen, const char *format, va_list args, prfun outch) +{ + char *strvalue; + char ch; + INT64 value; + long double fvalue; + int min = 0; + int max = -1; + int state = DP_S_DEFAULT; + int flags = 0; + int cflags = 0; + size_t currlen = 0; + + ch = *format++; + + while (state != DP_S_DONE) + { + if ((ch == '\0') || (currlen >= maxlen)) + state = DP_S_DONE; + + switch (state) + { + case DP_S_DEFAULT: + if (ch == '%') + state = DP_S_FLAGS; + else + outch(buffer, &currlen, maxlen, ch); + ch = *format++; + break; + case DP_S_FLAGS: + switch (ch) + { + case '-': + flags |= DP_F_MINUS; + ch = *format++; + break; + case '+': + flags |= DP_F_PLUS; + ch = *format++; + break; + case ' ': + flags |= DP_F_SPACE; + ch = *format++; + break; + case '#': + flags |= DP_F_NUM; + ch = *format++; + break; + case '0': + flags |= DP_F_ZERO; + ch = *format++; + break; + default: + state = DP_S_MIN; + break; + } + break; + case DP_S_MIN: + if (isdigit((unsigned char)ch)) + { + min = 10*min + char_to_int(ch); + ch = *format++; + } + else if (ch == '*') + { + min = va_arg(args, int); + ch = *format++; + state = DP_S_DOT; + } + else + state = DP_S_DOT; + break; + case DP_S_DOT: + if (ch == '.') + { + state = DP_S_MAX; + ch = *format++; + } + else + state = DP_S_MOD; + break; + case DP_S_MAX: + if (isdigit((unsigned char)ch)) + { + if (max < 0) + max = 0; + max = 10*max + char_to_int(ch); + ch = *format++; + } + else if (ch == '*') + { + max = va_arg(args, int); + ch = *format++; + state = DP_S_MOD; + } + else + state = DP_S_MOD; + break; + case DP_S_MOD: + switch (ch) + { + case 'h': + cflags = DP_C_SHORT; + ch = *format++; + break; + case 'l': + cflags = DP_C_LONG; + ch = *format++; + if (ch == 'l') + { + cflags = DP_C_LONG_LONG; + ch = *format++; + } + break; + case 'q': + cflags = DP_C_LONG_LONG; + ch = *format++; + break; + case 'L': + cflags = DP_C_LDOUBLE; + ch = *format++; + break; + default: + break; + } + state = DP_S_CONV; + break; + case DP_S_CONV: + switch (ch) + { + case 'b': + flags |= DP_F_UNSIGNED; + if (cflags == DP_C_SHORT) + value = va_arg(args, unsigned int); + else if (cflags == DP_C_LONG) + value = va_arg(args, unsigned long int); + else if (cflags == DP_C_LONG_LONG) + value = va_arg(args, UINT64); + else + value = va_arg(args, unsigned int); + fmtint(buffer, &currlen, maxlen, value, 2, min, max, flags, outch); + break; + case 'd': + case 'i': + if (cflags == DP_C_SHORT) + value = va_arg(args, int); + else if (cflags == DP_C_LONG) + value = va_arg(args, long int); + else if (cflags == DP_C_LONG_LONG) + value = va_arg(args, INT64); + else + value = va_arg(args, int); + fmtint(buffer, &currlen, maxlen, value, 10, min, max, flags, outch); + break; + case 'o': + flags |= DP_F_UNSIGNED; + if (cflags == DP_C_SHORT) + value = va_arg(args, unsigned int); + else if (cflags == DP_C_LONG) + value = va_arg(args, unsigned long int); + else if (cflags == DP_C_LONG_LONG) + value = va_arg(args, UINT64); + else + value = va_arg(args, unsigned int); + fmtint(buffer, &currlen, maxlen, value, 8, min, max, flags, outch); + break; + case 'u': + flags |= DP_F_UNSIGNED; + if (cflags == DP_C_SHORT) + value = va_arg(args, unsigned int); + else if (cflags == DP_C_LONG) + value = va_arg(args, unsigned long int); + else if (cflags == DP_C_LONG_LONG) + value = va_arg(args, UINT64); + else + value = va_arg(args, unsigned int); + fmtint(buffer, &currlen, maxlen, value, 10, min, max, flags, outch); + break; + case 'X': + flags |= DP_F_UP; + case 'x': + flags |= DP_F_UNSIGNED; + if (cflags == DP_C_SHORT) + value = va_arg(args, unsigned int); + else if (cflags == DP_C_LONG) + value = va_arg(args, unsigned long int); + else if (cflags == DP_C_LONG_LONG) + value = va_arg(args, UINT64); + else + value = va_arg(args, unsigned int); + fmtint(buffer, &currlen, maxlen, value, 16, min, max, flags, outch); + break; + case 'f': + if (cflags == DP_C_LDOUBLE) + fvalue = va_arg(args, long double); + else + fvalue = va_arg(args, double); + /* um, floating point? */ + fmtfp(buffer, &currlen, maxlen, fvalue, min, max, flags, outch); + break; + case 'E': + flags |= DP_F_UP; + case 'e': + if (cflags == DP_C_LDOUBLE) + fvalue = va_arg(args, long double); + else + fvalue = va_arg(args, double); + break; + case 'G': + flags |= DP_F_UP; + case 'g': + if (cflags == DP_C_LDOUBLE) + fvalue = va_arg(args, long double); + else + fvalue = va_arg(args, double); + break; + case 'c': + outch(buffer, &currlen, maxlen, va_arg(args, int)); + break; + case 's': + strvalue = va_arg(args, char *); + if (max < 0) + max = maxlen; /* ie, no max */ + fmtstr(buffer, &currlen, maxlen, strvalue, flags, min, max, outch); + break; + case 'p': + strvalue = (char *) va_arg(args, void *); + flags |= DP_F_UNSIGNED; + fmtint(buffer, &currlen, maxlen, (long) strvalue, 16, min, max, + flags, outch); + break; + case 'n': + if (cflags == DP_C_SHORT) + { + short int *num; + num = va_arg(args, short int *); + *num = currlen; + } + else if (cflags == DP_C_LONG) + { + long int *num; + num = va_arg(args, long int *); + *num = currlen; + } + else if (cflags == DP_C_LONG_LONG) + { + INT64 *num; + num = va_arg(args, INT64 *); + *num = currlen; + } + else + { + int *num; + num = va_arg(args, int *); + *num = currlen; + } + break; + case '%': + outch(buffer, &currlen, maxlen, ch); + break; + case 'w': /* not supported yet, treat as next char */ + ch = *format++; + break; + default: /* Unknown, skip */ + break; + } + ch = *format++; + state = DP_S_DEFAULT; + flags = cflags = min = 0; + max = -1; + break; + case DP_S_DONE: + break; + default: /* hmm? */ + break; /* some picky compilers need this */ + } + } + outch(buffer, &currlen, maxlen, -1); + return currlen; +} + +static void +fmtstr(char *buffer, size_t *currlen, size_t maxlen, + char *value, int flags, int min, int max, prfun outch) +{ + int padlen, strln; /* amount to pad */ + int cnt = 0; + + if (value == NULL) + value = ""; + + for (strln = 0; value[strln]; ++strln); /* strlen */ + padlen = min - strln; + if (padlen < 0) + padlen = 0; + if (flags & DP_F_MINUS) + padlen = -padlen; /* Left Justify */ + + while ((padlen > 0) && (cnt < max)) + { + outch(buffer, currlen, maxlen, ' '); + --padlen; + ++cnt; + } + while (*value && (cnt < max)) + { + outch(buffer, currlen, maxlen, *value++); + ++cnt; + } + while ((padlen < 0) && (cnt < max)) + { + outch(buffer, currlen, maxlen, ' '); + ++padlen; + ++cnt; + } +} + +/* Have to handle DP_F_NUM(ie 0x and 0 alternates) */ + +static void +fmtint(char *buffer, size_t *currlen, size_t maxlen, + INT64 value, int base, int min, int max, int flags, prfun outch) +{ + UINT64 uvalue; + char convert[20]; + int signvalue = 0; + int place = 0; + int spadlen = 0; /* amount to space pad */ + int zpadlen = 0; /* amount to zero pad */ + int caps = 0; + + if (max < 0) + max = 0; + + uvalue = value; + + if (!(flags & DP_F_UNSIGNED)) + { + if (value < 0) + { + signvalue = '-'; + uvalue = -value; + } + else if (flags & DP_F_PLUS) /* Do a sign(+/i) */ + signvalue = '+'; + else if (flags & DP_F_SPACE) + signvalue = ' '; + } + + if (flags & DP_F_UP) + caps = 16; /* Should characters be upper case? */ + + do + { + convert[place++] = digitval[(uvalue%base)+caps]; + uvalue = (uvalue / (unsigned)base); + } while (uvalue && (place < 20)); + + if (place == 20) + place--; + + convert[place] = 0; + + zpadlen = max - place; + spadlen = min - MAX(max, place) - (signvalue ? 1 : 0); + + if (zpadlen < 0) + zpadlen = 0; + if (spadlen < 0) + spadlen = 0; + if (flags & DP_F_ZERO) + { + zpadlen = MAX(zpadlen, spadlen); + spadlen = 0; + } + if (flags & DP_F_MINUS) + spadlen = -spadlen; /* Left Justifty */ + + + /* Spaces */ + while (spadlen > 0) + { + outch(buffer, currlen, maxlen, ' '); + --spadlen; + } + + /* Sign */ + if (signvalue) + outch(buffer, currlen, maxlen, signvalue); + + /* Zeros */ + if (zpadlen > 0) + { + while (zpadlen > 0) + { + outch(buffer, currlen, maxlen, '0'); + --zpadlen; + } + } + + /* Digits */ + while (place > 0) + outch(buffer, currlen, maxlen, convert[--place]); + + /* Left Justified spaces */ + while (spadlen < 0) + { + outch(buffer, currlen, maxlen, ' '); + ++spadlen; + } +} + +static long double +pow10(int exp) +{ + long double result = 1; + + while (exp) + { + result *= 10; + exp--; + } + + return result; +} + +static long +round(long double value) +{ + long intpart = (long)value; + + value -= intpart; + if (value >= 0.5) + intpart++; + + return intpart; +} + +static void +fmtfp(char *buffer, size_t *currlen, size_t maxlen, long double fvalue, + int min, int max, int flags, prfun outch) +{ + char iconvert[20]; + char fconvert[20]; + int signvalue = 0; + int iplace = 0; + int fplace = 0; + int padlen = 0; /* amount to pad */ + int zpadlen = 0; + long intpart; + long fracpart; + long double ufvalue; + + /* + * AIX manpage says the default is 0, but Solaris says the default + * is 6, and sprintf on AIX defaults to 6 + */ + if (max < 0) + max = 6; + + ufvalue = abs_val(fvalue); + + if (fvalue < 0) + signvalue = '-'; + else if (flags & DP_F_PLUS) /* Do a sign(+/i) */ + signvalue = '+'; + else if (flags & DP_F_SPACE) + signvalue = ' '; + + intpart = (long)ufvalue; + + /* + * Sorry, we only support 9 digits past the decimal because of our + * conversion method + */ + if (max > 9) + max = 9; + + /* We "cheat" by converting the fractional part to integer by + * multiplying by a factor of 10 + */ + fracpart = round((pow10 (max)) * (ufvalue - intpart)); + + if (fracpart >= pow10 (max)) + { + intpart++; + fracpart -= (long)pow10 (max); + } + + /* Convert integer part */ + do + { + iconvert[iplace++] = digitval[intpart % 10]; + intpart = (intpart / 10); + } while (intpart && (iplace < 20)); + + if (iplace == 20) + iplace--; + + iconvert[iplace] = 0; + + /* Convert fractional part */ + do + { + fconvert[fplace++] = digitval[fracpart % 10]; + fracpart = (fracpart / 10); + } while (fracpart && (fplace < 20)); + + if (fplace == 20) + fplace--; + + fconvert[fplace] = 0; + + /* -1 for decimal point, another -1 if we are printing a sign */ + padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0); + zpadlen = max - fplace; + if (zpadlen < 0) + zpadlen = 0; + if (padlen < 0) + padlen = 0; + if (flags & DP_F_MINUS) + padlen = -padlen; /* Left Justifty */ + + if ((flags & DP_F_ZERO) && (padlen > 0)) + { + if (signvalue) + { + outch(buffer, currlen, maxlen, signvalue); + --padlen; + signvalue = 0; + } + while (padlen > 0) + { + outch(buffer, currlen, maxlen, '0'); + --padlen; + } + } + + while (padlen > 0) + { + outch(buffer, currlen, maxlen, ' '); + --padlen; + } + + if (signvalue) + outch(buffer, currlen, maxlen, signvalue); + + while (iplace > 0) + outch(buffer, currlen, maxlen, iconvert[--iplace]); + + /* + * Decimal point. This should probably use locale to find the correct + * char to print out. + */ + outch(buffer, currlen, maxlen, '.'); + + while (fplace > 0) + outch(buffer, currlen, maxlen, fconvert[--fplace]); + + while (zpadlen > 0) + { + outch(buffer, currlen, maxlen, '0'); + --zpadlen; + } + + while (padlen < 0) + { + outch(buffer, currlen, maxlen, ' '); + ++padlen; + } +} + +static void +dopr_outch(char *buffer, size_t *currlen, size_t maxlen, int c) +{ + if (c == -1) + { + if (*currlen < maxlen - 1) + buffer[*currlen] = '\0'; + else + buffer[maxlen - 1] = '\0'; + } + else if (*currlen < maxlen) + buffer[(*currlen)++] = c; +} + +int +__sprintf(char *str, const char *fmt, ...) +{ + int rval; + va_list ap; + va_start(ap, fmt); + rval = vsnprintf(str, 128*1024, fmt, ap); + va_end(ap); + return rval; +} + + +int +__snprintf(char *str, size_t count, const char *fmt, ...) +{ + int rval; + va_list ap; + + va_start(ap, fmt); + rval = vsnprintf(str, count, fmt, ap); + va_end(ap); + + return rval; +} + +int +__vsprintf(char *s, const char *format, va_list args) +{ + s[0] = 0; + return dopr(s, 0xfffff, format, args, dopr_outch); +} + +int +__vsnprintf(char *s, size_t count, const char *format, va_list args) +{ + s[0] = 0; + return dopr(s, count, format, args, dopr_outch); +} + diff --git a/bacula/src/win32/compat/pwd.h b/bacula/src/win32/compat/pwd.h new file mode 100644 index 0000000000..7273fef6de --- /dev/null +++ b/bacula/src/win32/compat/pwd.h @@ -0,0 +1 @@ +#include "compat.h" diff --git a/bacula/src/win32/compat/sched.h b/bacula/src/win32/compat/sched.h new file mode 100644 index 0000000000..9208a52f35 --- /dev/null +++ b/bacula/src/win32/compat/sched.h @@ -0,0 +1,174 @@ +/* + * Module: sched.h + * + * Purpose: + * Provides an implementation of POSIX realtime extensions + * as defined in + * + * POSIX 1003.1b-1993 (POSIX.1b) + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2003 Pthreads-win32 contributors + * + * Contact Email: rpj@callisto.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ +#ifndef _SCHED_H +#define _SCHED_H + +#undef PTW32_LEVEL + +#if defined(_POSIX_SOURCE) +#define PTW32_LEVEL 0 +/* Early POSIX */ +#endif + +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309 +#undef PTW32_LEVEL +#define PTW32_LEVEL 1 +/* Include 1b, 1c and 1d */ +#endif + +#if defined(INCLUDE_NP) +#undef PTW32_LEVEL +#define PTW32_LEVEL 2 +/* Include Non-Portable extensions */ +#endif + +#define PTW32_LEVEL_MAX 3 + +#if !defined(PTW32_LEVEL) +#define PTW32_LEVEL PTW32_LEVEL_MAX +/* Include everything */ +#endif + + +#if __GNUC__ && ! defined (__declspec) +# error Please upgrade your GNU compiler to one that supports __declspec. +#endif + +/* + * When building the DLL code, you should define PTW32_BUILD so that + * the variables/functions are exported correctly. When using the DLL, + * do NOT define PTW32_BUILD, and then the variables/functions will + * be imported correctly. + */ +#ifdef PTW32_BUILD +# define PTW32_DLLPORT __declspec (dllexport) +#else +# define PTW32_DLLPORT __declspec (dllimport) +#endif + +/* + * This is a duplicate of what is in the autoconf config.h, + * which is only used when building the pthread-win32 libraries. + */ + +#ifndef PTW32_CONFIG_H +# if defined(WINCE) +# define NEED_ERRNO +# define NEED_SEM +# endif +# if defined(_UWIN) || defined(__MINGW32__) +# define HAVE_MODE_T +# endif +#endif + +/* + * + */ + +#if PTW32_LEVEL >= PTW32_LEVEL_MAX +#ifdef NEED_ERRNO +#include "need_errno.h" +#else +#include +#endif +#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ + +#if defined(__MINGW32__) || defined(_UWIN) +#if PTW32_LEVEL >= PTW32_LEVEL_MAX +/* For pid_t */ +# include +/* Required by Unix 98 */ +# include +#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ +#else +typedef int pid_t; +#endif + +/* Thread scheduling policies */ + +enum { + SCHED_OTHER = 0, + SCHED_FIFO, + SCHED_RR, + SCHED_MIN = SCHED_OTHER, + SCHED_MAX = SCHED_RR +}; + +struct sched_param { + int sched_priority; +}; + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +PTW32_DLLPORT int sched_yield (void); + +PTW32_DLLPORT int sched_get_priority_min (int policy); + +PTW32_DLLPORT int sched_get_priority_max (int policy); + +PTW32_DLLPORT int sched_setscheduler (pid_t pid, int policy); + +PTW32_DLLPORT int sched_getscheduler (pid_t pid); + +/* + * Note that this macro returns ENOTSUP rather than + * ENOSYS as might be expected. However, returning ENOSYS + * should mean that sched_get_priority_{min,max} are + * not implemented as well as sched_rr_get_interval. + * This is not the case, since we just don't support + * round-robin scheduling. Therefore I have chosen to + * return the same value as sched_setscheduler when + * SCHED_RR is passed to it. + */ +#define sched_rr_get_interval(_pid, _interval) \ + ( errno = ENOTSUP, (int) -1 ) + + +#ifdef __cplusplus +} /* End of extern "C" */ +#endif /* __cplusplus */ + +#undef PTW32_LEVEL +#undef PTW32_LEVEL_MAX + +#endif /* !_SCHED_H */ + diff --git a/bacula/src/win32/compat/stdint.h b/bacula/src/win32/compat/stdint.h new file mode 100644 index 0000000000..7273fef6de --- /dev/null +++ b/bacula/src/win32/compat/stdint.h @@ -0,0 +1 @@ +#include "compat.h" diff --git a/bacula/src/win32/compat/strings.h b/bacula/src/win32/compat/strings.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bacula/src/win32/compat/sys/file.h b/bacula/src/win32/compat/sys/file.h new file mode 100644 index 0000000000..36508054a9 --- /dev/null +++ b/bacula/src/win32/compat/sys/file.h @@ -0,0 +1,2 @@ + +#include "compat.h" diff --git a/bacula/src/win32/compat/sys/ioctl.h b/bacula/src/win32/compat/sys/ioctl.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bacula/src/win32/compat/sys/socket.h b/bacula/src/win32/compat/sys/socket.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bacula/src/win32/compat/sys/time.h b/bacula/src/win32/compat/sys/time.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bacula/src/win32/compat/sys/wait.h b/bacula/src/win32/compat/sys/wait.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bacula/src/win32/compat/syslog.h b/bacula/src/win32/compat/syslog.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/bacula/src/win32/compat/unistd.h b/bacula/src/win32/compat/unistd.h new file mode 100644 index 0000000000..7273fef6de --- /dev/null +++ b/bacula/src/win32/compat/unistd.h @@ -0,0 +1 @@ +#include "compat.h" diff --git a/bacula/src/win32/compat/winconfig.h b/bacula/src/win32/compat/winconfig.h new file mode 100644 index 0000000000..e439f645fc --- /dev/null +++ b/bacula/src/win32/compat/winconfig.h @@ -0,0 +1,622 @@ +/* src/config.h. Generated by configure. */ +/* autoconf/config.h.in. Generated from autoconf/configure.in by autoheader. */ +/* ------------------------------------------------------------------------- */ +/* -- CONFIGURE SPECIFIED FEATURES -- */ +/* ------------------------------------------------------------------------- */ + +/* Define if you want to use MySQL as Catalog database */ +/* #undef USE_MYSQL_DB */ + +/* Define if you want SmartAlloc debug code enabled */ +#define SMARTALLOC 1 + +/* Define to `int' if doesn't define. */ +/* #undef daddr_t */ + +/* Define to `int' if doesn't define. */ +#define major_t int + +/* Define to `int' if doesn't define. */ +#define minor_t int + +/* Define to `int' if doesn't define. */ +/* #undef ssize_t */ + +/* Define if you want to use MySQL */ +/* #undef HAVE_MYSQL */ + +/* Defined if MySQL thread safe library is present */ +/* #undef HAVE_THREAD_SAFE_MYSQL */ + +/* Define if you want to use embedded MySQL */ +/* #undef HAVE_EMBEDDED_MYSQL */ + +/* Define if you want to use SQLite */ +/* #undef HAVE_SQLITE */ + +/* Define if you want to use Berkeley DB */ +/* #undef HAVE_BERKELEY_DB */ + + +/* Define if you want to use PostgreSQL */ +/* #undef HAVE_PGSQL */ + +/* Define if you want to use mSQL */ +/* #undef HAVE_MSQL */ + +/* Define if you want to use iODBC */ +/* #undef HAVE_IODBC */ + +/* Define if you want to use unixODBC */ +/* #undef HAVE_UNIXODBC */ + +/* Define if you want to use Solid SQL Server */ +/* #undef HAVE_SOLID */ + +/* Define if you want to use OpenLink ODBC (Virtuoso) */ +/* #undef HAVE_VIRT */ + +/* Define if you want to use EasySoft ODBC */ +/* #undef HAVE_EASYSOFT */ + +/* Define if you want to use Interbase SQL Server */ +/* #undef HAVE_IBASE */ + +/* Define if you want to use Oracle 8 SQL Server */ +/* #undef HAVE_ORACLE8 */ + +/* Define if you want to use Oracle 7 SQL Server */ +/* #undef HAVE_ORACLE7 */ + + +/* ------------------------------------------------------------------------- */ +/* -- CONFIGURE DETECTED FEATURES -- */ +/* ------------------------------------------------------------------------- */ + +/* Define if you need function prototypes */ +#define PROTOTYPES 1 + +/* Define if you have XPointer typedef */ +/* #undef HAVE_XPOINTER */ + +/* Define if you have _GNU_SOURCE getpt() */ +/* #undef HAVE_GETPT */ + +/* Define if you have GCC */ +/* #undef HAVE_GCC 1 */ + +/* Define if you have the Andrew File System. */ +/* #undef AFS */ + +/* Define If you want find -nouser and -nogroup to make tables of + used UIDs and GIDs at startup instead of using getpwuid or + getgrgid when needed. Speeds up -nouser and -nogroup unless you + are running NIS or Hesiod, which make password and group calls + very expensive. */ +/* #undef CACHE_IDS */ + +/* Define to use SVR4 statvfs to get filesystem type. */ +/* #undef FSTYPE_STATVFS */ + +/* Define to use SVR3.2 statfs to get filesystem type. */ +/* #undef FSTYPE_USG_STATFS */ + +/* Define to use AIX3 statfs to get filesystem type. */ +/* #undef FSTYPE_AIX_STATFS */ + +/* Define to use 4.3BSD getmntent to get filesystem type. */ +/* #undef FSTYPE_MNTENT 1 */ + +/* Define to use 4.4BSD and OSF1 statfs to get filesystem type. */ +/* #undef FSTYPE_STATFS */ + +/* Define to use Ultrix getmnt to get filesystem type. */ +/* #undef FSTYPE_GETMNT */ + +/* Define to `unsigned long' if doesn't define. */ +/* #undef dev_t */ + +/* Define to `unsigned long' if doesn't define. */ +/* #undef ino_t */ + +/* Define to 1 if utime.h exists and declares struct utimbuf. */ +/* #undef HAVE_UTIME_H 1 */ + +#if (HAVE_MYSQL||HAVE_PGSQL||HAVE_MSQL||HAVE_IODBC||HAVE_UNIXODBC||HAVE_SOLID||HAVE_VIRT||HAVE_IBASE||HAVE_ORACLE8||HAVE_ORACLE7||HAVE_EASYSOFT) +#define HAVE_SQL +#endif + +/* Data types */ +#define HAVE_U_INT 1 +#define HAVE_INTXX_T 1 +#define HAVE_U_INTXX_T 1 +/* #undef HAVE_UINTXX_T */ +#define HAVE_INT64_T 1 +#define HAVE_U_INT64_T 1 +#define HAVE_INTMAX_T 1 +/* #undef HAVE_U_INTMAX_T */ + +/* Define if you want TCP Wrappers support */ +/* #undef HAVE_LIBWRAP */ + +/* Define if you have sys/bitypes.h */ +/* #undef HAVE_SYS_BITYPES_H */ + +/* Directory for PID files */ +#define _PATH_BACULA_PIDDIR "/var/run" + +/* Define if you have zlib */ +#define HAVE_LIBZ 1 + +/* General libs */ +/* #undef LIBS */ + +/* File daemon specif libraries */ +#define FDLIBS 1 + +/* Path to Sendmail program */ +/* #undef SENDMAIL_PATH */ + +/* What kind of signals we have */ +/*#define HAVE_POSIX_SIGNALS 1 */ +/* #undef HAVE_BSD_SIGNALS */ +/* #undef HAVE_USG_SIGHOLD */ + +/* Operating systems */ +/* OSes */ +/* #undef HAVE_LINUX_OS */ +/* #undef HAVE_FREEBSD_OS */ +/* #undef HAVE_NETBSD_OS */ +/* #undef HAVE_OPENBSD_OS */ +/* #undef HAVE_BSDI_OS */ +/* #undef HAVE_HPUX_OS */ +/* #undef HAVE_SUN_OS */ +/* #undef HAVE_IRIX_OS */ +/* #undef HAVE_AIX_OS */ +/* #undef HAVE_SGI_OS */ +/* #define HAVE_CYGWIN 1 */ +/* #undef HAVE_OSF1_OS */ +/* #undef HAVE_DARWIN_OS */ + +/* Set to correct scanf value for long long int */ +#define lld "lld" +#define llu "llu" + +/*#define HAVE_READLINE 1 */ + +/* #undef HAVE_GMP */ + +/* #undef HAVE_CWEB */ + +/* #define HAVE_FCHDIR 1 */ + +/* #undef HAVE_GETOPT_LONG */ + +/* #undef HAVE_LIBSM */ + +/* Check for thread safe routines */ +/*#define HAVE_LOCALTIME_R 1 */ +/* #undef HAVE_READDIR_R */ +/*#define HAVE_STRERROR_R 1*/ +/* #undef HAVE_GETHOSTBYNAME_R */ + +#define HAVE_STRTOLL 1 +/* #undef HAVE_INET_PTON */ + +/*#define HAVE_SOCKLEN_T 1 */ + +/* #undef HAVE_OLD_SOCKOPT */ + +/* #undef HAVE_BIGENDIAN */ + +/* Define to 1 if the `closedir' function returns void instead of `int'. */ +/* #undef CLOSEDIR_VOID */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 +#define alloca _alloca +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#define HAVE_ALLOCA_H 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_ARPA_NAMESER_H 1 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the `chflags' function. */ +/* #undef HAVE_CHFLAGS */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +/* #undef HAVE_DOPRNT */ + +/* Define to 1 if you have the `fchdir' function. */ +/*#define HAVE_FCHDIR 1 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if your system has a working POSIX `fnmatch' function. */ +/*#define HAVE_FNMATCH 1 */ + +/* Define to 1 if you have the `fork' function. */ +/*#define HAVE_FORK 1 */ + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `getdomainname' function. */ +/*#define HAVE_GETDOMAINNAME 1 */ + +/* Define to 1 if you have the `gethostbyname_r' function. */ +/* #undef HAVE_GETHOSTBYNAME_R */ + +/* Define to 1 if you have the `gethostid' function. */ +#define HAVE_GETHOSTID 1 + +/* Define to 1 if you have the `gethostname' function. */ +#define HAVE_GETHOSTNAME 1 + +/* Define to 1 if you have the `getmntent' function. */ +/*#define HAVE_GETMNTENT 1 */ + +/* Define to 1 if you have the `getpid' function. */ +#define HAVE_GETPID 1 +#define getpid _getpid + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_GRP_H 1*/ + +/* Define to 1 if you have the `inet_pton' function. */ +/* #undef HAVE_INET_PTON */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `lchown' function. */ +#define HAVE_LCHOWN 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBC_H */ + +/* Define to 1 if you have the `inet' library (-linet). */ +/* #undef HAVE_LIBINET */ + +/* Define to 1 if you have the `nsl' library (-lnsl). */ +/* #undef HAVE_LIBNSL */ + +/* Define to 1 if you have the `resolv' library (-lresolv). */ +/* #undef HAVE_LIBRESOLV */ + +/* Define to 1 if you have the `socket' library (-lsocket). */ +/* #undef HAVE_LIBSOCKET */ + +/* Define to 1 if you have the `sun' library (-lsun). */ +/* #undef HAVE_LIBSUN */ + +/* Define to 1 if you have the `xnet' library (-lxnet). */ +/* #undef HAVE_LIBXNET */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the `localtime_r' function. */ +#define HAVE_LOCALTIME_R 1 + +/* Define to 1 if you have the `lstat' function. */ +#define HAVE_LSTAT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MTIO_H */ + +/* Define to 1 if you have the `nanosleep' function. */ +#define HAVE_NANOSLEEP 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_PWD_H 1*/ + +/* Define to 1 if you have the `readdir_r' function. */ +/* #undef HAVE_READDIR_R */ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_RESOLV_H 1*/ + +/* Define to 1 if you have the `select' function. */ +#define HAVE_SELECT 1 + +/* Define to 1 if you have the `setenv' function. */ +#define HAVE_SETENV 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setpgid' function. */ +#define HAVE_SETPGID 1 + +/* Define to 1 if you have the `setpgrp' function. */ +#define HAVE_SETPGRP 1 + +/* Define to 1 if you have the `setsid' function. */ +#define HAVE_SETSID 1 + +/* Define to 1 if you have the `signal' function. */ +/*#define HAVE_SIGNAL 1 */ + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the header file. */ +/*#define HAVE_STDARG_H 1*/ + +/* Define to 1 if you have the header file. */ +/*#define HAVE_STDINT_H 1 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the `strerror_r' function. */ +#define HAVE_STRERROR_R 1 + +/* Define to 1 if you have the `strftime' function. */ +#define HAVE_STRFTIME 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strncmp' function. */ +#define HAVE_STRNCMP 1 + +/* Define to 1 if you have the `strncpy' function. */ +#define HAVE_STRNCPY 1 + +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + +/* Define to 1 if `st_blksize' is member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 + +/* Define to 1 if `st_blocks' is member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_BLOCKS 1 + +/* Define to 1 if `st_rdev' is member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_RDEV 1 + +/* Define to 1 if `tm_zone' is member of `struct tm'. */ +/* #undef HAVE_STRUCT_TM_TM_ZONE */ + +/* Define to 1 if your `struct stat' has `st_blksize'. Deprecated, use + `HAVE_STRUCT_STAT_ST_BLKSIZE' instead. */ +#define HAVE_ST_BLKSIZE 1 + +/* Define to 1 if your `struct stat' has `st_blocks'. Deprecated, use + `HAVE_STRUCT_STAT_ST_BLOCKS' instead. */ +#define HAVE_ST_BLOCKS 1 + +/* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use + `HAVE_STRUCT_STAT_ST_RDEV' instead. */ +#define HAVE_ST_RDEV 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_BYTEORDER_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MTIO_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SELECT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SOCKIO_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the `tcgetattr' function. */ +#define HAVE_TCGETATTR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TERMIOS_H 1 + +/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use + `HAVE_STRUCT_TM_TM_ZONE' instead. */ +/* #undef HAVE_TM_ZONE */ + +/* Define to 1 if you don't have `tm_zone' but do have the external array + `tzname'. */ +#define HAVE_TZNAME 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_VARARGS_H */ + +/* Define to 1 if you have the `vfprintf' function. */ +#define HAVE_VFPRINTF 1 + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Define to 1 if you have the `vsnprintf' function. */ +#define HAVE_VSNPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ZLIB_H 1 + +/* Define to 1 if `major', `minor', and `makedev' are declared in . + */ +/* #undef MAJOR_IN_MKDEV */ + +/* Define to 1 if `major', `minor', and `makedev' are declared in + . */ +/* #undef MAJOR_IN_SYSMACROS */ + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void + +/* Define to 1 if the `setpgrp' function takes no argument. */ +#define SETPGRP_VOID 1 + +/* The size of a `char', as computed by sizeof. */ +#define SIZEOF_CHAR 1 + +/* The size of a `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of a `int *', as computed by sizeof. */ +#define SIZEOF_INT_P 4 + +/* The size of a `long int', as computed by sizeof. */ +#define SIZEOF_LONG_INT 4 + +/* The size of a `long long int', as computed by sizeof. */ +#define SIZEOF_LONG_LONG_INT 8 + +/* The size of a `short int', as computed by sizeof. */ +#define SIZEOF_SHORT_INT 2 + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if the `S_IS*' macros in do not work properly. */ +/* #undef STAT_MACROS_BROKEN */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if you can safely include both and . */ +#define TIME_WITH_SYS_TIME 1 + +/* Define to 1 if your declares `struct tm'. */ +/* #undef TM_IN_SYS_TIME */ + +/* Define to 1 if the X Window System is missing or not being used. */ +/* #undef X_DISPLAY_MISSING */ + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define to make fseeko etc. visible, on some hosts. */ +/* #undef _LARGEFILE_SOURCE */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `long' if does not define. */ +/* #undef daddr_t */ + +/* Define to `unsigned long' if does not define. */ +/* #undef dev_t */ + +/* Define to `int' if doesn't define. */ +/* #undef gid_t */ + +/* Define to `unsigned long' if does not define. */ +/* #undef ino_t */ + +/* Define to `int' if does not define. */ +#define major_t int + +/* Define to `int' if does not define. */ +#define minor_t int + +/* Define to `int' if does not define. */ +/* #undef mode_t */ + +/* Define to `long' if does not define. */ +/* #undef off_t */ + +/* Define to `int' if does not define. */ +/* #undef pid_t */ + +/* Define to `unsigned' if does not define. */ +/* #undef size_t */ + +/* Define to `int' if does not define. */ +/* #undef ssize_t */ + +/* Define to `int' if doesn't define. */ +/* #undef uid_t */ diff --git a/bacula/src/win32/compat/winhost.h b/bacula/src/win32/compat/winhost.h new file mode 100644 index 0000000000..4fe7307591 --- /dev/null +++ b/bacula/src/win32/compat/winhost.h @@ -0,0 +1,32 @@ +/* + * Define Host machine + * + * Version $Id$ + * + */ +/* + Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. + + */ + +extern char WIN_VERSION_LONG[]; +extern char WIN_VERSION[]; + +#define HOST_OS WIN_VERSION_LONG +#define DISTNAME "MVS" +#define DISTVER WIN_VERSION diff --git a/bacula/src/win32/console/ReadMe.txt b/bacula/src/win32/console/ReadMe.txt new file mode 100644 index 0000000000..514964ec32 --- /dev/null +++ b/bacula/src/win32/console/ReadMe.txt @@ -0,0 +1,34 @@ +======================================================================== + CONSOLE APPLICATION : console +======================================================================== + + +AppWizard has created this console application for you. + +This file contains a summary of what you will find in each of the files that +make up your console application. + +console.dsp + This file (the project file) contains information at the project level and + is used to build a single project or subproject. Other users can share the + project (.dsp) file, but they should export the makefiles locally. + +console.cpp + This is the main application source file. + + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named console.pch and a precompiled types file named StdAfx.obj. + + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/bacula/src/win32/console/StdAfx.cpp b/bacula/src/win32/console/StdAfx.cpp new file mode 100644 index 0000000000..9d9c168d7c --- /dev/null +++ b/bacula/src/win32/console/StdAfx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// console.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/bacula/src/win32/console/StdAfx.h b/bacula/src/win32/console/StdAfx.h new file mode 100644 index 0000000000..91cd457154 --- /dev/null +++ b/bacula/src/win32/console/StdAfx.h @@ -0,0 +1,19 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#if !defined(AFX_STDAFX_H__35C63B87_45EF_4CD3_AFE9_2E4597342185__INCLUDED_) +#define AFX_STDAFX_H__35C63B87_45EF_4CD3_AFE9_2E4597342185__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + + +// TODO: reference additional headers your program requires here + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STDAFX_H__35C63B87_45EF_4CD3_AFE9_2E4597342185__INCLUDED_) diff --git a/bacula/src/win32/console/console.cpp b/bacula/src/win32/console/console.cpp new file mode 100644 index 0000000000..f93356908d --- /dev/null +++ b/bacula/src/win32/console/console.cpp @@ -0,0 +1,10 @@ +// console.cpp : Defines the entry point for the console application. +// + +#include "stdafx.h" + + +int main(int argc, char* argv[]) +{ + return 0; +} diff --git a/bacula/src/win32/console/console.dsp b/bacula/src/win32/console/console.dsp new file mode 100644 index 0000000000..0f76770d4b --- /dev/null +++ b/bacula/src/win32/console/console.dsp @@ -0,0 +1,113 @@ +# Microsoft Developer Studio Project File - Name="console" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=console - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "console.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "console.mak" CFG="console - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "console - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "console - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "console - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "console - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "console - Win32 Release" +# Name "console - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\console.cpp +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.cpp +# ADD CPP /Yc"stdafx.h" +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\StdAfx.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=.\ReadMe.txt +# End Source File +# End Target +# End Project diff --git a/bacula/src/win32/console/console.dsw b/bacula/src/win32/console/console.dsw new file mode 100644 index 0000000000..089fc6c3ca --- /dev/null +++ b/bacula/src/win32/console/console.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "console"=.\console.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/bacula/src/win32/filed/authenticate.cpp b/bacula/src/win32/filed/authenticate.cpp new file mode 100644 index 0000000000..ed619b1569 --- /dev/null +++ b/bacula/src/win32/filed/authenticate.cpp @@ -0,0 +1 @@ +#include "../../filed/authenticate.c" diff --git a/bacula/src/win32/filed/backup.cpp b/bacula/src/win32/filed/backup.cpp new file mode 100644 index 0000000000..f86d25daf8 --- /dev/null +++ b/bacula/src/win32/filed/backup.cpp @@ -0,0 +1 @@ +#include "../../filed/backup.c" diff --git a/bacula/src/win32/filed/estimate.cpp b/bacula/src/win32/filed/estimate.cpp new file mode 100644 index 0000000000..6563a7d393 --- /dev/null +++ b/bacula/src/win32/filed/estimate.cpp @@ -0,0 +1 @@ +#include "../../filed/estimate.c" diff --git a/bacula/src/win32/filed/filed.cpp b/bacula/src/win32/filed/filed.cpp new file mode 100644 index 0000000000..f3b9ae0201 --- /dev/null +++ b/bacula/src/win32/filed/filed.cpp @@ -0,0 +1 @@ +#include "../../filed/filed.c" diff --git a/bacula/src/win32/filed/filed_conf.cpp b/bacula/src/win32/filed/filed_conf.cpp new file mode 100644 index 0000000000..a08eaf8852 --- /dev/null +++ b/bacula/src/win32/filed/filed_conf.cpp @@ -0,0 +1 @@ +#include "../../filed/filed_conf.c" diff --git a/bacula/src/win32/filed/heartbeat.cpp b/bacula/src/win32/filed/heartbeat.cpp new file mode 100644 index 0000000000..6ac2850131 --- /dev/null +++ b/bacula/src/win32/filed/heartbeat.cpp @@ -0,0 +1 @@ +#include "../../filed/heartbeat.c" diff --git a/bacula/src/win32/filed/job.cpp b/bacula/src/win32/filed/job.cpp new file mode 100644 index 0000000000..13c0b142d2 --- /dev/null +++ b/bacula/src/win32/filed/job.cpp @@ -0,0 +1 @@ +#include "../../filed/job.c" diff --git a/bacula/src/win32/filed/restore.cpp b/bacula/src/win32/filed/restore.cpp new file mode 100644 index 0000000000..927715a688 --- /dev/null +++ b/bacula/src/win32/filed/restore.cpp @@ -0,0 +1 @@ +#include "../../filed/restore.c" diff --git a/bacula/src/win32/filed/status.cpp b/bacula/src/win32/filed/status.cpp new file mode 100644 index 0000000000..9e17cd4538 --- /dev/null +++ b/bacula/src/win32/filed/status.cpp @@ -0,0 +1 @@ +#include "../../filed/status.c" diff --git a/bacula/src/win32/filed/verify.cpp b/bacula/src/win32/filed/verify.cpp new file mode 100644 index 0000000000..da8d244664 --- /dev/null +++ b/bacula/src/win32/filed/verify.cpp @@ -0,0 +1 @@ +#include "../../filed/verify.c" diff --git a/bacula/src/win32/filed/verify_vol.cpp b/bacula/src/win32/filed/verify_vol.cpp new file mode 100644 index 0000000000..1c0767c579 --- /dev/null +++ b/bacula/src/win32/filed/verify_vol.cpp @@ -0,0 +1 @@ +#include "../../filed/verify_vol.c" diff --git a/bacula/src/win32/findlib/attribs.cpp b/bacula/src/win32/findlib/attribs.cpp new file mode 100644 index 0000000000..b015ebaa9b --- /dev/null +++ b/bacula/src/win32/findlib/attribs.cpp @@ -0,0 +1 @@ +#include "../../findlib/attribs.c" diff --git a/bacula/src/win32/findlib/bfile.cpp b/bacula/src/win32/findlib/bfile.cpp new file mode 100644 index 0000000000..a60930b723 --- /dev/null +++ b/bacula/src/win32/findlib/bfile.cpp @@ -0,0 +1 @@ +#include "../../findlib/bfile.c" diff --git a/bacula/src/win32/findlib/create_file.cpp b/bacula/src/win32/findlib/create_file.cpp new file mode 100644 index 0000000000..7e7cf94176 --- /dev/null +++ b/bacula/src/win32/findlib/create_file.cpp @@ -0,0 +1 @@ +#include "../../findlib/create_file.c" diff --git a/bacula/src/win32/findlib/enable_priv.cpp b/bacula/src/win32/findlib/enable_priv.cpp new file mode 100644 index 0000000000..14bce319f5 --- /dev/null +++ b/bacula/src/win32/findlib/enable_priv.cpp @@ -0,0 +1 @@ +#include "../../findlib/enable_priv.c" diff --git a/bacula/src/win32/findlib/find.cpp b/bacula/src/win32/findlib/find.cpp new file mode 100644 index 0000000000..b610c30011 --- /dev/null +++ b/bacula/src/win32/findlib/find.cpp @@ -0,0 +1 @@ +#include "../../findlib/find.c" diff --git a/bacula/src/win32/findlib/find_one.cpp b/bacula/src/win32/findlib/find_one.cpp new file mode 100644 index 0000000000..8a45ee1f78 --- /dev/null +++ b/bacula/src/win32/findlib/find_one.cpp @@ -0,0 +1 @@ +#include "../../findlib/find_one.c" diff --git a/bacula/src/win32/findlib/makepath.cpp b/bacula/src/win32/findlib/makepath.cpp new file mode 100644 index 0000000000..2030466b50 --- /dev/null +++ b/bacula/src/win32/findlib/makepath.cpp @@ -0,0 +1 @@ +#include "../../findlib/makepath.c" diff --git a/bacula/src/win32/findlib/match.cpp b/bacula/src/win32/findlib/match.cpp new file mode 100644 index 0000000000..8690e801f3 --- /dev/null +++ b/bacula/src/win32/findlib/match.cpp @@ -0,0 +1 @@ +#include "../../findlib/match.c" diff --git a/bacula/src/win32/findlib/save-cwd.cpp b/bacula/src/win32/findlib/save-cwd.cpp new file mode 100644 index 0000000000..64da93ae1e --- /dev/null +++ b/bacula/src/win32/findlib/save-cwd.cpp @@ -0,0 +1 @@ +#include "../../findlib/save-cwd.c" diff --git a/bacula/src/win32/findlib/winapi.cpp b/bacula/src/win32/findlib/winapi.cpp new file mode 100644 index 0000000000..3690c26ba0 --- /dev/null +++ b/bacula/src/win32/findlib/winapi.cpp @@ -0,0 +1 @@ +#include "../../findlib/winapi.c" diff --git a/bacula/src/win32/lib/alist.cpp b/bacula/src/win32/lib/alist.cpp new file mode 100644 index 0000000000..ce201a110a --- /dev/null +++ b/bacula/src/win32/lib/alist.cpp @@ -0,0 +1 @@ +#include "../../lib/alist.c" diff --git a/bacula/src/win32/lib/alloc.cpp b/bacula/src/win32/lib/alloc.cpp new file mode 100644 index 0000000000..cf28ee3963 --- /dev/null +++ b/bacula/src/win32/lib/alloc.cpp @@ -0,0 +1 @@ +#include "../../lib/alloc.c" diff --git a/bacula/src/win32/lib/attr.cpp b/bacula/src/win32/lib/attr.cpp new file mode 100644 index 0000000000..46b9e42954 --- /dev/null +++ b/bacula/src/win32/lib/attr.cpp @@ -0,0 +1 @@ +#include "../../lib/attr.c" diff --git a/bacula/src/win32/lib/base64.cpp b/bacula/src/win32/lib/base64.cpp new file mode 100644 index 0000000000..fbd9e39540 --- /dev/null +++ b/bacula/src/win32/lib/base64.cpp @@ -0,0 +1 @@ +#include "../../lib/base64.c" diff --git a/bacula/src/win32/lib/bget_msg.cpp b/bacula/src/win32/lib/bget_msg.cpp new file mode 100644 index 0000000000..f034b28701 --- /dev/null +++ b/bacula/src/win32/lib/bget_msg.cpp @@ -0,0 +1 @@ +#include "../../lib/bget_msg.c" diff --git a/bacula/src/win32/lib/bnet.cpp b/bacula/src/win32/lib/bnet.cpp new file mode 100644 index 0000000000..271a8f144f --- /dev/null +++ b/bacula/src/win32/lib/bnet.cpp @@ -0,0 +1 @@ +#include "../../lib/bnet.c" diff --git a/bacula/src/win32/lib/bnet_pkt.cpp b/bacula/src/win32/lib/bnet_pkt.cpp new file mode 100644 index 0000000000..e1f2d96929 --- /dev/null +++ b/bacula/src/win32/lib/bnet_pkt.cpp @@ -0,0 +1 @@ +#include "../../lib/bnet_pkt.c" diff --git a/bacula/src/win32/lib/bnet_server.cpp b/bacula/src/win32/lib/bnet_server.cpp new file mode 100644 index 0000000000..bc42946ab6 --- /dev/null +++ b/bacula/src/win32/lib/bnet_server.cpp @@ -0,0 +1 @@ +#include "../../lib/bnet_server.c" diff --git a/bacula/src/win32/lib/bpipe.cpp b/bacula/src/win32/lib/bpipe.cpp new file mode 100644 index 0000000000..aa4d824186 --- /dev/null +++ b/bacula/src/win32/lib/bpipe.cpp @@ -0,0 +1 @@ +#include "../../lib/bpipe.c" diff --git a/bacula/src/win32/lib/bshm.cpp b/bacula/src/win32/lib/bshm.cpp new file mode 100644 index 0000000000..3f30bd4be5 --- /dev/null +++ b/bacula/src/win32/lib/bshm.cpp @@ -0,0 +1 @@ +#include "../../lib/bshm.c" diff --git a/bacula/src/win32/lib/bsys.cpp b/bacula/src/win32/lib/bsys.cpp new file mode 100644 index 0000000000..2778af412e --- /dev/null +++ b/bacula/src/win32/lib/bsys.cpp @@ -0,0 +1 @@ +#include "../../lib/bsys.c" diff --git a/bacula/src/win32/lib/btime.cpp b/bacula/src/win32/lib/btime.cpp new file mode 100644 index 0000000000..9d59aa67f7 --- /dev/null +++ b/bacula/src/win32/lib/btime.cpp @@ -0,0 +1 @@ +#include "../../lib/btime.c" diff --git a/bacula/src/win32/lib/cram-md5.cpp b/bacula/src/win32/lib/cram-md5.cpp new file mode 100644 index 0000000000..0eac6115d3 --- /dev/null +++ b/bacula/src/win32/lib/cram-md5.cpp @@ -0,0 +1 @@ +#include "../../lib/cram-md5.c" diff --git a/bacula/src/win32/lib/crc32.cpp b/bacula/src/win32/lib/crc32.cpp new file mode 100644 index 0000000000..34f8178e33 --- /dev/null +++ b/bacula/src/win32/lib/crc32.cpp @@ -0,0 +1 @@ +#include "../../lib/crc32.c" diff --git a/bacula/src/win32/lib/daemon.cpp b/bacula/src/win32/lib/daemon.cpp new file mode 100644 index 0000000000..4a281428dd --- /dev/null +++ b/bacula/src/win32/lib/daemon.cpp @@ -0,0 +1 @@ +#include "../../lib/daemon.c" diff --git a/bacula/src/win32/lib/dlist.cpp b/bacula/src/win32/lib/dlist.cpp new file mode 100644 index 0000000000..7b158a677d --- /dev/null +++ b/bacula/src/win32/lib/dlist.cpp @@ -0,0 +1 @@ +#include "../../lib/dlist.c" diff --git a/bacula/src/win32/lib/edit.cpp b/bacula/src/win32/lib/edit.cpp new file mode 100644 index 0000000000..63d9bc1bfd --- /dev/null +++ b/bacula/src/win32/lib/edit.cpp @@ -0,0 +1 @@ +#include "../../lib/edit.c" diff --git a/bacula/src/win32/lib/events.cpp b/bacula/src/win32/lib/events.cpp new file mode 100644 index 0000000000..3539ce387b --- /dev/null +++ b/bacula/src/win32/lib/events.cpp @@ -0,0 +1 @@ +#include "../../lib/events.c" diff --git a/bacula/src/win32/lib/fnmatch.cpp b/bacula/src/win32/lib/fnmatch.cpp new file mode 100644 index 0000000000..0bbb4e1729 --- /dev/null +++ b/bacula/src/win32/lib/fnmatch.cpp @@ -0,0 +1 @@ +#include "../../lib/fnmatch.c" diff --git a/bacula/src/win32/lib/hmac.cpp b/bacula/src/win32/lib/hmac.cpp new file mode 100644 index 0000000000..5f360529b9 --- /dev/null +++ b/bacula/src/win32/lib/hmac.cpp @@ -0,0 +1 @@ +#include "../../lib/hmac.c" diff --git a/bacula/src/win32/lib/htable.cpp b/bacula/src/win32/lib/htable.cpp new file mode 100644 index 0000000000..c971a4b19e --- /dev/null +++ b/bacula/src/win32/lib/htable.cpp @@ -0,0 +1 @@ +#include "../../lib/htable.c" diff --git a/bacula/src/win32/lib/idcache.cpp b/bacula/src/win32/lib/idcache.cpp new file mode 100644 index 0000000000..33e024f061 --- /dev/null +++ b/bacula/src/win32/lib/idcache.cpp @@ -0,0 +1 @@ +#include "../../lib/idcache.c" diff --git a/bacula/src/win32/lib/jcr.cpp b/bacula/src/win32/lib/jcr.cpp new file mode 100644 index 0000000000..bad09a8892 --- /dev/null +++ b/bacula/src/win32/lib/jcr.cpp @@ -0,0 +1 @@ +#include "../../lib/jcr.c" diff --git a/bacula/src/win32/lib/lex.cpp b/bacula/src/win32/lib/lex.cpp new file mode 100644 index 0000000000..70f60d3f64 --- /dev/null +++ b/bacula/src/win32/lib/lex.cpp @@ -0,0 +1 @@ +#include "../../lib/lex.c" diff --git a/bacula/src/win32/lib/md5.cpp b/bacula/src/win32/lib/md5.cpp new file mode 100644 index 0000000000..47f1571aca --- /dev/null +++ b/bacula/src/win32/lib/md5.cpp @@ -0,0 +1 @@ +#include "../../lib/md5.c" diff --git a/bacula/src/win32/lib/mem_pool.cpp b/bacula/src/win32/lib/mem_pool.cpp new file mode 100644 index 0000000000..1faf06274e --- /dev/null +++ b/bacula/src/win32/lib/mem_pool.cpp @@ -0,0 +1 @@ +#include "../../lib/mem_pool.c" diff --git a/bacula/src/win32/lib/message.cpp b/bacula/src/win32/lib/message.cpp new file mode 100644 index 0000000000..d7c94f82a7 --- /dev/null +++ b/bacula/src/win32/lib/message.cpp @@ -0,0 +1 @@ +#include "../../lib/message.c" diff --git a/bacula/src/win32/lib/parse_conf.cpp b/bacula/src/win32/lib/parse_conf.cpp new file mode 100644 index 0000000000..2e922a0df4 --- /dev/null +++ b/bacula/src/win32/lib/parse_conf.cpp @@ -0,0 +1 @@ +#include "../../lib/parse_conf.c" diff --git a/bacula/src/win32/lib/queue.cpp b/bacula/src/win32/lib/queue.cpp new file mode 100644 index 0000000000..eb37587bf5 --- /dev/null +++ b/bacula/src/win32/lib/queue.cpp @@ -0,0 +1 @@ +#include "../../lib/queue.c" diff --git a/bacula/src/win32/lib/rwlock.cpp b/bacula/src/win32/lib/rwlock.cpp new file mode 100644 index 0000000000..771a1bd735 --- /dev/null +++ b/bacula/src/win32/lib/rwlock.cpp @@ -0,0 +1 @@ +#include "../../lib/rwlock.c" diff --git a/bacula/src/win32/lib/scan.cpp b/bacula/src/win32/lib/scan.cpp new file mode 100644 index 0000000000..6a40c6bcf7 --- /dev/null +++ b/bacula/src/win32/lib/scan.cpp @@ -0,0 +1 @@ +#include "../../lib/scan.c" diff --git a/bacula/src/win32/lib/semlock.cpp b/bacula/src/win32/lib/semlock.cpp new file mode 100644 index 0000000000..dde33f4571 --- /dev/null +++ b/bacula/src/win32/lib/semlock.cpp @@ -0,0 +1 @@ +#include "../../lib/semlock.c" diff --git a/bacula/src/win32/lib/serial.cpp b/bacula/src/win32/lib/serial.cpp new file mode 100644 index 0000000000..4eb411b652 --- /dev/null +++ b/bacula/src/win32/lib/serial.cpp @@ -0,0 +1 @@ +#include "../../lib/serial.c" diff --git a/bacula/src/win32/lib/sha1.cpp b/bacula/src/win32/lib/sha1.cpp new file mode 100644 index 0000000000..4fab5bcbb9 --- /dev/null +++ b/bacula/src/win32/lib/sha1.cpp @@ -0,0 +1 @@ +#include "../../lib/sha1.c" diff --git a/bacula/src/win32/lib/signal.cpp b/bacula/src/win32/lib/signal.cpp new file mode 100644 index 0000000000..107bae04c3 --- /dev/null +++ b/bacula/src/win32/lib/signal.cpp @@ -0,0 +1 @@ +#include "../../lib/signal.c" diff --git a/bacula/src/win32/lib/smartall.cpp b/bacula/src/win32/lib/smartall.cpp new file mode 100644 index 0000000000..9811b10389 --- /dev/null +++ b/bacula/src/win32/lib/smartall.cpp @@ -0,0 +1 @@ +#include "../../lib/smartall.c" diff --git a/bacula/src/win32/lib/tree.cpp b/bacula/src/win32/lib/tree.cpp new file mode 100644 index 0000000000..287e25640c --- /dev/null +++ b/bacula/src/win32/lib/tree.cpp @@ -0,0 +1 @@ +#include "../../lib/tree.c" diff --git a/bacula/src/win32/lib/util.cpp b/bacula/src/win32/lib/util.cpp new file mode 100644 index 0000000000..787cd2d5aa --- /dev/null +++ b/bacula/src/win32/lib/util.cpp @@ -0,0 +1 @@ +#include "../../lib/util.c" diff --git a/bacula/src/win32/lib/var.cpp b/bacula/src/win32/lib/var.cpp new file mode 100644 index 0000000000..7cbc98a4a8 --- /dev/null +++ b/bacula/src/win32/lib/var.cpp @@ -0,0 +1 @@ +#include "../../lib/var.c" diff --git a/bacula/src/win32/lib/watchdog.cpp b/bacula/src/win32/lib/watchdog.cpp new file mode 100644 index 0000000000..b683475747 --- /dev/null +++ b/bacula/src/win32/lib/watchdog.cpp @@ -0,0 +1 @@ +#include "../../lib/watchdog.c" diff --git a/bacula/src/win32/lib/workq.cpp b/bacula/src/win32/lib/workq.cpp new file mode 100644 index 0000000000..023edb2c79 --- /dev/null +++ b/bacula/src/win32/lib/workq.cpp @@ -0,0 +1 @@ +#include "../../lib/workq.c" diff --git a/bacula/src/win32/util.nsh b/bacula/src/win32/util.nsh new file mode 100644 index 0000000000..7477d03d7e --- /dev/null +++ b/bacula/src/win32/util.nsh @@ -0,0 +1,95 @@ +; GetWindowsVersion + ; + ; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/ + ; Returns on top of stack + ; + ; Windows Version (95, 98, ME, NT x.x, 2000, XP, .NET Server) + ; or + ; '' (Unknown Windows Version) + ; + ; Usage: + ; Call GetWindowsVersion + ; Pop $R0 + ; ; at this point $R0 is "NT 4.0" or whatnot + + + Function IsNT + Push $R0 + Push $R1 + ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + StrCmp $R0 "" 0 lbl_winnt + + StrCpy $R0 'false' + Goto lbl_done + + lbl_winnt: + Strcpy $R0 'true' + + lbl_done: + Pop $R1 + Exch $R0 + FunctionEnd + + Function GetWindowsVersion + Push $R0 + Push $R1 + ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + StrCmp $R0 "" 0 lbl_winnt + ; we are not NT. + ReadRegStr $R0 HKLM SOFTWARE\Microsoft\Windows\CurrentVersion VersionNumber + + StrCpy $R1 $R0 1 + StrCmp $R1 '4' 0 lbl_error + + StrCpy $R1 $R0 3 + + StrCmp $R1 '4.0' lbl_win32_95 + StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98 + + lbl_win32_95: + StrCpy $R0 '95' + Goto lbl_done + + lbl_win32_98: + StrCpy $R0 '98' + Goto lbl_done + + lbl_win32_ME: + StrCpy $R0 'ME' + Goto lbl_done + + lbl_winnt: + + StrCpy $R1 $R0 1 + + StrCmp $R1 '3' lbl_winnt_x + StrCmp $R1 '4' lbl_winnt_x + + StrCpy $R1 $R0 3 + + StrCmp $R1 '5.0' lbl_winnt_2000 + StrCmp $R1 '5.1' lbl_winnt_XP + StrCmp $R1 '5.2' lbl_winnt_dotNET lbl_error + + lbl_winnt_x: + StrCpy $R0 "NT $R0" 6 + Goto lbl_done + + lbl_winnt_2000: + Strcpy $R0 '2000' + Goto lbl_done + + lbl_winnt_XP: + Strcpy $R0 'XP' + Goto lbl_done + + lbl_winnt_dotNET: + Strcpy $R0 '.NET Server' + Goto lbl_done + + lbl_error: + Strcpy $R0 '' + lbl_done: + Pop $R1 + Exch $R0 + FunctionEnd