6 #include "dynamicCharacterOperations.h"
8 #define __STDC_FORMAT_MACROS
10 size_t dynCharSize(size_t alphSize
, size_t numElems
) { return 1; }
12 size_t dcElemSize(size_t alphSize
) { return 1; }
14 packedChar
*allocatePackedChar( size_t alphSize
, size_t numElems
) {
15 packedChar
*outChar
= (packedChar
*) calloc( dynCharSize(alphSize
, numElems
), sizeof(packedChar
) );
16 if (outChar
== NULL
) {
17 printf("Out of memory.\n");
24 packedChar
*makePackedCharCopy( packedChar
*inChar
, size_t alphSize
, size_t numElems
) {
25 packedChar
*outChar
= allocatePackedChar(alphSize
, numElems
);
26 size_t length
= dynCharSize(alphSize
, numElems
);
27 for (size_t i
= 0; i
< length
; i
++) {
28 outChar
[i
] = inChar
[i
];
33 void freeDynChar( dynChar_t
*p
) { free( p
->dynChar
); }
35 void freeDCElem( const dcElement_t
*p
) { free( p
->element
); }