perky 03/06/02 02:24:51
Modified: src codeccommon.h
Log:
Add PAVE* macroes for encoders.
Revision Changes Path
1.11 +20 -1 cjkcodecs/src/codeccommon.h
Index: codeccommon.h
===================================================================
RCS file: /cvsroot/koco/cjkcodecs/src/codeccommon.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- codeccommon.h 31 May 2003 11:50:19 -0000 1.10
+++ codeccommon.h 2 Jun 2003 09:24:50 -0000 1.11
@@ -26,7 +26,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: codeccommon.h,v 1.10 2003/05/31 11:50:19 perky Exp $
+ * $Id: codeccommon.h,v 1.11 2003/06/02 09:24:50 perky Exp $
*/
#include "Python.h"
@@ -86,6 +86,25 @@
#define RESERVE_OUTBUF(n) \
if (outleft < (n)) \
return MBERR_TOOSMALL;
+
+#define PAVE1(c1) \
+ RESERVE_OUTBUF(1) \
+ (*outbuf)[0] = (unsigned char)(c1);
+#define PAVE2(c1, c2) \
+ RESERVE_OUTBUF(2) \
+ (*outbuf)[0] = (unsigned char)(c1); \
+ (*outbuf)[1] = (unsigned char)(c2);
+#define PAVE3(c1, c2, c3) \
+ RESERVE_OUTBUF(3) \
+ (*outbuf)[0] = (unsigned char)(c1); \
+ (*outbuf)[1] = (unsigned char)(c2); \
+ (*outbuf)[2] = (unsigned char)(c3);
+#define PAVE4(c1, c2, c3, c4) \
+ RESERVE_OUTBUF(4) \
+ (*outbuf)[0] = (unsigned char)(c1); \
+ (*outbuf)[1] = (unsigned char)(c2); \
+ (*outbuf)[2] = (unsigned char)(c3); \
+ (*outbuf)[3] = (unsigned char)(c4);
#define _TRYMAP_ENC(m, assi, val) \
if ((m)->map != NULL && (val) >= (m)->bottom && \
|