Skip to content

File comp_rlitt_positivity.h

File List > comp-rlitt_positivity > src > comp_rlitt_positivity.h

Go to the documentation of this file

#ifndef COMPUTATION_RLITT_POSITIVITY_H
#define COMPUTATION_RLITT_POSITIVITY_H

/******************************************************************************/
/*************************** Includes *****************************************/
/******************************************************************************/

#include "notation_wptt.h"
#include "storage_defs.h"
#include "computation_defs.h"

/******************************************************************************/
/*************************** Defines ******************************************/
/******************************************************************************/

/*************************** Config Flags**************************************/

/*
 *
 | Flag\bit                   | 7   | 6   | 5   | 4   | 3   | 2   | 1   | 0   |
 | -------------------------- | --- | --- | --- | --- | --- | --- | --- | --- |
 | Success                    | 0   | 0   | 0   | 0   | 0   | 0   | 0   | 0   |
 | Fail                       | 0   | 0   | 0   | 0   | 0   | 0   | 0   | 1   |
 | NULL TREE                  | 0   | 0   | 0   | 0   | 0   | 0   | 1   | 0   |
 | Scion error                | 0   | 0   | 0   | 0   | 0   | 1   | 0   | 0   |
 | Config is null             | 0   | 0   | 0   | 0   | 1   | 0   | 0   | 0   |
 | `
 |
 */
#define COMP_RLITT_POSITIVITY_CONFIG_NULLTREE    (0X1U << 1U)

#define COMP_RLITT_POSITIVITY_CONFIG_SCION       (0X1U << 2U)

#define COMP_RLITT_POSITIVITY_CONFIG_IS_NULL     (0X1U << 3U)

/*************************** Compute Flags************************************/

/*
 *
 | Flag\bit                   | 7   | 6   | 5   | 4   | 3   | 2   | 1   | 0   |
 | -------------------------- | --- | --- | --- | --- | --- | --- | --- | --- |
 | Success                    | 0   | 0   | 0   | 0   | 0   | 0   | 0   | 0   |
 | Fail                       | 0   | 0   | 0   | 0   | 0   | 0   | 0   | 1   |
 | Config error               | 0   | 0   | 0   | 0   | 0   | 0   | 1   | 0   |
 | Already Computed           | 0   | 0   | 0   | 0   | 0   | 1   | 0   | 0   |
 | `
 |
 */



#define COMP_RLITT_POSITIVITY_COMPUTE_CFG_ERROR           (0X1U << 1U)

#define COMP_RLITT_POSITIVITY_COMPUTE_ALREADY_COMPUTED    (0X1U << 2U)

/******************************************************************************/
/*************************** Typedefs *****************************************/
/******************************************************************************/

#ifdef __cplusplus
extern "C"
{
#endif

typedef enum comp_rlitt_positivity_flvrs_e {
    COMP_RLITT_POSITIVITY_FLVR_UNINIT,
    COMP_RLITT_POSITIVITY_FLVR_POS,
    COMP_RLITT_POSITIVITY_FLVR_NEG,
    COMP_RLITT_POSITIVITY_FLVR_NEU,
    COMP_RLITT_POSITIVITY_FLVR_UND
} comp_rlitt_positivity_flvrs_e;
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C"
{
#endif

typedef struct {
    comp_rlitt_positivity_flvrs_e positivity;
} comp_rlitt_positivity_result_t;
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C"
{
#endif

typedef struct {
    storage_write_funptr_t storage_write;
    const note_wptt_t *    wptt;
} comp_rlitt_positivity_config_t;
#ifdef __cplusplus
}
#endif

/******************************************************************************/
/*************************** Public Function Declarations *********************/
/******************************************************************************/

#ifdef __cplusplus
extern "C"
{
#endif

uint8_t comp_rlitt_positivity_config(comp_rlitt_positivity_config_t *config_arg);

#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C"
{
#endif

uint8_t comp_rlitt_positivity_compute();

#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C"
{
#endif

const comp_rlitt_positivity_result_t *comp_rlitt_positivity_result();

#ifdef __cplusplus
}
#endif
#endif /* end COMPUTATION_RLITT_POSITIVITY_H */