| 1 | #include <stdio.h>
|
|---|
| 2 | #include "pslib.h"
|
|---|
| 3 |
|
|---|
| 4 | int main ()
|
|---|
| 5 | {
|
|---|
| 6 | psFits *f;
|
|---|
| 7 | psMetadata *head;
|
|---|
| 8 | psMetadataIterator *iter;
|
|---|
| 9 | psMetadataItem *item;
|
|---|
| 10 | int count = 0;
|
|---|
| 11 | // char *string;
|
|---|
| 12 |
|
|---|
| 13 | f = psFitsAlloc("./phot.db");
|
|---|
| 14 |
|
|---|
| 15 | // move to first table
|
|---|
| 16 | psFitsMoveExtNum(f, 1, false);
|
|---|
| 17 |
|
|---|
| 18 | head = psFitsReadHeader(NULL, f);
|
|---|
| 19 | if (head == NULL)
|
|---|
| 20 | printf("Null head\n");
|
|---|
| 21 |
|
|---|
| 22 | printf("\nDATATYPES -> BOOL=%d, S32=%d, F32=%d, F64=%d, STR=%d\n", PS_DATA_BOOL, PS_DATA_S32, PS_DATA_F32, PS_DATA_F64, PS_DATA_STRING);
|
|---|
| 23 | iter = psMetadataIteratorAlloc(head, PS_LIST_HEAD, NULL);
|
|---|
| 24 | while (item != NULL) {
|
|---|
| 25 | item = psMetadataGetAndIncrement(iter);
|
|---|
| 26 | printf(" %d) Current type = %d \n", count, item->type);
|
|---|
| 27 | count ++;
|
|---|
| 28 | }
|
|---|
| 29 | printf("\nCount = %d\n", count);
|
|---|
| 30 |
|
|---|
| 31 | // string = psMetadataConfigFormat(head);
|
|---|
| 32 | // if ( string == NULL )
|
|---|
| 33 | // printf("%s\n", psMetadataConfigFormat(head));
|
|---|
| 34 | psFree(f);
|
|---|
| 35 | psFree(item);
|
|---|
| 36 | psFree(iter);
|
|---|
| 37 | }
|
|---|