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

SBValueListRef
CreateSBValueList()
{
    return reinterpret_cast<SBValueListRef>(new SBValueList());
}

void
DisposeSBValueList(SBValueListRef instance)
{
    delete reinterpret_cast<SBValueList *>(instance);
}

bool
SBValueListIsValid(SBValueListRef instance)
{
    SBValueList *unwrapped = reinterpret_cast<SBValueList *>(instance);
    return unwrapped->IsValid();
}

void
SBValueListClear(SBValueListRef instance)
{
    SBValueList *unwrapped = reinterpret_cast<SBValueList *>(instance);
    unwrapped->Clear();
}

void
SBValueListAppend(SBValueListRef instance, SBValueRef val_obj)
{
    SBValueList *unwrapped = reinterpret_cast<SBValueList *>(instance);
    unwrapped->Append(*reinterpret_cast<SBValue *>(val_obj));
}

void
SBValueListAppend2(SBValueListRef instance, SBValueListRef value_list)
{
    SBValueList *unwrapped = reinterpret_cast<SBValueList *>(instance);
    unwrapped->Append(*reinterpret_cast<SBValueList *>(value_list));
}

unsigned int
SBValueListGetSize(SBValueListRef instance)
{
    SBValueList *unwrapped = reinterpret_cast<SBValueList *>(instance);
    return unwrapped->GetSize();
}

SBValueRef
SBValueListGetValueAtIndex(SBValueListRef instance, uint32_t idx)
{
    SBValueList *unwrapped = reinterpret_cast<SBValueList *>(instance);
    return reinterpret_cast<SBValueRef>(new SBValue(unwrapped->GetValueAtIndex(idx)));
}

SBValueRef
SBValueListGetFirstValueByName(SBValueListRef instance, const char *name)
{
    SBValueList *unwrapped = reinterpret_cast<SBValueList *>(instance);
    return reinterpret_cast<SBValueRef>(new SBValue(unwrapped->GetFirstValueByName(name)));
}

SBValueRef
SBValueListFindValueObjectByUID(SBValueListRef instance, lldb_user_id_t uid)
{
    SBValueList *unwrapped = reinterpret_cast<SBValueList *>(instance);
    return reinterpret_cast<SBValueRef>(new SBValue(unwrapped->FindValueObjectByUID(uid)));
}

#ifdef __cplusplus
}
#endif