Project

General

Profile

Download (829 Bytes) Statistics
| Branch: | Tag: | Revision:
1 04e26a3f xthirioux
2
#ifndef _ARROW
3
#define _ARROW
4
5
struct _arrow_mem {struct _arrow_reg {_Bool _first; } _reg; };
6
7 fa090c4e xthirioux
extern struct _arrow_mem *_arrow_alloc ();
8 04e26a3f xthirioux
9 80f93e0a xavier.thirioux
extern void _arrow_dealloc (struct _arrow_mem *);
10
11 fa090c4e xthirioux
#define _arrow_DECLARE(attr, inst)\
12
  attr struct _arrow_mem inst;
13 04e26a3f xthirioux
  
14
#define _arrow_LINK(inst) do {\
15
  ;\
16
} while (0)
17
18 fa090c4e xthirioux
#define _arrow_ALLOC(attr, inst)\
19
  _arrow_DECLARE(attr, inst);\
20
  _arrow_LINK(inst)
21
22 04a63d25 xthirioux
#define _arrow_init(self) {}
23
24
#define _arrow_clear(self) {}
25
26 6cbbe1c1 LĂ©lio Brun
/* #define _arrow_step(x,y,output,self) ((self)->_reg._first?((self)->_reg._first=0,(*output = x)):(*output = y)) */
27 04e26a3f xthirioux
28
#define _arrow_reset(self) {(self)->_reg._first = 1;}
29
30 2e6f9ba8 xthirioux
/* Step macro for specialized arrows of the form: (true -> false) */
31
32
#define _once_step(output,self) { *output = (self)->_reg._first; if ((self)->_reg._first) { (self)->_reg._first=0; }; }
33
34 04e26a3f xthirioux
#endif