src/query_constraint.c

00001 /* 
00002  * Copyright (C) 2005 Jukka Zitting <jz@yukatan.fi>
00003  *
00004  * This program is free software; you can redistribute it and/or modify it
00005  * under the terms of the GNU Lesser General Public License as published
00006  * by the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018 
00019 #include <config.h>
00020 #include "query_constraint.h"
00021 
00022 static void add_sql(MidgardQueryConstraint *constraint, GString *sql) {
00023         g_assert(constraint);
00024         g_assert(sql);
00025         g_string_append(sql, "1=1");
00026 }
00027 
00028 G_DEFINE_TYPE(MidgardQueryConstraint, midgard_query_constraint, G_TYPE_OBJECT)
00029 
00030 static void midgard_query_constraint_init(MidgardQueryConstraint *self) {
00031         g_assert(self);
00032 }
00033 
00034 static void midgard_query_constraint_class_init(
00035                 MidgardQueryConstraintClass *klass) {
00036         g_assert(klass);
00037         klass->add_sql = add_sql;
00038 }
00039 
00040 void midgard_query_constraint_add_sql(
00041                 MidgardQueryConstraint *constraint, GString *sql) {
00042         g_assert(constraint);
00043         g_assert(sql);
00044         MIDGARD_QUERY_CONSTRAINT_GET_CLASS(constraint)->add_sql(constraint, sql);
00045 }

Generated on Thu Feb 22 06:15:18 2007 for midgard-core by  doxygen 1.4.6