Branch: Tag:

1999-03-02

1999-03-02 22:46:52 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added imap_check_array() for debug purposes.

Rev: lib/modules/Protocols.pmod/IMAP.pmod/types.pmod:1.7

33:   #endif /* 0 */   }    + array imap_check_array(array a) + { +  return(Array.filter(a, lambda(mixed item) { +  if (!item || stringp(item) || objectp(item)) { +  return 1; +  } +  werror(describe_backtrace( +  sprintf("Bad array element %O\n", +  item), backtrace())); +  return 0; +  })); + } +    /* Output types */   class imap_atom   {
83:   {    array data;    -  void create(array a) { data = a; } +  void create(array a) { data = imap_check_array(a); }       string format() { return "(" + imap_format_array(data) + ")"; }   }
92:   {    array data;    -  void create(array a) { data = a; } +  void create(array a) { data = imap_check_array(a); }       string format() { return "[" + imap_format_array(data) + "]"; }   }