summaryrefslogtreecommitdiff
path: root/binaryview.cpp
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2016-12-01 17:22:22 -0500
committerRusty Wagner <rusty@vector35.com>2016-12-01 17:22:22 -0500
commit990cface5a0b9b814f423e45449a7d5f3cb6c19d (patch)
treea3b401c7d1f6fcb75dc2408cb522c2feb4172a86 /binaryview.cpp
parenteef9d1eff05975c31862db4157ac2f1b2bb30502 (diff)
Adding APIs to manipulate structures
Diffstat (limited to 'binaryview.cpp')
-rw-r--r--binaryview.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/binaryview.cpp b/binaryview.cpp
index cc6667c5..16a270fc 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -129,6 +129,24 @@ void BinaryDataNotification::StringRemovedCallback(void* ctxt, BNBinaryView* obj
}
+void BinaryDataNotification::TypeDefinedCallback(void* ctxt, BNBinaryView* data, const char* name, BNType* type)
+{
+ BinaryDataNotification* notify = (BinaryDataNotification*)ctxt;
+ Ref<BinaryView> view = new BinaryView(BNNewViewReference(data));
+ Ref<Type> typeObj = new Type(BNNewTypeReference(type));
+ notify->OnTypeDefined(view, name, typeObj);
+}
+
+
+void BinaryDataNotification::TypeUndefinedCallback(void* ctxt, BNBinaryView* data, const char* name, BNType* type)
+{
+ BinaryDataNotification* notify = (BinaryDataNotification*)ctxt;
+ Ref<BinaryView> view = new BinaryView(BNNewViewReference(data));
+ Ref<Type> typeObj = new Type(BNNewTypeReference(type));
+ notify->OnTypeUndefined(view, name, typeObj);
+}
+
+
BinaryDataNotification::BinaryDataNotification()
{
m_callbacks.context = this;
@@ -143,6 +161,8 @@ BinaryDataNotification::BinaryDataNotification()
m_callbacks.dataVariableUpdated = DataVariableUpdatedCallback;
m_callbacks.stringFound = StringFoundCallback;
m_callbacks.stringRemoved = StringRemovedCallback;
+ m_callbacks.typeDefined = TypeDefinedCallback;
+ m_callbacks.typeUndefined = TypeUndefinedCallback;
}