diff options
author | KRIXUS-alpha | 2021-05-12 20:15:09 +0530 |
---|---|---|
committer | KRIXUS-alpha | 2021-05-12 20:15:09 +0530 |
commit | 96edee02e6414bf26b21420405cfc299f85683d3 (patch) | |
tree | 4492ed56bf5120b599fc7ddd5405fb1b906edf09 /src/fun.h | |
parent | 4577cf0e9028018bffbf5be5fea3c4d86a8f9474 (diff) | |
download | fossee-scilab-octave-toolbox-96edee02e6414bf26b21420405cfc299f85683d3.tar.gz fossee-scilab-octave-toolbox-96edee02e6414bf26b21420405cfc299f85683d3.tar.bz2 fossee-scilab-octave-toolbox-96edee02e6414bf26b21420405cfc299f85683d3.zip |
documentation struct data handling
Diffstat (limited to 'src/fun.h')
-rw-r--r-- | src/fun.h | 78 |
1 files changed, 41 insertions, 37 deletions
@@ -16,32 +16,31 @@ extern "C" { /** - * - * @brief Enumeration for the data types suported by the fun() + * @brief Enumeration for the data types suported * */ typedef enum { - TYPE_DOUBLE, /**similar to scilab double*/ - TYPE_COMPLEX, /**similar to scilab complex*/ - TYPE_STRING, /**similar to scilab string*/ - TYPE_STRUCT, /**similar to scilab struct*/ + TYPE_DOUBLE, /**<similar to scilab double*/ + TYPE_COMPLEX, /**<similar to scilab complex*/ + TYPE_STRING, /**<similar to scilab string*/ + TYPE_STRUCT, /**<similar to scilab struct*/ }FUNCTYPE; /** * @struct FUNCSTRUCT * @brief Struct used to pass structs to Octave from the fun library - * @var type * */ typedef struct { - FUNCTYPE type; /// Type of value in struct's field - void* key; /// key of struct field - int rows; /// rows dimension of struct field's value - int cols; /// cols dimension of struct fields' value - void* dataReal; /// Real data if struct field's value is real - void* dataImg; /// Img data if struct field's value is complex - void* str; /// String data if struct field's value is string + FUNCTYPE type; /**< Type of value in struct's field*/ + void* key; /**< key of struct field*/ + int rows; /**< rows dimension of struct field's value*/ + int cols; /**< cols dimension of struct fields' value*/ + void* dataReal; /**< Real data if struct field's value is real*/ + void* dataImg; /**< Img data if struct field's value is complex*/ + void* str; /**< String data if struct field's value is string*/ + } FUNCSTRUCT; /** @@ -50,34 +49,39 @@ extern "C" */ typedef struct { - FUNCTYPE type; /// Type of data - int n_in_rows; /// Input rows dimension of data - int n_in_cols; /// Input cols dimension of data - int n_in_struct_len; /// input struct length - int n_out_rows; /// Ouput rows dimension of data - int n_out_cols; /// Output cold dimension of data - int n_out_struct_len; /// Output struct length - int is_in_cmplx; /// Input is a Complex data type - int is_out_cmplx; /// Output is a Complex data type - int is_out_struct; /// Output is a Struct data type - void* in_data_real; /// Input real part (complex) array - void* in_data_img; /// Input imaginary part (complex) array - void* out_data_real; /// Output real part (complex) array - void* out_data_img; /// Output imaginary part (complex) array - FUNCSTRUCT* in_struct; /// Input struct - FUNCSTRUCT* out_struct; /// Output struct + /*@{*/ + FUNCTYPE type; /**< Type of data */ + int n_in_rows; /**< Input rows dimension of data*/ + int n_in_cols; /**< Input cols dimension of data*/ + int n_in_struct_len; /**< input struct length*/ + int n_out_rows; /**< Ouput rows dimension of data*/ + int n_out_cols; /**< Output cold dimension of data*/ + int n_out_struct_len; /**< Output struct length*/ + int is_in_cmplx; /**< Input is a Complex data type*/ + int is_out_cmplx; /**< Output is a Complex data type*/ + int is_out_struct; /**< Output is a Struct data type*/ + int is_out_string; /**< Output is a String data type*/ + void* in_data_real; /**< Input real part (complex) array*/ + void* in_data_img; /**< Input imaginary part (complex) array*/ + void* out_data_real; /**< Output real part (complex) array*/ + void* out_data_img; /**< Output imaginary part (complex) array*/ + FUNCSTRUCT* in_struct; /**< Input struct */ + FUNCSTRUCT* out_struct; /**< Output struct*/ + /*@}*/ } FUNCARGS; /** * @brief Struct used to call and pass the data to fun.cpp API * */ typedef struct { - int n_in_arguments; /// Number of input arguments - int n_out_arguments; /// Number of output arguments - int n_out_user; /// Number of output arguments - char *err; /// Return errors - //char *package; //Name of octave package to be loaded - FUNCARGS *argument; /// Struct defining and containing the data + /*@{*/ + int n_in_arguments; /**< Number of input arguments*/ + int n_out_arguments; /**< Number of output arguments*/ + int n_out_user; /**< Number of output arguements expected to be returned */ + char *err; /**< Return errors*/ + //char *package; //Name of octave package to be loaded*/ + FUNCARGS *argument; /**< Struct defining and containing the data*/ + /*@}*/ } FUNCCALL; /** * @brief API Function to call/receive and pass the data to fun API @@ -85,7 +89,7 @@ extern "C" * * @param arr Input data FUNCARGS * @param call Input Arguments FUNCCALL - * @return int + * @return int Status Code */ int fun(FUNCARGS *arr, FUNCCALL *call); } |