[89ea83]: mex / block_interface.h  Maximize  Restore  History

Download this file

49 lines (40 with data), 1.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* This mex file serves as an object-like storage of data for the
* block processing framework. The data is made persistent between
* calls.
* */
#include "mex.h"
#define COMMAND_LENGTH 20
#define ARRAYLEN(x) ((sizeof(x))/(sizeof(*x)))
/*
* Structure for holding attributes
* */
typedef struct biEntry biEntry;
struct biEntry
{
char name[COMMAND_LENGTH];
mxArray* var;
void (*setter)(biEntry* obj,const mxArray* in);
mxArray* (*getter)(biEntry* obj);
};
/*
* Default setter and getter functions
* */
void defaultSetter(biEntry* obj,const mxArray* in);
mxArray* defaultGetter(biEntry* obj);
/*
* General functions
* */
biEntry* lookupEntry(const char* name, biEntry* dict, size_t dictLen);
void resetAll(biEntry* dict, size_t dictLen);
void clearAll(biEntry* dict, size_t dictLen);
void clearAllWrapper();
/*
* Custom functions
* */
mxArray* getSource(biEntry* obj);
mxArray* getEnqBufCount(biEntry* obj);
mxArray* getToPlay(biEntry* obj);
void incPageNo();
void pushPage(const mxArray* in);
mxArray* popPage();