source: git/MP/MP/MP_BigNum.c @ 4439165

spielwiese
Last change on this file since 4439165 was 4439165, checked in by Hans Schönemann <hannes@…>, 15 years ago
*hannes: gcc 4.3 git-svn-id: file:///usr/local/Singular/svn/trunk@11873 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.1 KB
Line 
1/****************************************************************
2 *                                                                 
3 * FILE:     MP_BigNum.c
4 * Purpose:  Dummy definition of the default BigNum routines
5 *
6 *  Change Log:
7 *      2/97 obachman Life begins for this file.
8 *
9 ***************************************************************/
10
11#include "MP.h"
12#include <string.h>
13
14MP_BigIntOps_t imp_dummy_bigint_ops =
15{
16  IMP_PutDummyBigInt,
17  IMP_GetDummyBigInt,
18  IMP_DummyBigIntToStr,
19  IMP_DummyBigIntAsciiSize
20};
21
22#if MP_DEFAULT_APINT_FORMAT == MP_DUMMY
23MP_BigIntOps_t imp_default_bigint_ops =
24{
25  IMP_PutDummyBigInt,
26  IMP_GetDummyBigInt,
27  IMP_DummyBigIntToStr,
28  IMP_DummyBigIntAsciiSize
29};
30
31MP_BigNumFormat_t imp_default_bigint_format = MP_DUMMY;
32#endif
33
34MP_BigRealOps_t imp_dummy_bigreal_ops =
35{
36  IMP_PutDummyBigReal,
37  IMP_GetDummyBigReal,
38  IMP_DummyBigRealToStr,
39  IMP_DummyBigRealAsciiSize
40};
41
42#if MP_DEFAULT_APREAL_FORMAT == MP_DUMMY
43MP_BigRealOps_t imp_default_bigreal_ops =
44{
45  IMP_PutDummyBigReal,
46  IMP_GetDummyBigReal,
47  IMP_DummyBigRealToStr,
48  IMP_DummyBigRealAsciiSize
49};
50MP_BigNumFormat_t imp_default_bigreal_format = MP_DUMMY;
51#endif
52
53MP_Status_t IMP_PutDummyBigInt(MP_Link_pt link, MP_ApInt_t dummy)
54{
55  return MP_SetError(link, MP_DummyBigNum);
56}
57
58MP_Status_t IMP_GetDummyBigInt(MP_Link_pt link, MP_ApInt_t *dummy)
59{
60  return MP_SetError(link, MP_DummyBigNum);
61}
62
63#define DUMMY_BIGNUM_STR "MP_DummyBigNum"
64char* IMP_DummyBigIntToStr(MP_ApInt_t dummy, char *buf)
65{
66  strcpy(buf, DUMMY_BIGNUM_STR);
67  return buf;
68}
69
70long IMP_DummyBigIntAsciiSize(MP_ApInt_t dummy)
71{
72  return strlen(DUMMY_BIGNUM_STR) + 1;
73}
74
75MP_Status_t IMP_PutDummyBigReal(MP_Link_pt link, MP_ApReal_t dummy)
76{
77  return MP_SetError(link, MP_DummyBigNum);
78}
79
80MP_Status_t IMP_GetDummyBigReal(MP_Link_pt link, MP_ApReal_t *dummy)
81{
82  return MP_SetError(link, MP_DummyBigNum);
83}
84
85#define DUMMY_BIGNUM_STR "MP_DummyBigNum"
86char* IMP_DummyBigRealToStr(MP_ApReal_t dummy, char *buf)
87{
88  strcpy(buf, "MP_DummyBigNum");
89  return buf;
90}
91
92long IMP_DummyBigRealAsciiSize(MP_ApReal_t dummy)
93{
94  return strlen(DUMMY_BIGNUM_STR) + 1;
95}
96
Note: See TracBrowser for help on using the repository browser.