コード例 #1
0
ファイル: linboxing.c プロジェクト: fingolfin/gap-osx-binary
/**
Print a GAP error message. This is called from the exception handlers,
and shouldn't cause any further memory allocation (except maybe in GAP - 
depending on how \c ErrorMayQuit works. The message 
printed is <tt>type: message</tt> unless \a type is empty, in which 
case just \a message is printed.
@param type The type of the error (e.g. %LinBox or system)
@param message The message, usually as reported by \c e.what()
**/
void PrintGAPError(const char* type, const char* message)
{
  static const size_t max_error = 256;
  char mess[max_error];
  if(type[0] != 0)
  {
    snprintf(mess, max_error, "%s: %s", type, message);
    mess[max_error-1] = 0;
    ErrorMayQuit(mess, 0L, 0L);
  }
  else
    ErrorMayQuit(message, 0L, 0L);
}
コード例 #2
0
ファイル: ariths.c プロジェクト: embray/gap
/****************************************************************************
**
*F  InUndefined( <self>, <opL>, <opR> ) . . . . . . . . . . . . . cannot 'in'
*/
Int InUndefined (
    Obj                 opL,
    Obj                 opR )
{
    ErrorMayQuit("operations: IN of %s and %s is not defined",
                 (Int)TNAM_OBJ(opL), (Int)TNAM_OBJ(opR));
}
コード例 #3
0
ファイル: libgap-api.c プロジェクト: laurentbartholdi/gap
double GAP_ValueMacFloat(Obj obj)
{
    if (!IS_MACFLOAT(obj)) {
        ErrorMayQuit("<obj> is not a MacFloat", 0, 0);
    }
    return (double)VAL_MACFLOAT(obj);
}