grim/gplate

finished removing the autotools stuff

2010-06-26, Gary Kramlich
d3740073064d
finished removing the autotools stuff

refs #11
/*
* Copyright (C) 2007-2008 Gary Kramlich <grim@reaperworld.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif /* HAVE_CONFIG_H */
#include <gplate/gplate-iterator.h>
/******************************************************************************
* GPlateIterator API
*****************************************************************************/
GType
gplate_iterator_get_gtype(void) {
static GType type = 0;
if(type == 0) {
static const GTypeInfo info = {
sizeof(GPlateIteratorIface),
NULL,
NULL,
NULL,
NULL,
NULL,
0,
0,
NULL,
};
type = g_type_register_static(G_TYPE_INTERFACE, "GPlateIterator",
&info, 0);
}
return type;
}
/**
* gplate_iterator_has_next:
* @iter: The #GPlateIterator.
*
* Checks whether or not the iterator has another element.
*
* Return Value: TRUE if there is another element, otherwise FALSE.
*/
gboolean
gplate_iterator_has_next(const GPlateIterator *iter) {
GPlateIteratorIface *iface = NULL;
g_return_val_if_fail(GPLATE_IS_ITERATOR(iter), FALSE);
iface = GPLATE_ITERATOR_GET_IFACE(iter);
if(iface && iface->has_next)
return iface->has_next(iter);
return FALSE;
}
/**
* gplate_iterator_next:
* @iter: The #GPlateIterator.
*
* Advances @iter to the next element and returns that element.
*
* Return Value: The next element in the iteration or NULL.
*/
GPlateVariable *
gplate_iterator_next(GPlateIterator *iter) {
GPlateIteratorIface *iface = NULL;
g_return_val_if_fail(GPLATE_IS_ITERATOR(iter), NULL);
if(!gplate_iterator_has_next(iter))
return NULL;
iface = GPLATE_ITERATOR_GET_IFACE(iter);
if(iface && iface->next)
return iface->next(iter);
return NULL;
}