/*!
 * \brief The patcher's identifier
 *
 * \note The returned string is dynamically allocated. It should be free()'d
 *       when it is no longer needed.
 *
 * \param patcher CPatcher object
 * \return Patcher ID
 *
 * \sa Patcher::id()
 */
char * mbp_patcher_id(const CPatcher *patcher)
{
    CCASTP(patcher);
    return string_to_cstring(p->id());
}
/*!
 * \brief Get the error information
 *
 * \note The returned ErrorCode is filled with valid data only if a
 *       CPatcher operation has failed.
 *
 * \note The returned ErrorCode should be freed with mbp_error_destroy()
 *       when it is no longer needed.
 *
 * \param patcher CPatcher object
 *
 * \return ErrorCode
 *
 * \sa Patcher::error()
 */
/* enum ErrorCode */ int mbp_patcher_error(const CPatcher *patcher)
{
    CCASTP(patcher);
    return static_cast<int>(p->error());
}
/*!
 * \brief Get the error information
 *
 * \note The returned CPatcherError is filled with valid data only if a
 *       CPatcher operation has failed.
 *
 * \note The returned CPatcherError should be freed with mbp_error_destroy()
 *       when it is no longer needed.
 *
 * \param patcher CPatcher object
 *
 * \return CPatcherError
 *
 * \sa Patcher::error()
 */
CPatcherError * mbp_patcher_error(const CPatcher *patcher)
{
    CCASTP(patcher);
    mbp::PatcherError *pe = new mbp::PatcherError(p->error());
    return reinterpret_cast<CPatcherError *>(pe);
}
/*!
 * \brief Whether or not the patcher uses patchinfo files
 *
 * \param patcher CPatcher object
 * \return Whether the patcher uses patchinfo files
 *
 * \sa Patcher::usesPatchInfo()
 */
bool mbp_patcher_uses_patchinfo(const CPatcher *patcher)
{
    CCASTP(patcher);
    return p->usesPatchInfo();
}
/*!
 * \brief The patcher's identifier
 *
 * \note The returned string is dynamically allocated. It should be free()'d
 *       when it is no longer needed.
 *
 * \param patcher CPatcher object
 * \return Patcher ID
 *
 * \sa Patcher::id()
 */
char * mbpatcher_patcher_id(const CPatcher *patcher)
{
    CCASTP(patcher);
    return mb::capi_str_to_cstr(p->id());
}