File: ptupleobject.h

package info (click to toggle)
psyco 1.5.1-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,864 kB
  • ctags: 3,295
  • sloc: ansic: 24,491; python: 5,573; perl: 1,309; makefile: 166; sh: 1
file content (40 lines) | stat: -rw-r--r-- 1,444 bytes parent folder | download | duplicates (7)
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
 /***************************************************************/
/***            Psyco equivalent of tupleobject.h              ***/
 /***************************************************************/

#ifndef _PSY_TUPLEOBJECT_H
#define _PSY_TUPLEOBJECT_H


#include "pobject.h"
#include "pabstract.h"


#define TUPLE_ob_item   FARRAY(DEF_FIELD(PyTupleObject, PyObject*, ob_item, \
						FIX_size))
#define iTUPLE_OB_ITEM  FIELD_INDEX(TUPLE_ob_item)

/* The following macro reads an item from a Psyco tuple without any
   checks. Be sure the item has already been loaded in the array of
   the vinfo_t. This should only be used after a successful call to
   PsycoTuple_Load(). */
#define PsycoTuple_GET_ITEM(vtuple, index)  \
		((vtuple)->array->items[iTUPLE_OB_ITEM + (index)])


/***************************************************************/
/* virtual tuples.
   If 'source' is not NULL it gives the content of the tuple.
   If 'source' is NULL you have to initialize it yourself. */
EXTERNFN vinfo_t* PsycoTuple_New(int count, vinfo_t** source);

/* get the (possibly virtual) array of items in the tuple,
   returning the length of the tuple or -1 if it fails (items not known).
   The items are then found in PsycoTuple_GET_ITEM(tuple, i).
   Never sets a PycException. */
EXTERNFN int PsycoTuple_Load(vinfo_t* tuple);

EXTERNFN vinfo_t* PsycoTuple_Concat(PsycoObject* po, vinfo_t* v1, vinfo_t* v2);


#endif /* _PSY_TUPLEOBJECT_H */