You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
906 B
26 lines
906 B
2 years ago
|
/*
|
||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||
|
*
|
||
|
* Copyright 1997 - July 2008 CWI, August 2008 - 2022 MonetDB B.V.
|
||
|
*/
|
||
|
|
||
|
#ifndef _MAL_STACK_H_
|
||
|
#define _MAL_STACK_H_
|
||
|
#include "mal.h"
|
||
|
|
||
|
#define stackSize(CNT) (sizeof(ValRecord)*(CNT) + offsetof(MalStack, stk))
|
||
|
|
||
|
mal_export MalStkPtr newGlobalStack(int size);
|
||
|
mal_export MalStkPtr reallocGlobalStack(MalStkPtr s, int cnt);
|
||
|
mal_export void freeStack(MalStkPtr stk);
|
||
|
|
||
|
#define getStkRecord(S,P,I) &(S)->stk[(P)->argv[I]]
|
||
|
#define getStkValue(S,P,I) ( getStkType(S,P,I)== TYPE_str? \
|
||
|
getStkRecord(S,P,I)->val.sval :\
|
||
|
getStkRecord(S,P,I)->val.pval )
|
||
|
#define getStkType(S,P,I) (S)->stk[(P)->argv[I]].vtype
|
||
|
#define setStkType(S,P,I,T) (S)->stk[(P)->argv[I]].vtype = T
|
||
|
#endif /* _MAL_STACK_H_ */
|