<commit_before>/* ********** NOTICE : THIS IS JUST A DRAFT ***********************/

#ifndef _PRODBGAPI_H_
#define _PRODBGAPI_H_

#include <stdint.h>
#include "PDReadWrite.h"
#include "PDRemote.h"

#ifdef _cplusplus
extern "C" {
#endif

/*! \fn void* ServiceFunc(const char* serviceName)
    Service Function. Provides services for the plugin to use.
    Example:
     ProDBGUI* ui = serviceFunc(PRODBG_UI_SERVICE);
     ProDBServerInfo* serverInfo = serviceFunc(PRODBG_SERVERINFO_SERVICE);
     It's ok for the plugin to hold a pointer to the requested service during its life time.
    \param serviceName The name of the requested service. It's *highly* recommended to use the defines for the wanted service.
 */

typedef void* ServiceFunc (const char* serviceName);
typedef void RegisterPlugin (int type, void* data);

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

enum
{
    PD_API_VERSION = 1
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

typedef enum PDAction
{
    PDAction_none,
    PDAction_stop,
    PDAction_break,
    PDAction_run,
    PDAction_step,
    PDAction_stepOut,
    PDAction_stepOver,
    PDAction_custom = 0x1000
} PDAction;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

typedef enum PDDebugState
{
    PDDebugState_noTarget,
    PDDebugState_running,
    PDDebugState_stopBreakpoint,
    PDDebugState_stopException,
    PDDebugState_trace,
} PDDebugState;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

typedef enum PDEventType
{
    PDEventType_getLocals,
    PDEventType_setLocals,
    PDEventType_getCallstack,
    PDEventType_setCallstack,
    PDEventType_getWatch,
    PDEventType_setWatch,
    PDEventType_getRegisters,
    PDEventType_setRegisters,
    PDEventType_getMemory,
    PDEventType_setMemory,
    PDEventType_getTty,
    PDEventType_setTty,
    PDEventType_getExceptionLocation,
    PDEventType_setExceptionLocation,
    PDEventType_getDisassembly,
    PDEventType_setDisassembly,

    PDEventType_setBreakpoint,
    PDEventType_getBreakpoint,
    PDEventType_setExecutable,
    PDEventType_action,
    PDEventType_attachToProcess,
    PDEventType_attachToRemoteSession,

    /// Custom events. Here you can have your own events. Note that they must start with PDEventType_custom  and up
    PDEventType_custom = 0x1000

} PDEventType;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

typedef struct PDBackendPlugin
{
    int         version;
    const char* name;

    void* (*createInstance)(ServiceFunc * serviceFunc);
    void (* destroyInstance)(void* userData);

    // Updates and Returns the current state of the plugin.
    PDDebugState (* update)(void* userData, PDAction action, PDReader* inEvents, PDWriter* outEvents);

    // Writer functions used for writing data back to the host
    PDReader reader;

    // Writer functions used for writing data back to the host
    PDWriter writer;
    // Create and destroy instance of the plugin

} PDBackendPlugin;

#ifdef _cplusplus
}
#endif

#endif

<commit_msg>Cleanup<commit_after>/* ********** NOTICE : THIS IS JUST A DRAFT ***********************/

#ifndef _PRODBGAPI_H_
#define _PRODBGAPI_H_

#include <stdint.h>
#include "PDReadWrite.h"
#include "PDRemote.h"

#ifdef _cplusplus
extern "C" {
#endif

/*! \fn void* ServiceFunc(const char* serviceName)
    Service Function. Provides services for the plugin to use.
    Example:
     ProDBGUI* ui = serviceFunc(PRODBG_UI_SERVICE);
     ProDBServerInfo* serverInfo = serviceFunc(PRODBG_SERVERINFO_SERVICE);
     It's ok for the plugin to hold a pointer to the requested service during its life time.
    \param serviceName The name of the requested service. It's *highly* recommended to use the defines for the wanted service.
 */

typedef void* ServiceFunc (const char* serviceName);
typedef void RegisterPlugin (int type, void* data);

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

enum
{
    PD_API_VERSION = 1
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

typedef enum PDAction
{
    PDAction_none,
    PDAction_stop,
    PDAction_break,
    PDAction_run,
    PDAction_step,
    PDAction_stepOut,
    PDAction_stepOver,
    PDAction_custom = 0x1000
} PDAction;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

typedef enum PDDebugState
{
    PDDebugState_noTarget,
    PDDebugState_running,
    PDDebugState_stopBreakpoint,
    PDDebugState_stopException,
    PDDebugState_trace,
} PDDebugState;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

typedef enum PDEventType
{
    PDEventType_getLocals,
    PDEventType_setLocals,
    PDEventType_getCallstack,
    PDEventType_setCallstack,
    PDEventType_getWatch,
    PDEventType_setWatch,
    PDEventType_getRegisters,
    PDEventType_setRegisters,
    PDEventType_getMemory,
    PDEventType_setMemory,
    PDEventType_getTty,
    PDEventType_setTty,
    PDEventType_getExceptionLocation,
    PDEventType_setExceptionLocation,
    PDEventType_getDisassembly,
    PDEventType_setDisassembly,

    PDEventType_setBreakpoint,
    PDEventType_getBreakpoint,
    PDEventType_setExecutable,
    PDEventType_action,
    PDEventType_attachToProcess,
    PDEventType_attachToRemoteSession,

    /// Custom events. Here you can have your own events. Note that they must start with PDEventType_custom  and up
    PDEventType_custom = 0x1000

} PDEventType;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

typedef struct PDBackendPlugin
{
    int version;
    const char* name;

    void* (*createInstance)(ServiceFunc * serviceFunc);
    void (*destroyInstance)(void* userData);

    // Updates and Returns the current state of the plugin.
    PDDebugState (*update)(void* userData, PDAction action, PDReader* inEvents, PDWriter* outEvents);

    // Writer functions used for writing data back to the host
    PDReader reader;

    // Writer functions used for writing data back to the host
    PDWriter writer;
    // Create and destroy instance of the plugin

} PDBackendPlugin;

#ifdef _cplusplus
}
#endif

#endif


{'fraction_non_alphanumeric': 0.23919567827130853, 'fraction_numerical': 0.0033013205282112846, 'mean_word_length': 1.9142982072584172, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '83286', 'n_tokens_mistral': 1813, 'n_tokens_neox': 1785, 'n_words': 462}