upgrading copyright year from 2015 to 2016
[hkl.git] / hkl / hkl-factory.c
blob2370753350819c61188d7759f0320d27a28f9ef4
1 /* This file is part of the hkl library.
3 * The hkl library is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * The hkl library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with the hkl library. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright (C) 2003-2016 Synchrotron SOLEIL
17 * L'Orme des Merisiers Saint-Aubin
18 * BP 48 91192 GIF-sur-YVETTE CEDEX
20 * Authors: Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>
22 #include "hkl-factory-private.h" // for autodata_factories_, etc
24 HklFactory **hkl_factory_get_all(size_t *n)
26 return autodata_get(factories, n);
29 HklFactory *hkl_factory_get_by_name(const char *name, GError **error)
31 size_t i, n;
32 HklFactory **factories;
34 factories = autodata_get(factories, &n);
35 for(i=0;i<n; ++i)
36 if (!strcmp(name, factories[i]->name))
37 return factories[i];
39 return NULL;
42 const char *hkl_factory_name_get(const HklFactory *self)
44 return self->name;
47 HklGeometry *hkl_factory_create_new_geometry(const HklFactory *self)
49 return self->create_new_geometry(self);
52 HklEngineList *hkl_factory_create_new_engine_list(const HklFactory *self)
54 return self->create_new_engine_list(self);