示例#1
0
文件: mio.c 项目: Dev0Null/ctags
/*
 * mem_try_ensure_space:
 * @mio: A #MIO object
 * @n: Requested size from the current (cursor) position
 *
 * Tries to ensure there is enough space for @n bytes to be written from the
 * current cursor position.
 *
 * Returns: %TRUE if there is enough space, %FALSE otherwise.
 */
static int mem_try_ensure_space (MIO *mio, size_t n)
{
	int success = TRUE;

	if (mio->impl.mem.pos + n > mio->impl.mem.size)
		success = mem_try_resize (mio, mio->impl.mem.pos + n);

	return success;
}
示例#2
0
/*
 * mem_try_ensure_space:
 * @mio: A #MIO object
 * @n: Requested size from the current (cursor) position
 * 
 * Tries to ensure there is enough space for @n bytes to be written from the
 * current cursor position.
 * 
 * Returns: %TRUE if there is enough space, %FALSE otherwise.
 */
static gboolean
mem_try_ensure_space (MIO  *mio,
                      gsize n)
{
  gboolean success = TRUE;
  
  if (mio->impl.mem.pos + n > mio->impl.mem.size) {
    success = mem_try_resize (mio, mio->impl.mem.pos + n);
  }
  
  return success;
}