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