xref: /dragonfly/contrib/gdb-7/gdb/python/py-events.h (revision d4ef6694)
1 /* Python interface to inferior events.
2 
3    Copyright (C) 2009-2013 Free Software Foundation, Inc.
4 
5    This file is part of GDB.
6 
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11 
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19 
20 #ifndef GDB_PY_EVENTS_H
21 #define GDB_PY_EVENTS_H
22 
23 #include "command.h"
24 #include "python-internal.h"
25 #include "inferior.h"
26 
27 extern PyTypeObject thread_event_object_type;
28 
29 /* Stores a list of objects to be notified when the event for which this
30    registry tracks occurs.  */
31 
32 typedef struct
33 {
34   PyObject_HEAD
35 
36   PyObject *callbacks;
37 } eventregistry_object;
38 
39 /* Struct holding references to event registries both in python and c.
40    This is meant to be a singleton.  */
41 
42 typedef struct
43 {
44   eventregistry_object *stop;
45   eventregistry_object *cont;
46   eventregistry_object *exited;
47   eventregistry_object *new_objfile;
48 
49   PyObject *module;
50 
51 } events_object;
52 
53 /* Python events singleton.  */
54 extern events_object gdb_py_events;
55 
56 extern eventregistry_object *create_eventregistry_object (void);
57 extern int evregpy_no_listeners_p (eventregistry_object *registry);
58 
59 #endif /* GDB_PY_EVENTS_H */
60