2 # This file is Copyright 2010 Dean Hall.
4 # This file is part of the PyMite VM.
5 # The PyMite VM is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU GENERAL PUBLIC LICENSE Version 2.
8 # The PyMite VM is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 # A copy of the GNU GENERAL PUBLIC LICENSE Version 2
12 # is seen in the file COPYING in this directory.
16 #ifndef __BYTEARRAY_H__
17 #define __BYTEARRAY_H__
21 * \brief Bytearray Object Type
23 * Bytearray object type header.
30 * Holds actual byte payload
32 typedef struct PmBytes_s
34 /** Object descriptor */
37 /** Physical number of bytes in the C array (below) */
40 /** C array of bytes */
49 * Mutable ordered sequence of bytes. Contains ptr to chunk of bytes.
51 typedef struct PmBytearray_s
53 /** Object descriptor */
56 /** Bytearray length; logical number of bytes */
59 /** Ptr to bytes container (may hold more bytes than length) */
65 PmReturn_t
bytearray_new(pPmObj_t pobj
, pPmObj_t
*r_pobj
);
66 PmReturn_t
bytearray_getItem(pPmObj_t pobj
, int16_t index
, pPmObj_t
*r_pobj
);
67 PmReturn_t
bytearray_setItem(pPmObj_t pba
, int16_t index
, pPmObj_t pobj
);
68 PmReturn_t
bytearray_print(pPmObj_t pobj
);
70 #endif /* __BYTEARRAY_H__ */