bool [% table.namespace %]PrintObjects(FILE *stream, psArray *objects, bool mdcf)
{
    PS_ASSERT_PTR_NON_NULL(objects, false);

    psMetadata *output = psMetadataAlloc();
    for (long i = 0; i < psArrayLength(objects); i++) {
        psMetadata *md = [% table.namespace %]MetadataFromObject(objects->data[i]);
        if (!psMetadataAddMetadata(
            output,
            PS_LIST_TAIL,
            [% table.namespace FILTER upper %]_TABLE_NAME,
            PS_META_DUPLICATE_OK,
            NULL,
            md
        )) {
            psError(PS_ERR_UNKNOWN, false, "failed to add metadata");
            psFree(md);
            psFree(output);
            return false;
        }
        psFree(md);
    }

    if (![% pkg_namespace %]PrintMetadataRaw(stream, output, mdcf)) {
        psError(PS_ERR_UNKNOWN, false, "failed to print metadata");
        psFree(output);
    }
    psFree(output);

    return true;
}
