summaryrefslogtreecommitdiff
path: root/python/rpmmpw-py.h
blob: 2ad1da47fa85cf64d9996b33205de1c01d9b90af (plain)
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
#ifndef H_RPMMPW_PY
#define H_RPMMPW_PY

#include "rpmio_internal.h"

/** \ingroup py_c
 * \file python/rpmmpw-py.h
 */

/**
 */
typedef struct mpwObject_s {
    PyObject_HEAD
    int ob_size;
    mpw data[1];
} mpwObject;

/**
 */
/*@unchecked@*/
extern PyTypeObject mpw_Type;

#define	mpw_Check(_o)		PyObject_TypeCheck((_o), &mpw_Type)
#define mpw_CheckExact(_o)	((_o)->ob_type == &mpw_Type)

#define	MP_ROUND_B2W(_b)	MP_BITS_TO_WORDS((_b) + MP_WBITS - 1)

#define	MPW_SIZE(_a)	(size_t)((_a)->ob_size < 0 ? -(_a)->ob_size : (_a)->ob_size)
#define	MPW_DATA(_a)	((_a)->data)

/**
 */
mpwObject * mpw_New(int ob_size)
	/*@*/;

/**
 */
mpwObject * mpw_FromMPW(size_t size, mpw* data, int normalize)
	/*@*/;

#endif