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.
//===-- SBLineEntryBinding.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

SBLineEntryRef
CreateSBLineEntry()
{
    return reinterpret_cast<SBLineEntryRef>(new SBLineEntry());
}

void
DisposeSBLineEntry(SBLineEntryRef instance)
{
    delete reinterpret_cast<SBLineEntry *>(instance);
}

SBAddressRef
SBLineEntryGetStartAddress(SBLineEntryRef instance)
{
    SBLineEntry *unwrapped = reinterpret_cast<SBLineEntry *>(instance);
    return reinterpret_cast<SBAddressRef>(new SBAddress(unwrapped->GetStartAddress()));
}

SBAddressRef
SBLineEntryGetEndAddress(SBLineEntryRef instance)
{
    SBLineEntry *unwrapped = reinterpret_cast<SBLineEntry *>(instance);
    return reinterpret_cast<SBAddressRef>(new SBAddress(unwrapped->GetEndAddress()));
}

bool
SBLineEntryIsValid(SBLineEntryRef instance)
{
    SBLineEntry *unwrapped = reinterpret_cast<SBLineEntry *>(instance);
    return unwrapped->IsValid();
}

SBFileSpecRef
SBLineEntryGetFileSpec(SBLineEntryRef instance)
{
    SBLineEntry *unwrapped = reinterpret_cast<SBLineEntry *>(instance);
    return reinterpret_cast<SBFileSpecRef>(new SBFileSpec(unwrapped->GetFileSpec()));
}

unsigned int
SBLineEntryGetLine(SBLineEntryRef instance)
{
    SBLineEntry *unwrapped = reinterpret_cast<SBLineEntry *>(instance);
    return unwrapped->GetLine();
}

unsigned int
SBLineEntryGetColumn(SBLineEntryRef instance)
{
    SBLineEntry *unwrapped = reinterpret_cast<SBLineEntry *>(instance);
    return unwrapped->GetColumn();
}

void
SBLineEntrySetFileSpec(SBLineEntryRef instance, SBFileSpecRef filespec)
{
    SBLineEntry *unwrapped = reinterpret_cast<SBLineEntry *>(instance);
    unwrapped->SetFileSpec(*reinterpret_cast<SBFileSpec *>(filespec));
}

void
SBLineEntrySetLine(SBLineEntryRef instance, uint32_t line)
{
    SBLineEntry *unwrapped = reinterpret_cast<SBLineEntry *>(instance);
    unwrapped->SetLine(line);
}

void
SBLineEntrySetColumn(SBLineEntryRef instance, uint32_t column)
{
    SBLineEntry *unwrapped = reinterpret_cast<SBLineEntry *>(instance);
    unwrapped->SetColumn(column);
}

bool
SBLineEntryGetDescription(SBLineEntryRef instance, SBStreamRef description)
{
    SBLineEntry *unwrapped = reinterpret_cast<SBLineEntry *>(instance);
    return unwrapped->GetDescription(*reinterpret_cast<SBStream *>(description));
}

#ifdef __cplusplus
}
#endif