2 * Copyright (C) 2008 OpenedHand Ltd.
4 * Authors: Jorn Baayen <jorn@openedhand.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 #include <libgupnp-av/gupnp-search-criteria-parser.h>
26 begin_parens_cb (GUPnPSearchCriteriaParser *parser,
33 end_parens_cb (GUPnPSearchCriteriaParser *parser,
40 conjunction_cb (GUPnPSearchCriteriaParser *parser,
47 disjunction_cb (GUPnPSearchCriteriaParser *parser,
54 expression_cb (GUPnPSearchCriteriaParser *parser,
56 GUPnPSearchCriteriaOp op,
61 g_print ("%s %d %s", property, op, value);
67 main (int argc, char **argv)
69 GUPnPSearchCriteriaParser *parser;
74 #if !GLIB_CHECK_VERSION (2, 35, 0)
78 parser = gupnp_search_criteria_parser_new ();
80 g_signal_connect (parser,
82 G_CALLBACK (begin_parens_cb),
84 g_signal_connect (parser,
86 G_CALLBACK (end_parens_cb),
88 g_signal_connect (parser,
90 G_CALLBACK (conjunction_cb),
92 g_signal_connect (parser,
94 G_CALLBACK (disjunction_cb),
96 g_signal_connect (parser,
98 G_CALLBACK (expression_cb),
102 gupnp_search_criteria_parser_parse_text (parser, argv[1], &error);
104 g_printerr ("Parse error: %s\n", error->message);
105 g_error_free (error);
111 g_object_unref (parser);