#include <stdio.h>
#include "pslib.h"
#include "psmodule.h"

int main(int argc, char *argv[])
{
    if (argc != 2) {
	printf("Usage: %s CONFIG\n", argv[0]);
	exit(EXIT_FAILURE);
    }
    const char *configName = argv[1];
	
    int badLines = 0;			// Number of bad lines in camera configuration

    (void)psTraceSetLevel("pmFPAfromHeader", 10);

    psMetadata *camera = psMetadataParseConfig(NULL, &badLines, configName, true); // Camera config

    if (badLines > 0) {
	printf("%d bad lines encountered while reading %s\n", badLines, configName);
    }

    //psMetadataPrint(camera, 0);
   
    psMetadata *fpa = pmFPAfromHeader(camera);

    psFree(camera);
    psFree(fpa);

    return 0;
}
