struct mailimap_set * mailimap_set_new_interval(uint32_t first, uint32_t last)
{
  struct mailimap_set_item * item;
  struct mailimap_set * set;

  item = mailimap_set_item_new(first, last);
  if (item == NULL)
    return NULL;

  set = mailimap_set_new_single_item(item);
  if (set == NULL) {
    mailimap_set_item_free(item);
    return NULL;
  }

  return set;
}
int mailimap_set_add_interval(struct mailimap_set * set,
			      uint32_t first, uint32_t last)
{
  struct mailimap_set_item * item;
  int r;
  
  item = mailimap_set_item_new(first, last);
  if (item == NULL)
    return MAILIMAP_ERROR_MEMORY;

  r = mailimap_set_add(set, item);
  if (r != MAILIMAP_NO_ERROR) {
    mailimap_set_item_free(item);
    return r;
  }
  else
    return MAILIMAP_NO_ERROR;
}
Example #3
0
LIBETPAN_EXPORT
struct mailimap_set_item * mailimap_set_item_new_single(uint32_t indx)
{
  return mailimap_set_item_new(indx, indx);
}