1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

First steps towards supporting W32.

This is mainly source code reorganization.
Update gnulib.
g10/ does currently not build.
This commit is contained in:
Werner Koch 2007-06-06 18:12:30 +00:00
parent c2b08ff908
commit 2c9791db55
116 changed files with 2722 additions and 5565 deletions

View file

@ -1,3 +1,21 @@
2007-06-06 Werner Koch <wk@g10code.com>
* passphrase.c (passphrase_get) [!ENABLE_NLS]: Do not define
orig_codeset.
* Makefile.am (gpgv2_LDADD, gpg2_LDADD): Include LDADD before
libgcrypt.
* plaintext.c (handle_plaintext): Replace eof by eof_seen as W32's
io.h has a symbol with that name.
* misc.c: Do not include dynload.h.
(w32_shgetfolderpath): Remove. It is now in common/homedir.c.
* gpgv.c (i18n_init): Remove.
* gpg.c (i18n_init): Remove.
(main): Make --load-extension a dummy
2007-05-19 Marcus Brinkmann <marcus@g10code.de>
* passphrase.c (passphrase_get): Use PACKAGE_GT, not PACKAGE.

View file

@ -119,9 +119,9 @@ gpgv2_SOURCES = gpgv.c \
LDADD = $(needed_libs) ../common/libgpgrl.a \
$(ZLIBS) $(DNSLIBS) $(LIBREADLINE) \
$(LIBINTL) $(CAPLIBS) $(NETLIBS)
gpg2_LDADD = $(LIBGCRYPT_LIBS) $(LDADD) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
gpg2_LDADD = $(LDADD) $(LIBGCRYPT_LIBS)$(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
$(LIBICONV)
gpgv2_LDADD = $(LIBGCRYPT_LIBS) $(LDADD) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
gpgv2_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
$(LIBICONV)
$(PROGRAMS): $(needed_libs) ../common/libgpgrl.a

View file

@ -870,20 +870,6 @@ build_list( const char *text, char letter,
}
static void
i18n_init(void)
{
#ifdef USE_SIMPLE_GETTEXT
set_gettext_file (PACKAGE_GT, "Software\\GNU\\GnuPG");
#else
#ifdef ENABLE_NLS
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE_GT, LOCALEDIR);
textdomain (PACKAGE_GT);
#endif
#endif
}
static void
wrong_args( const char *text)
{
@ -2260,18 +2246,8 @@ main (int argc, char **argv )
}
break;
case oLoadExtension:
#ifndef __riscos__
#if defined(USE_DYNAMIC_LINKING) || defined(_WIN32)
if(check_permissions(pargs.r.ret_str,2))
log_info(_("cipher extension `%s' not loaded due to"
" unsafe permissions\n"),pargs.r.ret_str);
else
register_cipher_extension(orig_argc? *orig_argv:NULL,
pargs.r.ret_str);
#endif
#else /* __riscos__ */
riscos_not_implemented("load-extension");
#endif /* __riscos__ */
/* Dummy so that gpg 1.4 conf files can work. Should
eventually be removed. */
break;
case oRFC1991:
opt.compliance = CO_RFC1991;

View file

@ -110,21 +110,6 @@ my_strusage( int level )
}
static void
i18n_init(void)
{
#ifdef USE_SIMPLE_GETTEXT
set_gettext_file (PACKAGE_GT, "Software\\GNU\\GnuPG");
#else
#ifdef ENABLE_NLS
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE_GT, LOCALEDIR);
textdomain (PACKAGE_GT);
#endif
#endif
}
int
main( int argc, char **argv )

View file

@ -58,7 +58,6 @@
#include "gpg.h"
#ifdef HAVE_W32_SYSTEM
# include "errors.h"
# include "dynload.h"
#endif /*HAVE_W32_SYSTEM*/
#include "util.h"
#include "main.h"
@ -1225,46 +1224,6 @@ is_valid_mailbox (const char *name)
}
/* This is a helper function to load a Windows function from either of
one DLLs. */
#ifdef HAVE_W32_SYSTEM
static HRESULT
w32_shgetfolderpath (HWND a, int b, HANDLE c, DWORD d, LPSTR e)
{
static int initialized;
static HRESULT (WINAPI * func)(HWND,int,HANDLE,DWORD,LPSTR);
if (!initialized)
{
static char *dllnames[] = { "shell32.dll", "shfolder.dll", NULL };
void *handle;
int i;
initialized = 1;
for (i=0, handle = NULL; !handle && dllnames[i]; i++)
{
handle = dlopen (dllnames[i], RTLD_LAZY);
if (handle)
{
func = dlsym (handle, "SHGetFolderPathA");
if (!func)
{
dlclose (handle);
handle = NULL;
}
}
}
}
if (func)
return func (a,b,c,d,e);
else
return -1;
}
#endif /*HAVE_W32_SYSTEM*/
/* Return the name of the libexec directory. The name is allocated in
a static area on the first use. This function won't fail. */
const char *

View file

@ -259,7 +259,9 @@ passphrase_get ( u32 *keyid, int mode, const char *cacheid,
PKT_public_key *pk = xmalloc_clear( sizeof *pk );
byte fpr[MAX_FINGERPRINT_LEN];
int have_fpr = 0;
#ifdef ENABLE_NLS
char *orig_codeset = NULL;
#endif
char *my_prompt;
char hexfprbuf[20*2+1];
const char *my_cacheid;

View file

@ -297,8 +297,9 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
}
else { /* binary mode */
byte *buffer = xmalloc( 32768 );
int eof;
for( eof=0; !eof; ) {
int eof_seen = 0;
while ( !eof_seen ) {
/* Why do we check for len < 32768:
* If we won't, we would practically read 2 EOFs but
* the first one has already popped the block_filter
@ -309,7 +310,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
if( len == -1 )
break;
if( len < 32768 )
eof = 1;
eof_seen = 1;
if( mfx->md )
gcry_md_write ( mfx->md, buffer, len );
if( fp )