Improve listener interface.

Now a structure is passed back, enabling combining the existing source
and sink listeners and adding property listeners as well.
This commit is contained in:
Peter Johnson
2016-11-04 12:46:22 -07:00
parent e07a40a16d
commit 8d2efb2838
8 changed files with 165 additions and 234 deletions

View File

@@ -424,24 +424,13 @@ void ReleaseSink(CS_Sink sink, CS_Status* status) {
// Listener Functions
//
CS_Listener AddSourceListener(
std::function<void(llvm::StringRef name, CS_Source source, int event)>
callback,
int eventMask, CS_Status* status) {
CS_Listener AddListener(std::function<void(const RawEvent& event)> callback,
int eventMask, bool immediateNotify,
CS_Status* status) {
return 0; // TODO
}
void RemoveSourceListener(CS_Listener handle, CS_Status* status) {
// TODO
}
CS_Listener AddSinkListener(
std::function<void(llvm::StringRef name, CS_Sink sink, int event)> callback,
int eventMask, CS_Status* status) {
return 0; // TODO
}
void RemoveSinkListener(CS_Listener handle, CS_Status* status) {
void RemoveListener(CS_Listener handle, CS_Status* status) {
// TODO
}