Index: coeffs/coeffs.h
===================================================================
--- coeffs/coeffs.h	(revision 97d8a41a15dadbaebb9ddaa1705f32a135ccb013)
+++ coeffs/coeffs.h	(revision 94b759538cb1a505c9d4edbb1d0fd18f045dc2fe)
@@ -15,4 +15,12 @@
 #define NULL        (0)
 #endif
+
+// #ifdef _TRY
+#ifndef ABS
+#define ABS(x) ((x)<0?(-(x)):(x))
+#endif
+// #endif
+
+
 
 #if (SIZEOF_LONG == 8)
@@ -83,8 +91,10 @@
 struct snumber;
 typedef struct snumber *   number;
-typedef number (*numberfunc)(number a,number b, const coeffs r);
-typedef number (*nMapFunc)(number a, const coeffs r);
-
-#define _TRY
+typedef number (*numberfunc)(number a, number b, const coeffs r);
+
+/// maps "a" from aRing into r
+typedef number (*nMapFunc)(number a, const coeffs r, const coeffs aRing);
+
+// #define _TRY
 
 #ifdef _TRY
@@ -114,4 +124,5 @@
    #endif
    // Zp_a, Q_a
+   // ?
 
    // general stuff
@@ -192,7 +203,12 @@
   short      float_len; /* additional char-flags, rInit */
   short      float_len2; /* additional char-flags, rInit */
-
 };
 
+/// Returns the type of coeffs domain
+static inline n_coeffType getCoeffType(const coeffs r)
+{
+  return r->type;
+}
+
 #define  nInternalChar(r) ((r)->ch)
 
Index: coeffs/gnumpc.cc
===================================================================
--- coeffs/gnumpc.cc	(revision 97d8a41a15dadbaebb9ddaa1705f32a135ccb013)
+++ coeffs/gnumpc.cc	(revision 94b759538cb1a505c9d4edbb1d0fd18f045dc2fe)
@@ -19,9 +19,26 @@
 #include "omalloc.h"
 
-extern size_t gmp_output_digits;
-
-
-number ngcMapQ(number from, const coeffs)
-{
+
+#ifdef LDEBUG
+// not yet implemented
+BOOLEAN ngcDBTest(number a, const char *f, const int l, const coeffs r)
+{
+  assume( getCoeffType(r) == ID );
+
+  return TRUE;
+}
+#endif
+
+#ifndef assume
+#  define assume(a) if(!(a)){ Werror( "Assumption: is wrong: %s\n", #a ); };
+#endif
+
+const n_coeffType ID = n_long_C;
+
+number ngcMapQ(number from, const coeffs r, const coeffs aRing)
+{
+  assume( getCoeffType(r) == ID );
+  assume( getCoeffType(aRing) == n_Q );
+
   if ( from != NULL )
   {
@@ -32,15 +49,10 @@
     return NULL;
 }
-union nf
-{
-  float _f;
-  number _n;
-  nf(float f) {_f = f;}
-  nf(number n) {_n = n;}
-  float F() const {return _f;}
-  number N() const {return _n;}
-};
-static number ngcMapLongR(number from, const coeffs)
-{
+
+static number ngcMapLongR(number from, const coeffs r, const coeffs aRing)
+{
+  assume( getCoeffType(r) == ID );
+  assume( getCoeffType(aRing) == n_long_R );
+  
   if ( from != NULL )
   {
@@ -51,6 +63,20 @@
     return NULL;
 }
-static number ngcMapR(number from, const coeffs)
-{
+
+static number ngcMapR(number from, const coeffs r, const coeffs aRing)
+{
+  assume( getCoeffType(r) == ID );
+  assume( getCoeffType(aRing) == n_R );
+
+  union nf
+  {
+    float _f;
+    number _n;
+    nf(float f) {_f = f;}
+    nf(number n) {_n = n;}
+    float F() const {return _f;}
+    number N() const {return _n;}
+  };
+
   if ( from != NULL )
   {
@@ -61,34 +87,54 @@
     return NULL;
 }
-extern ring ngfMapRing;
-static number ngcMapP(number from, const coeffs)
-{
+
+static number ngcMapP(number from, const coeffs r, const coeffs aRing)
+{
+  assume( getCoeffType(r) == ID );
+  assume( getCoeffType(aRing) ==  n_Zp );
+  
   if ( from != NULL)
-    return ngcInit(npInt(from,ngfMapRing), currRing);
+    return ngcInit(npInt(from, aRing), r);
   else
     return NULL;
 }
 
-nMapFunc ngcSetMap(const coeffs src,const coeffs dst)
-{
-  if(rField_is_Q(src))
+
+
+static number ngcCopyMap(number from, const coeffs r, const coeffs aRing)
+{
+  assume( getCoeffType(r) == ID );
+  assume( getCoeffType(aRing) ==  ID );
+
+  gmp_complex* b = NULL;
+  
+  if ( from !=  NULL )
+  { 
+    b = new gmp_complex( *(gmp_complex*)from );
+  }
+  return (number)b;  
+}
+
+nMapFunc ngcSetMap(const coeffs src/*, const coeffs dst */)
+{
+//  assume( getCoeffType(dst) == ID );
+  
+  if(nField_is_Q(src))
   {
     return ngcMapQ;
   }
-  if (rField_is_long_R(src))
+  if (nField_is_long_R(src))
   {
     return ngcMapLongR;
   }
-  if (rField_is_long_C(src))
-  {
-    return ngcCopy;
-  }
-  if(rField_is_R(src))
+  if (nField_is_long_C(src))
+  {
+    return ngcCopyMap;
+  }
+  if(nField_is_R(src))
   {
     return ngcMapR;
   }
-  if (rField_is_Zp(src))
-  {
-    ngfMapRing=src;
+  if (nField_is_Zp(src))
+  {
     return ngcMapP;
   }
@@ -96,6 +142,10 @@
 }
 
-number   ngcPar(int i)
-{
+
+
+number   ngcPar(int i, const coeffs r)
+{
+  assume( getCoeffType(r) == ID );
+
   gmp_complex* n= new gmp_complex( (long)0, (long)1 );
   return (number)n;
@@ -107,5 +157,8 @@
 number ngcInit (int i, const coeffs r)
 {
+  assume( getCoeffType(r) == ID );
+  
   gmp_complex* n= new gmp_complex( (long)i, (long)0 );
+  
   return (number)n;
 }
@@ -116,4 +169,6 @@
 int ngcInt(number &i, const coeffs r)
 {
+  assume( getCoeffType(r) == ID );
+  
   return (int)((gmp_complex*)i)->real();
 }
@@ -139,4 +194,6 @@
 void ngcDelete (number * a, const coeffs r)
 {
+  assume( getCoeffType(r) == ID );
+
   if ( *a != NULL )
   {
@@ -149,22 +206,20 @@
  * copy a to b
 */
-number ngcCopy(number a, const coeffs)
-{
+number ngcCopy(number a, const coeffs r)
+{
+  assume( getCoeffType(r) == ID );
+  
   gmp_complex* b= new gmp_complex( *(gmp_complex*)a );
   return (number)b;
 }
-number ngc_Copy(number a, const coeffs r)
-{
-  gmp_complex* b=new gmp_complex( *(gmp_complex*)a );
-  return (number)b;
-}
+
 
 /*2
 * za:= - za
 */
-gmp_complex ngc_m1(-1);
-
-number ngcNeg (number a, const coeffs)
-{
+number ngcNeg (number a, const coeffs R)
+{
+  assume( getCoeffType(R) == ID );
+
   gmp_complex* r=(gmp_complex*)a;
   (*r) *= ngc_m1;
@@ -175,6 +230,8 @@
 * 1/a
 */
-number ngcInvers(number a, const coeffs)
-{
+number ngcInvers(number a, const coeffs R)
+{
+  assume( getCoeffType(R) == ID );
+
   gmp_complex* r = NULL;
   if (((gmp_complex*)a)->isZero())
@@ -184,7 +241,7 @@
   else
   {
-    r= new gmp_complex( (gmp_complex)1 / (*(gmp_complex*)a) );
-  }
-  return (number)r;
+    b = new gmp_complex( (gmp_complex)1 / (*(gmp_complex*)a) );
+  }
+  return (number)b;
 }
 
@@ -192,6 +249,8 @@
 * u:= a + b
 */
-number ngcAdd (number a, number b, const coeffs)
-{
+number ngcAdd (number a, number b, const coeffs R)
+{
+  assume( getCoeffType(R) == ID );
+
   gmp_complex* r= new gmp_complex( (*(gmp_complex*)a) + (*(gmp_complex*)b) );
   return (number)r;
@@ -203,4 +262,6 @@
 number ngcSub (number a, number b, const coeffs R)
 {
+  assume( getCoeffType(R) == ID );
+
   gmp_complex* r= new gmp_complex( (*(gmp_complex*)a) - (*(gmp_complex*)b) );
   return (number)r;
@@ -210,6 +271,8 @@
 * u := a * b
 */
-number ngcMult (number a, number b)
-{
+number ngcMult (number a, number b, const coeffs R)
+{
+  assume( getCoeffType(R) == ID );
+  
   gmp_complex* r= new gmp_complex( (*(gmp_complex*)a) * (*(gmp_complex*)b) );
   return (number)r;
@@ -219,6 +282,8 @@
 * u := a / b
 */
-number ngcDiv (number a, number b, const coeffs)
-{
+number ngcDiv (number a, number b, const coeffs r)
+{
+  assume( getCoeffType(r) == ID );
+
   if (((gmp_complex*)b)->isZero())
   {
@@ -227,6 +292,6 @@
     return NULL;
   }
-  gmp_complex* r= new gmp_complex( (*(gmp_complex*)a) / (*(gmp_complex*)b) );
-  return (number)r;
+  gmp_complex* res = new gmp_complex( (*(gmp_complex*)a) / (*(gmp_complex*)b) );
+  return (number)res;
 }
 
@@ -234,6 +299,8 @@
 * u:= x ^ exp
 */
-void ngcPower ( number x, int exp, number * u, const coeffs R)
-{
+void ngcPower ( number x, int exp, number * u, const coeffs r)
+{
+  assume( getCoeffType(r) == ID );
+
   if ( exp == 0 )
   {
@@ -244,5 +311,5 @@
   else if ( exp == 1 )
   {
-    nNew(u);
+    n_New(u, r);
     gmp_complex* n = new gmp_complex();
     *n= *(gmp_complex*)x;
@@ -252,5 +319,5 @@
   else if (exp == 2)
   {
-    nNew(u);
+    n_New(u, r);
     gmp_complex* n = new gmp_complex();
     *n= *(gmp_complex*)x;
@@ -261,6 +328,6 @@
   if (exp&1==1)
   {
-    ngcPower(x,exp-1,u, R);
-    gmp_complex *n=new gmp_complex();
+    ngcPower(x,exp-1,u, r);
+    gmp_complex *n = new gmp_complex();
     *n=*(gmp_complex*)x;
     *(gmp_complex*)(*u) *= *(gmp_complex*)n;
@@ -270,24 +337,30 @@
   {
     number w;
-    nNew(&w);
-    ngcPower(x,exp/2,&w, R);
-    ngcPower(w,2,u, R);
-    nDelete(&w);
-  }
-}
-
-BOOLEAN ngcIsZero (number a, const coeffs)
-{
+    n_New(&w, r);
+    ngcPower(x,exp/2,&w, r);
+    ngcPower(w,2,u, r);
+    n_Delete(&w, r);
+  }
+}
+
+BOOLEAN ngcIsZero (number a, const coeffs r)
+{
+  assume( getCoeffType(r) == ID );
+
   return ( ((gmp_complex*)a)->real().isZero() && ((gmp_complex*)a)->imag().isZero());
 }
 
-number ngcRePart(number a, const coeffs)
-{
+number ngcRePart(number a, const coeffs r)
+{
+  assume( getCoeffType(r) == ID );
+
   gmp_complex* n = new gmp_complex(((gmp_complex*)a)->real());
   return (number)n;
 }
 
-number ngcImPart(number a, const coeffs)
-{
+number ngcImPart(number a, const coeffs r)
+{
+  assume( getCoeffType(r) == ID );
+
   gmp_complex* n = new gmp_complex(((gmp_complex*)a)->imag());
   return (number)n;
@@ -297,6 +370,8 @@
 * za >= 0 ?
 */
-BOOLEAN ngcGreaterZero (number a, const coeffs)
-{
+BOOLEAN ngcGreaterZero (number a, const coeffs r)
+{
+  assume( getCoeffType(r) == ID );
+
   if ( ! ((gmp_complex*)a)->imag().isZero() )
     return ( abs( *(gmp_complex*)a).sign() >= 0 );
@@ -308,6 +383,8 @@
 * a > b ?
 */
-BOOLEAN ngcGreater (number a, number b, const coeffs)
-{
+BOOLEAN ngcGreater (number a, number b, const coeffs r)
+{
+  assume( getCoeffType(r) == ID );
+
   gmp_complex *aa=(gmp_complex*)a;
   gmp_complex *bb=(gmp_complex*)b;
@@ -318,6 +395,8 @@
 * a = b ?
 */
-BOOLEAN ngcEqual (number a, number b, const coeffs)
-{
+BOOLEAN ngcEqual (number a, number b, const coeffs r)
+{
+  assume( getCoeffType(r) == ID );
+
   gmp_complex *aa=(gmp_complex*)a;
   gmp_complex *bb=(gmp_complex*)b;
@@ -328,6 +407,8 @@
 * a == 1 ?
 */
-BOOLEAN ngcIsOne (number a, const coeffs)
-{
+BOOLEAN ngcIsOne (number a, const coeffs r)
+{
+  assume( getCoeffType(r) == ID );
+
   return (((gmp_complex*)a)->real().isOne() && ((gmp_complex*)a)->imag().isZero());
   //return (((gmp_complex*)a)->real().isOne());
@@ -337,6 +418,8 @@
 * a == -1 ?
 */
-BOOLEAN ngcIsMOne (number a, const coeffs)
-{
+BOOLEAN ngcIsMOne (number a, const coeffs r)
+{
+  assume( getCoeffType(r) == ID );
+
   return (((gmp_complex*)a)->real().isMOne() && ((gmp_complex*)a)->imag().isZero());
   //return (((gmp_complex*)a)->real().isMOne());
@@ -346,17 +429,19 @@
 * extracts the number a from s, returns the rest
 */
-const char * ngcRead (const char * s, number * a, const coeffs R)
-{
+const char * ngcRead (const char * s, number * a, const coeffs r)
+{
+  assume( getCoeffType(r) == ID );
+  
   if ((*s >= '0') && (*s <= '9'))
   {
     gmp_float *re=NULL;
-    s=ngfRead(s,(number *)&re, R);
+    s=ngfRead(s,(number *)&re, r);
     gmp_complex *aa=new gmp_complex(*re);
     *a=(number)aa;
     delete re;
   }
-  else if (strncmp(s,currRing->parameter[0],strlen(currRing->parameter[0]))==0)
-  {
-    s+=strlen(currRing->parameter[0]);
+  else if (strncmp(s, r->parameter[0],strlen(r->parameter[0]))==0)
+  {
+    s+=strlen(r->parameter[0]);
     gmp_complex *aa=new gmp_complex((long)0,(long)1);
     *a=(number)aa;
@@ -369,4 +454,6 @@
 }
 
+
+
 /*2
 * write a floating point number
@@ -374,4 +461,8 @@
 void ngcWrite (number &a, const coeffs r)
 {
+  assume( getCoeffType(r) == ID );
+
+  extern size_t gmp_output_digits; /// comes from mpr_complex.cc
+
   if (a==NULL)
     StringAppendS("0");
@@ -379,5 +470,5 @@
   {
     char *out;
-    out= complexToStr(*(gmp_complex*)a,gmp_output_digits);
+    out= complexToStr(*(gmp_complex*)a, gmp_output_digits);
     StringAppendS(out);
     //    omFreeSize((void *)out, (strlen(out)+1)* sizeof(char) );
@@ -385,12 +476,4 @@
   }
 }
-
-#ifdef LDEBUG
-// not yet implemented
-//BOOLEAN ngcDBTest(number a, const char *f, const int l)
-//{
-//  return TRUE;
-//}
-#endif
 
 // local Variables: ***
Index: coeffs/gnumpc.h
===================================================================
--- coeffs/gnumpc.h	(revision 97d8a41a15dadbaebb9ddaa1705f32a135ccb013)
+++ coeffs/gnumpc.h	(revision 94b759538cb1a505c9d4edbb1d0fd18f045dc2fe)
@@ -26,5 +26,5 @@
 number   ngcDiv(number a, number b, const coeffs r);
 void     ngcPower(number x, int exp, number *lu, const coeffs r);
-number   ngcCopy(number a, const coeffs);
+number   ngcCopy(number a, const coeffs r);
 number   ngc_Copy(number a, coeffs r);
 const char * ngcRead (const char *s, number *a, const coeffs r);
@@ -33,13 +33,16 @@
 number   ngcImPart(number a, const coeffs r);
 
+void     ngcDelete(number *a, const coeffs r);
 
 #ifdef LDEBUG
-BOOLEAN  ngcDBTest(number a, const char *f, const int l, const coeffs);
+BOOLEAN  ngcDBTest(number a, const char *f, const int l, const coeffs r);
 #endif
-void     ngcDelete(number *a, const coeffs r);
 
-nMapFunc  ngcSetMap(const coeffs src, const coeffs dst);
+/// Get a mapping function from src into this domain: long_C
+/// no need in dst!?
+nMapFunc  ngcSetMap(const coeffs src/*, const coeffs dst*/);
 
-number ngcMapQ(number from, const coeffs r);
+// Why is this here? who needs it?
+// number ngcMapQ(number from, const coeffs r, const coeffs aRing);
 #endif
 
Index: coeffs/numbers.h
===================================================================
--- coeffs/numbers.h	(revision 97d8a41a15dadbaebb9ddaa1705f32a135ccb013)
+++ coeffs/numbers.h	(revision 94b759538cb1a505c9d4edbb1d0fd18f045dc2fe)
@@ -51,7 +51,10 @@
 
 #define nTest(a) (1)
-#define nDelete(A) (currRing)->cf->cfDelete(A,currRing)
-#define nGetDenom(N) (currRing->cf->cfGetDenom((N),currRing))
-#define nGetNumerator(N) (currRing->cf->cfGetNumerator((N),currRing))
+
+// please use n_* counterparts instead!!!
+// #define nDelete(A) (currRing)->cf->cfDelete(A,currRing)
+// #define nGetDenom(N) (currRing->cf->cfGetDenom((N),currRing))
+// #define nGetNumerator(N) (currRing->cf->cfGetNumerator((N),currRing))
+
 
 #define nSetMap(R) (currRing->cf->cfSetMap(R,currRing))
@@ -107,12 +110,4 @@
 
 #ifdef _TRY
-#ifndef ABS
-#define ABS(x) ((x)<0?(-(x)):(x))
-#endif
-#endif
-
-
-
-#ifdef _TRY
 #define rField_is_Q(r) nField_is_Q(r)
 #define rField_is_long_R(r) nField_is_long_R(r) 
