<commit_before>/*
 * CicmWrapper - Pure Data Enhanced

 * Copyright (C) 2013 <NAME>, CICM - Université Paris 8
 * All rights reserved.
 * Website  : https://github.com/CICM/CicmWrapper
 * Contacts : <EMAIL>
 * For information on usage and redistribution, and for a DISCLAIMER OF ALL
 * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
 */

/**
 * @file edefine.h
 * @brief The header that contains all the principals structures of CicmWrapper
 * @details All the principals structures are defined in this file.
 * @author <NAME>
 */

#ifndef DEF_ESTRUCT
#define DEF_ESTRUCT

#ifdef _WINDOWS
#include <io.h>
#define _FUNCTION_DEPRECTAED_
#else
#include <unistd.h>
#define _FUNCTION_DEPRECTAED_  __attribute__((deprecated))
#endif

#include <m_pd.h>
#include <m_imp.h>
#include <g_canvas.h>

#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <string.h>
#include <stdarg.h>
#include <fcntl.h>

#ifdef _MSC_VER


#define snprintf sprintf_s
#endif

/*! @addtogroup groupcommon The Common Part
 * @brief The general part.
 * @details This part refers to the general methods and definitions.
 *  @{
 */

//! @cond
#define atom_setfloat(a, f) SETFLOAT(a, f)
#define atom_setlong(a, l)  SETFLOAT(a, (float)l)
#define atom_setsym(a, s)   SETSYMBOL(a, s)
#define atom_getlong(a)     (long)atom_getfloat(a)
#define atom_gettype(a)     (a)[0].a_type
//! @endcond

//! The error type
typedef long t_pd_err;
//! The standart method
typedef void        (*t_typ_method)(void* x, ...);
//! The return method
typedef void*       (*t_ret_method)(void* x, ...);
//! The error method
typedef t_pd_err    (*t_err_method)(void* x, ...);

//! The pre-defined ("null") t_symbol*
extern t_symbol* s_null;
//! The pre-defined obj t_symbol*
extern t_symbol* s_obj;
//! The pre-defined atom t_symbol*
extern t_symbol* s_atom;
//! The pre-defined attr_modified t_symbol*
extern t_symbol* s_attr_modified;
//! The pre-defined eboxbd t_symbol*
extern t_symbol* s_eboxbd;
//! The pre-defined eboxio t_symbol*
extern t_symbol* s_eboxio;
//! The pre-defined size t_symbol*
extern t_symbol* s_size;
//! The pre-defined int t_symbol*
extern t_symbol* s_int;
//! The pre-defined long t_symbol*
extern t_symbol* s_long;
//! The pre-defined double t_symbol*
extern t_symbol* s_double;

//! @cond
typedef struct _namelist    /* element in a linked list of stored strings */
{
    struct _namelist *nl_next;  /* next in list */
    char *nl_string;            /* the string */
} t_namelist;

EXTERN t_namelist *sys_staticpath;
EXTERN t_namelist *sys_searchpath;
EXTERN t_namelist *namelist_append_files(t_namelist *listwas, const char *s);

//! @endcond

/** @} */

/*! @addtogroup groupgraphics The Graphics Part
 * @brief The t_elayer part.
 * @details This part refers to the methods and structures used to paint.
 *  @{
 */

//! Macros that define the a pi
#define EPD_PI  (3.141592653589793238462643383279502884f)
//! Macros that define the a 2pi
#define EPD_2PI (6.283185307179586476925286766559005f)
//! Macros that define the a pi over 2
#define EPD_PI2 (1.57079632679489661923132169163975144f)
//! Macros that define the a pi over 4
#define EPD_PI4 (0.785398163397448309615660845819875721f)

/**
 * @enum elayer_flags
 * @brief The flags that defines the status of a layer.
 * @details It define all possible the status of a layer.
 */
typedef enum elayer_flags
{
    EGRAPHICS_OPEN      = 0,  /*!< Open. */
    EGRAPHICS_CLOSE     = -1, /*!< Closed. */
    EGRAPHICS_INVALID   = -2, /*!< Invalid. */
    EGRAPHICS_TODRAW    = -3  /*!< To be drawn. */
} elayer_flags;

/**
 * @enum etextanchor_flags
 * @brief The flags that defines the text anchor.
 * @details It define all text anchor.
 */
typedef enum etextanchor_flags
{
    ETEXT_UP            = 0, /*!< Up and center. */
    ETEXT_UP_LEFT       = 1, /*!< Up anfd left. */
    ETEXT_UP_RIGHT      = 2, /*!< Up anfd right. */
    ETEXT_DOWN          = 3, /*!< Down and center. */
    ETEXT_DOWN_LEFT     = 4, /*!< Down anfd left. */
    ETEXT_DOWN_RIGHT    = 5, /*!< Down anfd right. */
    ETEXT_LEFT          = 6, /*!< Left. */
    ETEXT_RIGHT         = 7, /*!< right. */
    ETEXT_CENTER        = 8  /*!< Center. */
    
} etextanchor_flags;

/**
 * @enum etextwrap_flags
 * @brief The flags that defines if the text should be wrapped.
 * @details It define true or false.
 */
typedef enum etextwrap_flags
{
    ETEXT_NOWRAP    = 0, /*!< False. */
    ETEXT_WRAP      = 1 /*!< True. */
} etextwrap_flags;

/**
 * @enum etextjustify_flags<commit_msg>syntax<commit_after>/*
 * CicmWrapper - Pure Data Enhanced

 * Copyright (C) 2013 <NAME>, CICM - Université Paris 8
 * All rights reserved.
 * Website  : https://github.com/CICM/CicmWrapper
 * Contacts : <EMAIL>
 * For information on usage and redistribution, and for a DISCLAIMER OF ALL
 * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
 */

/**
 * @file edefine.h
 * @brief The header that contains all the principals structures of CicmWrapper
 * @details All the principals structures are defined in this file.
 * @author <NAME>
 */

#ifndef DEF_ESTRUCT
#define DEF_ESTRUCT

#ifdef _WINDOWS
#include <io.h>
#define _FUNCTION_DEPRECTAED_
#else
#include <unistd.h>
#define _FUNCTION_DEPRECTAED_  __attribute__((deprecated))
#endif

#include <m_pd.h>
#include <m_imp.h>
#include <g_canvas.h>

#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <string.h>
#include <stdarg.h>
#include <fcntl.h>

#ifdef _MSC_VER


#define snprintf sprintf_s
#endif

/*! @addtogroup groupcommon The Common Part
 * @brief The general part.
 * @details This part refers to the general methods and definitions.
 *  @{
 */

//! @cond
#define atom_setfloat(a, f) SETFLOAT(a, f)
#define atom_setlong(a, l)  SETFLOAT(a, (float)l)
#define atom_setsym(a, s)   SETSYMBOL(a, s)
#define atom_getlong(a)     (long)atom_getfloat(a)
#define atom_gettype(a)     (a)[0].a_type
//! @endcond

//! The error type
typedef long t_pd_err;
//! The standart method
typedef void        (*t_typ_method)(void* x, ...);
//! The return method
typedef void*       (*t_ret_method)(void* x, ...);
//! The error method
typedef t_pd_err    (*t_err_method)(void* x, ...);

//! The pre-defined ("null") t_symbol*
extern t_symbol* s_null;
//! The pre-defined obj t_symbol*
extern t_symbol* s_obj;
//! The pre-defined atom t_symbol*
extern t_symbol* s_atom;
//! The pre-defined attr_modified t_symbol*
extern t_symbol* s_attr_modified;
//! The pre-defined eboxbd t_symbol*
extern t_symbol* s_eboxbd;
//! The pre-defined eboxio t_symbol*
extern t_symbol* s_eboxio;
//! The pre-defined size t_symbol*
extern t_symbol* s_size;
//! The pre-defined int t_symbol*
extern t_symbol* s_int;
//! The pre-defined long t_symbol*
extern t_symbol* s_long;
//! The pre-defined double t_symbol*
extern t_symbol* s_double;

//! @cond
typedef struct _namelist    /* element in a linked list of stored strings */
{
    struct _namelist *nl_next;  /* next in list */
    char *nl_string;            /* the string */
} t_namelist;

EXTERN t_namelist *sys_staticpath;
EXTERN t_namelist *sys_searchpath;
EXTERN t_namelist *namelist_append_files(t_namelist *listwas, const char *s);

//! @endcond

/** @} */

/*! @addtogroup groupgraphics The Graphics Part
 * @brief The t_elayer part.
 * @details This part refers to the methods and structures used to paint.
 *  @{
 */

//! Macros that define the a pi
#define EPD_PI  (3.141592653589793238462643383279502884f)
//! Macros that define the a 2pi
#define EPD_2PI (6.283185307179586476925286766559005f)
//! Macros that define the a pi over 2
#define EPD_PI2 (1.57079632679489661923132169163975144f)
//! Macros that define the a pi over 4
#define EPD_PI4 (0.785398163397448309615660845819875721f)

/**
 * @enum elayer_flags
 * @brief The flags that defines the status of a layer.
 * @details It define all possible the status of a layer.
 */
typedef enum elayer_flags
{
    EGRAPHICS_OPEN      = 0,  /*!< Open. */
    EGRAPHICS_CLOSE     = -1, /*!< Closed. */
    EGRAPHICS_INVALID   = -2, /*!< Invalid. */
    EGRAPHICS_TODRAW    = -3  /*!< To be drawn. */
} elayer_flags;

/**
 * @enum etextanchor_flags
 * @brief The flags that defines the text anchor.
 * @details It define all text anchor.
 */
typedef enum etextanchor_flags
{
    ETEXT_UP            = 0, /*!< Up and center. */
    ETEXT_UP_LEFT       = 1, /*!< Up anfd left. */
    ETEXT_UP_RIGHT      = 2, /*!< Up anfd right. */
    ETEXT_DOWN          = 3, /*!< Down and center. */
    ETEXT_DOWN_LEFT     = 4, /*!< Down anfd left. */
    ETEXT_DOWN_RIGHT    = 5, /*!< Down anfd right. */
    ETEXT_LEFT          = 6, /*!< Left. */
    ETEXT_RIGHT         = 7, /*!< Right. */
    ETEXT_CENTER        = 8  /*!< Center. */
    
} etextanchor_flags;

/**
 * @enum etextwrap_flags
 * @brief The flags that defines if the text should be wrapped.
 * @details It define true or false.
 */
typedef enum etextwrap_flags
{
    ETEXT_NOWRAP    = 0, /*!< False. */
    ETEXT_WRAP      = 1  /*!< True. */
} etextwrap_flags;

/**
 * @enum etextjustify_flags
{'fraction_non_alphanumeric': 0.12733333333333333, 'fraction_numerical': 0.038, 'mean_word_length': 3.3149568552253115, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 31, 'https://': 2, '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': '2800266', 'n_tokens_mistral': 3527, 'n_tokens_neox': 3148, 'n_words': 945}