forked from pllua/pllua-deprecated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrtupdescstk.h
58 lines (38 loc) · 1.22 KB
/
rtupdescstk.h
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
49
50
51
52
53
54
55
56
57
58
/*
* functions for tupledesc resource management
* Author: Eugene Sergeev <eugeney.sergeev at gmail.com>
* Please check copyright notice at the bottom of pllua.h
*/
#ifndef RTUPDESCSTK_H
#define RTUPDESCSTK_H
#include "plluacommon.h"
#include <stdlib.h>
struct stackType;
typedef struct RTDnode {
void *data;
struct RTDnode *next;
struct RTDnode *prev;
struct stackType *tail;
} RTDNode, *RTDNodePtr;
typedef struct stackType {
int ref_count;
lua_State *L;
RTDNodePtr top;
void *resptr;
struct stackType **cleanup_ptr; /*func ptr to this struct*/
} RTupDescStackType, *RTupDescStack;
RTupDescStack rtds_set_current(void *s);
RTupDescStack rtds_get_current(void);
int rtds_get_length(RTupDescStack S);
RTupDescStack rtds_initStack(lua_State *L);
RTupDescStack rtds_initStack_weak(lua_State *L, RTupDescStack *wp);
int rtds_isempty(RTupDescStack S);
void *rtds_pop(RTupDescStack S);
void rtds_tryclean(RTupDescStack S);
RTDNodePtr rtds_push_current(void *d);
void rtds_remove_node(RTDNodePtr np);
void rtds_inuse(RTupDescStack S);
void rtds_notinuse(RTupDescStack S);
RTupDescStack rtds_unref(RTupDescStack S);
RTupDescStack rtds_free_if_not_used(RTupDescStack S);
#endif // RTUPDESCSTK_H