summaryrefslogtreecommitdiffstats
path: root/mpn.h
diff options
context:
space:
mode:
Diffstat (limited to 'mpn.h')
-rw-r--r--mpn.h78
1 files changed, 0 insertions, 78 deletions
diff --git a/mpn.h b/mpn.h
deleted file mode 100644
index 98f4883..0000000
--- a/mpn.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* ----------------------------------------------------------------------- *
- *
- * Copyright 2007 H. Peter Anvin - All Rights Reserved
- *
- * This program 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, Inc.,
- * 59 Temple Place Ste 330, Boston MA 02111-1307, USA; version 2.1,
- * incorporated herein by reference.
- *
- * ----------------------------------------------------------------------- */
-
-/*
- * mpn.h
- *
- * Simple multi-precision signed integer library
- */
-
-#ifndef MPN_H
-#define MPN_H
-
-#include <stddef.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <inttypes.h>
-
-/* Configurables */
-
-#define MPN_ATOM_BITS 32
-#define MPN_ATOM_xFMT "08"PRIx32
-typedef uint32_t mpn_atom_t;
-typedef uint64_t mpn_2atom_t;
-typedef int32_t mpn_satom_t;
-typedef int64_t mpn_2satom_t;
-
-struct mpn {
- int ref;
- int len;
- int bits;
- int minus;
- mpn_atom_t num[1];
-};
-
-
-#define _mpn_malloc(x) malloc(x)
-#define _mpn_zalloc(x) calloc(x,1)
-#define _mpn_free(x) free(x)
-#define _mpn_realloc(x,y) realloc(x,y)
-
-#define mpn_ref(x) ((x)->ref++, (x))
-
-#if defined(__GNUC__) && !defined(MPN_INIT)
-extern inline void mpn_free(struct mpn *__mpn)
-{
- if (! --__mpn->ref)
- _mpn_free(__mpn);
-}
-#else
-void mpn_free(struct mpn *);
-#endif
-struct mpn *mpn_addsub(struct mpn *, struct mpn *, int issub);
-#define mpn_add(x,y) mpn_addsub(x,y,0)
-#define mpn_sub(x,y) mpn_addsub(x,y,1)
-int mpn_cmp(struct mpn *, struct mpn *);
-struct mpn *mpn_mul(struct mpn *, struct mpn *);
-struct mpn *mpn_shr(struct mpn *, int);
-struct mpn *mpn_shl(struct mpn *, int);
-void mpn_dump(FILE *, struct mpn *);
-struct mpn *mpn_int(mpn_satom_t);
-struct mpn *mpn_new(int);
-struct mpn *mpn_dup(const struct mpn *);
-struct mpn *mpn_dupx(const struct mpn *, int);
-struct mpn *mpn_cow(struct mpn *, int);
-
-/* Internal functions */
-void _mpn_adjust_bits(struct mpn *mpn);
-
-#endif /* MPN_H */