File: osmgpsmapmodule.c

package info (click to toggle)
osm-gps-map 0.7.3-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 716 kB
  • sloc: ansic: 4,734; makefile: 248; python: 203; xml: 35; sh: 16
file content (52 lines) | stat: -rw-r--r-- 1,623 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * osmgpsmapmodule.
 * Copyright (C) John Stowers 2008 <john.stowers@gmail.com>
 * 
 * This 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; version 2.
 *
 * 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, see <http://www.gnu.org/licenses/>.
 */

#include <pygobject.h>
#include <osm-gps-map.h>
#include <osm-gps-map-osd.h>
#include <osm-gps-map-layer.h>

void pyosmgpsmap_register_classes(PyObject *d);
extern PyMethodDef pyosmgpsmap_functions[];

DL_EXPORT(void)
initosmgpsmap(void)
{
	PyObject *m, *d;

	init_pygobject();

	m = Py_InitModule("osmgpsmap", pyosmgpsmap_functions);
	d = PyModule_GetDict(m);

	pyosmgpsmap_register_classes(d);
    pyosmgpsmap_add_constants(m, "OSM_GPS_MAP_");

	PyModule_AddObject(m, "INVALID",
		PyFloat_FromDouble(OSM_GPS_MAP_INVALID));
	PyModule_AddObject(m, "CACHE_DISABLED",
		PyString_FromString(OSM_GPS_MAP_CACHE_DISABLED));
	PyModule_AddObject(m, "CACHE_AUTO",
		PyString_FromString(OSM_GPS_MAP_CACHE_AUTO));
	PyModule_AddObject(m, "CACHE_FRIENDLY",
		PyString_FromString(OSM_GPS_MAP_CACHE_FRIENDLY));

	if (PyErr_Occurred()) {
		Py_FatalError("can't initialize module osmgpsmap");
	}
}