/*
 * Generated by erpcgen 1.14.0 on Tue Apr 28 12:16:37 2026.
 *
 * AUTOGENERATED - DO NOT EDIT
 */


#include "c_file_service_client.h"
#include "file_service_client.hpp"
#include "erpc_manually_constructed.hpp"

using namespace erpc;
using namespace std;
using namespace erpcShim;


#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
file_service_client *s_file_service_client = nullptr;
#else
ERPC_MANUALLY_CONSTRUCTED_STATIC(file_service_client, s_file_service_client);
#endif

int32_t fileWriteBegin(const char * path, uint32_t total_size)
{
    int32_t result;
    result = s_file_service_client->fileWriteBegin(path, total_size);

    return result;
}

int32_t fileWriteChunk(const binary_t * data)
{
    int32_t result;
    result = s_file_service_client->fileWriteChunk(data);

    return result;
}

int32_t fileWriteEnd(void)
{
    int32_t result;
    result = s_file_service_client->fileWriteEnd();

    return result;
}

int32_t fileWriteAbort(void)
{
    int32_t result;
    result = s_file_service_client->fileWriteAbort();

    return result;
}

void initfile_service_client(erpc_client_t client)
{
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
    erpc_assert(s_file_service_client == nullptr);
    s_file_service_client = new file_service_client(reinterpret_cast<ClientManager *>(client));
#else
    erpc_assert(!s_file_service_client.isUsed());
    s_file_service_client.construct(reinterpret_cast<ClientManager *>(client));
#endif
}

void deinitfile_service_client(void)
{
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
    if (s_file_service_client != nullptr)
    {
        delete s_file_service_client;
        s_file_service_client = nullptr;
    }
#else
    s_file_service_client.destroy();
#endif
}
