<commit_before>#ifndef __MEMORY_ACCESS__
#define __MEMORY_ACCESS__

/**
 * This header defines a common interface for reading processes' memory.
 *
 *  The basic workflow excluding memory freeing is
 *      1. Open a process handle.
 *      2. Ask for memory region containing address 0 to get the first region.
 *      3. Read whatever you want from the region.
 *      4. Ask for the next region, if available goto 3.
 *      5. Close the process.
 **/

#include <stdbool.h>
#include <stdint.h>

/**
 * Process ID type.
 **/
typedef uint32_t pid_tt;

#ifdef _WIN32

#include <windows.h>

/**
 * Windows specific process handle.
 *
 * handle represent the handle to an process object
 * pid is the process id.
 **/
typedef HANDLE process_handle_t;

#endif /* _WIN32 */

#ifdef __MACH__

#include <mach/mach.h>

/**
 * Mac specific process handle.
 **/
typedef struct {
    task_t task;
    pid_tt pid;
} process_handle_t;

#endif /* __MACH__ */

/**
 * Process ID type.
 **/
typedef uint32_t pid_tt;

typedef unsigned long long memory_address_t;

/**
 * This struct represents an error.
 *
 * error_number is the error as returned by the OS, 0 for no error.
 * description is a null-terminated string.
 **/
typedef struct {
    int error_number;
    char *description;
} error_t;

/**
 * This struct represents the error releated parts of a response to a function
 * call.
 *
 * fatal_error may point to an error_t that made the operation fail or be NULL.<commit_msg>Remove duplicated typedef in memory_access.h<commit_after>#ifndef __MEMORY_ACCESS__
#define __MEMORY_ACCESS__

/**
 * This header defines a common interface for reading processes' memory.
 *
 *  The basic workflow excluding memory freeing is
 *      1. Open a process handle.
 *      2. Ask for memory region containing address 0 to get the first region.
 *      3. Read whatever you want from the region.
 *      4. Ask for the next region, if available goto 3.
 *      5. Close the process.
 **/

#include <stdbool.h>
#include <stdint.h>

/**
 * Process ID type.
 **/
typedef uint32_t pid_tt;

#ifdef _WIN32

#include <windows.h>

/**
 * Windows specific process handle.
 *
 * handle represent the handle to an process object
 * pid is the process id.
 **/
typedef HANDLE process_handle_t;

#endif /* _WIN32 */

#ifdef __MACH__

#include <mach/mach.h>

/**
 * Mac specific process handle.
 **/
typedef struct {
    task_t task;
    pid_tt pid;
} process_handle_t;

#endif /* __MACH__ */

typedef unsigned long long memory_address_t;

/**
 * This struct represents an error.
 *
 * error_number is the error as returned by the OS, 0 for no error.
 * description is a null-terminated string.
 **/
typedef struct {
    int error_number;
    char *description;
} error_t;

/**
 * This struct represents the error releated parts of a response to a function
 * call.
 *
 * fatal_error may point to an error_t that made the operation fail or be NULL.
{'fraction_non_alphanumeric': 0.09065934065934066, 'fraction_numerical': 0.010302197802197802, 'mean_word_length': 3.143669985775249, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4593740', 'n_tokens_mistral': 934, 'n_tokens_neox': 891, 'n_words': 363}