paramspec-test.c revision f5542c90e3ee184dc9936ec4d816da14d2a2660d
1c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen/* GLIB - Library of useful routines for C programming 2c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * 4c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * This library is free software; you can redistribute it and/or 5c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * modify it under the terms of the GNU Lesser General Public 6c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * License as published by the Free Software Foundation; either 7c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * version 2 of the License, or (at your option) any later version. 8c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * 9c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * This library is distributed in the hope that it will be useful, 10c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * but WITHOUT ANY WARRANTY; without even the implied warranty of 11c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * Lesser General Public License for more details. 13c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * 14c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * You should have received a copy of the GNU Lesser General Public 15c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * License along with this library; if not, write to the 16c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * Boston, MA 02111-1307, USA. 18c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen */ 19c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 20c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen/* 21c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * file for a list of people on the GLib Team. See the ChangeLog 23c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * files for a list of changes. These files are distributed with 24c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen * GLib at ftp://ftp.gtk.org/pub/gtk/. 25c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen */ 26c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 27c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen#undef G_DISABLE_ASSERT 28c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen#undef G_LOG_DOMAIN 29c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 30c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen#include <string.h> 31c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 32c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen#include <glib.h> 33c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen#include <glib-object.h> 34c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 35c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasenstatic void 36c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasentest_param_spec_char (void) 37c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen{ 38c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen GParamSpec *pspec; 39c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen GValue value = { 0, }; 40c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen gboolean modified; 41c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 42c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen pspec = g_param_spec_char ("char", "nick", "blurb", 43c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 20, 40, 30, G_PARAM_READWRITE); 44c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 45c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (strcmp (g_param_spec_get_name (pspec), "char") == 0); 46c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (strcmp (g_param_spec_get_nick (pspec), "nick") == 0); 47c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (strcmp (g_param_spec_get_blurb (pspec), "blurb") == 0); 48c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 49c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_value_init (&value, G_TYPE_CHAR); 50c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_value_set_char (&value, 30); 51c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 52c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (g_param_value_defaults (pspec, &value)); 53c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 54c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_value_set_char (&value, 0); 55c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen modified = g_param_value_validate (pspec, &value); 56c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (modified && g_value_get_char (&value) == 20); 57c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 58c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_value_set_char (&value, 20); 59c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen modified = g_param_value_validate (pspec, &value); 60c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (!modified && g_value_get_char (&value) == 20); 61c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 62c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_value_set_char (&value, 40); 63c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen modified = g_param_value_validate (pspec, &value); 64c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (!modified && g_value_get_char (&value) == 40); 65c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 66c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_value_set_char (&value, 60); 67c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen modified = g_param_value_validate (pspec, &value); 68c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (modified && g_value_get_char (&value) == 40); 69c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 70c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_param_spec_unref (pspec); 71c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen} 72c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 73c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasenstatic void 74325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterertest_param_spec_string (void) 75325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer{ 76325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer GParamSpec *pspec; 77325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer GValue value = { 0, }; 78325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer gboolean modified; 79325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 80325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer pspec = g_param_spec_string ("string", "nick", "blurb", 81325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer NULL, G_PARAM_READWRITE); 82325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_value_init (&value, G_TYPE_STRING); 83325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 84325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_value_set_string (&value, "foobar"); 85325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer modified = g_param_value_validate (pspec, &value); 86325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_assert (!modified); 87325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 88325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_value_set_string (&value, ""); 89325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer modified = g_param_value_validate (pspec, &value); 90325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_assert (!modified && g_value_get_string (&value) != NULL); 91325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 92325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer /* test ensure_non_null */ 93325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 94325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer G_PARAM_SPEC_STRING (pspec)->ensure_non_null = TRUE; 95325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 96325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_value_set_string (&value, NULL); 97325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer modified = g_param_value_validate (pspec, &value); 98325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_assert (modified && g_value_get_string (&value) != NULL); 99325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 100325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer G_PARAM_SPEC_STRING (pspec)->ensure_non_null = FALSE; 101325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 102325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer /* test null_fold_if_empty */ 103325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 104325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer G_PARAM_SPEC_STRING (pspec)->null_fold_if_empty = TRUE; 105325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 106325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_value_set_string (&value, ""); 107325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer modified = g_param_value_validate (pspec, &value); 108325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_assert (modified && g_value_get_string (&value) == NULL); 109325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 110325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_value_set_static_string (&value, ""); 111325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer modified = g_param_value_validate (pspec, &value); 112325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_assert (modified && g_value_get_string (&value) == NULL); 113325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 114325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer G_PARAM_SPEC_STRING (pspec)->null_fold_if_empty = FALSE; 115325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 116325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer /* test cset_first */ 117325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 118325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer G_PARAM_SPEC_STRING (pspec)->cset_first = g_strdup ("abc"); 119325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer G_PARAM_SPEC_STRING (pspec)->substitutor = '-'; 120325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 121325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_value_set_string (&value, "ABC"); 122325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer modified = g_param_value_validate (pspec, &value); 123325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_assert (modified && g_value_get_string (&value)[0] == '-'); 124325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 125325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_value_set_static_string (&value, "ABC"); 126325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer modified = g_param_value_validate (pspec, &value); 127325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_assert (modified && g_value_get_string (&value)[0] == '-'); 128325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 129325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer /* test cset_nth */ 130325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 131325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer G_PARAM_SPEC_STRING (pspec)->cset_nth = g_strdup ("abc"); 132325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 133325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_value_set_string (&value, "aBC"); 134325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer modified = g_param_value_validate (pspec, &value); 135325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_assert (modified && g_value_get_string (&value)[1] == '-'); 136325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 137325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_value_set_static_string (&value, "aBC"); 138325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer modified = g_param_value_validate (pspec, &value); 139325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_assert (modified && g_value_get_string (&value)[1] == '-'); 140325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 141325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_value_unset (&value); 142325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer g_param_spec_unref (pspec); 143325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer} 144325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer 145325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Nattererstatic void 146c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasentest_param_spec_override (void) 147c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen{ 148c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen GParamSpec *ospec, *pspec; 149c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen GValue value = { 0, }; 150c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen gboolean modified; 151c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 152c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen ospec = g_param_spec_char ("char", "nick", "blurb", 153c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 20, 40, 30, G_PARAM_READWRITE); 154c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 155c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen pspec = g_param_spec_override ("override", ospec); 156c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 157c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (strcmp (g_param_spec_get_name (pspec), "override") == 0); 158c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (strcmp (g_param_spec_get_nick (pspec), "nick") == 0); 159c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (strcmp (g_param_spec_get_blurb (pspec), "blurb") == 0); 160c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 161c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_value_init (&value, G_TYPE_CHAR); 162c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_value_set_char (&value, 30); 163c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 164c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (g_param_value_defaults (pspec, &value)); 165c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 166c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_value_set_char (&value, 0); 167c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen modified = g_param_value_validate (pspec, &value); 168c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (modified && g_value_get_char (&value) == 20); 169c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 170c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_value_set_char (&value, 20); 171c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen modified = g_param_value_validate (pspec, &value); 172c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (!modified && g_value_get_char (&value) == 20); 173c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 174c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_value_set_char (&value, 40); 175c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen modified = g_param_value_validate (pspec, &value); 176c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (!modified && g_value_get_char (&value) == 40); 177c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 178c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_value_set_char (&value, 60); 179c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen modified = g_param_value_validate (pspec, &value); 180c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (modified && g_value_get_char (&value) == 40); 181c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 182c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_param_spec_unref (pspec); 183c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen} 184c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 185c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasenstatic void 186c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasentest_param_spec_gtype (void) 187c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen{ 188c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen GParamSpec *pspec; 189c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen GValue value = { 0, }; 190c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen gboolean modified; 191c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 192c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen pspec = g_param_spec_gtype ("gtype", "nick", "blurb", 193c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen G_TYPE_PARAM, G_PARAM_READWRITE); 194c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 195c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_value_init (&value, G_TYPE_GTYPE); 196f5542c90e3ee184dc9936ec4d816da14d2a2660dMatthias Clasen g_value_set_gtype (&value, G_TYPE_PARAM); 197c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 198c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (g_param_value_defaults (pspec, &value)); 199c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 200c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_value_set_gtype (&value, G_TYPE_INT); 201c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen modified = g_param_value_validate (pspec, &value); 202f5542c90e3ee184dc9936ec4d816da14d2a2660dMatthias Clasen g_assert (modified && g_value_get_gtype (&value) == G_TYPE_PARAM); 203c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 204c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_value_set_gtype (&value, G_TYPE_PARAM_INT); 205c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen modified = g_param_value_validate (pspec, &value); 206c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_assert (!modified && g_value_get_gtype (&value) == G_TYPE_PARAM_INT); 207c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen} 208c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 209c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasenint 210c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasenmain (int argc, char *argv[]) 211c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen{ 212c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen g_type_init (); 213c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 214c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen test_param_spec_char (); 215325bd373d4d730d96aee740daed4bc2b70b8ea07Michael Natterer test_param_spec_string (); 216c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen test_param_spec_override (); 217c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen test_param_spec_gtype (); 218c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen 219c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen return 0; 220c773a618e350211c1bc23069dda64dc70d36362eMatthias Clasen} 221