lldb-sys 0.0.13

Raw bindings to the LLDB C++ API. LLDB is the debugger that is part of the LLVM project and is the default system debugger on Mac OS X. Building and using this is currently slightly tricky, so be sure to see the README.md in the repository.
//===-- SBEventBinding.cpp --------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "lldb/Bindings/LLDBBinding.h"
#include "lldb/API/LLDB.h"

using namespace lldb;

#ifdef __cplusplus
extern "C" {
#endif

SBEventRef
CreateSBEvent()
{
    return reinterpret_cast<SBEventRef>(new SBEvent());
}

SBEventRef
CreateSBEvent2(uint32_t event, const char *cstr, uint32_t cstr_len)
{
    return reinterpret_cast<SBEventRef>(new SBEvent(event, cstr, cstr_len));
}

void
DisposeSBEvent(SBEventRef instance)
{
    delete reinterpret_cast<SBEvent *>(instance);
}

bool
SBEventIsValid(SBEventRef instance)
{
    SBEvent *unwrapped = reinterpret_cast<SBEvent *>(instance);
    return unwrapped->IsValid();
}

const char *
SBEventGetDataFlavor(SBEventRef instance)
{
    SBEvent *unwrapped = reinterpret_cast<SBEvent *>(instance);
    return unwrapped->GetDataFlavor();
}

unsigned int
SBEventGetType(SBEventRef instance)
{
    SBEvent *unwrapped = reinterpret_cast<SBEvent *>(instance);
    return unwrapped->GetType();
}

SBBroadcasterRef
SBEventGetBroadcaster(SBEventRef instance)
{
    SBEvent *unwrapped = reinterpret_cast<SBEvent *>(instance);
    return reinterpret_cast<SBBroadcasterRef>(new SBBroadcaster(unwrapped->GetBroadcaster()));
}

const char *
SBEventGetBroadcasterClass(SBEventRef instance)
{
    SBEvent *unwrapped = reinterpret_cast<SBEvent *>(instance);
    return unwrapped->GetBroadcasterClass();
}

bool
SBEventBroadcasterMatchesPtr(SBEventRef instance, SBBroadcasterRef broadcaster)
{
    SBEvent *unwrapped = reinterpret_cast<SBEvent *>(instance);
    return unwrapped->BroadcasterMatchesPtr(reinterpret_cast<SBBroadcaster *>(broadcaster));
}

bool
SBEventBroadcasterMatchesRef(SBEventRef instance, SBBroadcasterRef broadcaster)
{
    SBEvent *unwrapped = reinterpret_cast<SBEvent *>(instance);
    return unwrapped->BroadcasterMatchesRef(*reinterpret_cast<SBBroadcaster *>(broadcaster));
}

void
SBEventClear(SBEventRef instance)
{
    SBEvent *unwrapped = reinterpret_cast<SBEvent *>(instance);
    unwrapped->Clear();
}

const char *
SBEventGetCStringFromEvent(SBEventRef event)
{
    return lldb::SBEvent::GetCStringFromEvent(*reinterpret_cast<SBEvent *>(event));
}

bool
SBEventGetDescription(SBEventRef instance, SBStreamRef description)
{
    SBEvent *unwrapped = reinterpret_cast<SBEvent *>(instance);
    return unwrapped->GetDescription(*reinterpret_cast<SBStream *>(description));
}

#ifdef __cplusplus
}
#endif