/*
 * call-seq:
 *    res.getisnull( tup_num, field_num ) => true or false
 *
 * Returns +true+ if the specified value is +nil+; +false+ otherwise.
 *
 * Equivalent to <tt>res.value(<i>tup_num</i>,<i>field_num</i>)==+nil+</tt>.
 */
static VALUE
pgresult_getisnull(obj, tup_num, field_num)
  VALUE obj, tup_num, field_num;
{
  PGresult *result;
  int i = NUM2INT(tup_num);
  int j = NUM2INT(field_num);

  result = get_pgresult(obj);
  if (i < 0 || i >= PQntuples(result)) {
  rb_raise(rb_eArgError,"invalid tuple number %d", i);
  }
  if (j < 0 || j >= PQnfields(result)) {
  rb_raise(rb_eArgError,"invalid field number %d", j);
  }
  return PQgetisnull(result, i, j) ? Qtrue : Qfalse;
}