1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Update head to match stable 1.0

This commit is contained in:
David Shaw 2002-06-29 13:46:34 +00:00
parent 151ee2f47b
commit 3f51f7db3d
155 changed files with 83872 additions and 37585 deletions

View file

@ -1,5 +1,5 @@
/* mpitest.c - test the mpi functions
* Copyright (C) 1998 Free Software Foundation, Inc.
* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
*
* This is an RPN calculator; values must be given in hex.
* Operation is like dc(1) except that the input/output radix is
@ -28,9 +28,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <gcrypt.h>
#include "util.h"
#include "mpi.h"
#include "i18n.h"
#define STACKSIZE 100
@ -38,8 +38,8 @@ static MPI stack[STACKSIZE];
static int stackidx;
static const char *
my_strusage( int level )
const char *
strusage( int level )
{
const char *p;
switch( level ) {
@ -56,7 +56,7 @@ my_strusage( int level )
"\nSyntax: mpicalc [options] [files]\n"
"MPI RPN calculator\n";
break;
default: p = NULL;
default: p = default_strusage(level);
}
return p;
}
@ -71,35 +71,11 @@ i18n_init(void)
#else
setlocale( LC_ALL, "" );
#endif
bindtextdomain( PACKAGE, GNUPG_LOCALEDIR );
bindtextdomain( PACKAGE, G10_LOCALEDIR );
textdomain( PACKAGE );
#endif
}
int
mpi_print( FILE *fp, MPI a, int mode )
{
int n=0;
if( !a )
return fprintf(fp, "[MPI_NULL]");
if( !mode ) {
unsigned int n1;
n1 = gcry_mpi_get_nbits(a);
n += fprintf(fp, "[%u bits]", n1);
}
else {
int rc;
char *buffer;
rc = gcry_mpi_aprint( GCRYMPI_FMT_HEX, (void **)&buffer, NULL, a );
fputs( buffer, fp );
n += strlen(buffer);
gcry_free( buffer );
}
return n;
}
static void
do_add(void)
@ -257,7 +233,6 @@ main(int argc, char **argv)
pargs.argv = &argv;
pargs.flags = 0;
set_strusage( my_strusage );
i18n_init();
while( arg_parse( &pargs, opts) ) {
switch( pargs.r_opt ) {