1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
cardfind.c: if ( fits->index ) card = ft_cardfindidx(fits, key, &match);
cardfind.c: base = fits->index;
cardfind.c: if ( !fits->index ) ft_headindex(fits);
cardfind.c: for ( card = fits->cards; card != &fits->cards[fits->ncard]; card++ ) {
cardins.c: if ( fits->cards == NULL ) return NULL;
cardins.c: if ( fits->index ) Free(fits->index);
cardins.c: if ( fits->ncard+1 > fits->acard ) {
cardins.c: if ( here != NULL ) hereoffset = here - fits->cards;
cardins.c: if ( fits->mem != FT_MALLOC ) return NULL;
cardins.c: fits->acard += FT_CARDS;
cardins.c: fits->data = fits->acard * FT_CARDLEN;
cardins.c: ReAlloc(fits->cards, sizeof(FITSBuff) * fits->acard + 1);
cardins.c: ((char *)fits->cards)[sizeof(FITSBuff) * fits->acard] = '\0';
cardins.c: if ( here != NULL ) here = fits->cards + hereoffset;
cardins.c: ft_cardclr(&fits->cards[fits->acard-FT_CARDS], FT_CARDS);
cardins.c: if ( here == NULL ) here = &fits->cards[fits->ncard-2];
cardins.c: , (&fits->cards[fits->ncard-1]-here) * sizeof(FITSBuff));
cardins.c: fits->ncard++;
cardins.c: Free(fits->index);
cardins.c: fits->ncard--;
headdata.c: return Seek(sfile, fits->data, 0) != -1;
headfile.c: fits->seek = Tell(file);
headfile.c: memmove(fits->cards, card1, n);
headfile.c: if ( Read(file, (void *)&fits->cards[0].c[n],
headfile.c: Free(fits->cards);
headfile.c: if ( (end = ft_cardfindblok(&fits->cards[(nbloks-1) * FT_CARDS]
headfile.c: fits->ncard += FT_CARDS;
headfile.c: ReAlloc(fits->cards, (nbloks+1) * FT_BLOCK + 1);
headfile.c: ((char *)fits->cards)[(nbloks+1) * FT_BLOCK] = '\0';
headfile.c: ft_cardclr(&fits->cards[nbloks * FT_CARDS], FT_CARDS);
headfile.c: if ( Read(file, (void *)&fits->cards[nbloks * FT_CARDS],
headfile.c: Free(fits->cards);
headfile.c: fits->data = Tell(file);
headfile.c: fits->ncard = end - fits->cards + 1;
headfile.c: fits->acard = nbloks * FT_CARDS;
headfile.c: if ( fits->sync ) ft_synchead(fits);
headfile.c: Write(file, (void *)fits->cards,
headfile.c: FT_BLOCK, ((fits->ncard+FT_CARDS-1)/FT_CARDS));
headfile.c: return Seek(file, fits->seek, 0) != -1;
headfile.c: sync = fits->sync;
headfile.c: fits->sync = x;
headfind.c: if ( fits->index ) Free(fits->index);
headfind.c: Malloc(fits->index, sizeof(FITSCard *) * fits->ncard);
headfind.c: for ( i = 0; i < fits->ncard; i++ ) {
headfind.c: fits->index[i] = (FITSCard) &fits->cards[i];
headfind.c: qsort(fits->index, fits->ncard, sizeof(FITSCard *), ft_compare);
headimage.c: if ( fits->basic ) ft_basicfree(fits->basic);
headimage.c: if ( fits->image ) ft_imagefree(fits->image);
headimage.c: if ( fits->table ) ft_tablefree(fits->table);
headimage.c: fits->basic = ft_basicloadhead(fits);
headimage.c: fits->image = ft_imageloadhead(fits);
headimage.c: fits->table = ft_tableloadhead(fits);
headimage.c: if ( fits->basic ) ft_basicstorhead(fits, fits->basic);
headimage.c: if ( fits->image ) ft_imagestorhead(fits, fits->image);
headimage.c: if ( fits->table ) ft_tablestorhead(fits, fits->table);
headimage.c: if ( fits->basic == NULL ) return NULL;
headimage.c: if ( fits->basic->bitpix > 0 )
headinit.c: fits->mem = FT_MALLOC;
headinit.c: fits->primary = NULL;
headinit.c: fits->rfcount = 1;
headinit.c: fits->cards = fits->last = cards;
headinit.c: fits->acard = fits->ncard = Abs(bytes/FT_CARDLEN);
headinit.c: if ( bytes > 0 ) fits->mem = FT_EXTERN;
headinit.c: fits->ncard = end - fits->cards + 1;
headinit.c: fits->acard = ((fits->ncard+FT_CARDS-1)/FT_CARDS) * FT_CARDS;
headinit.c: fits->data = fits->acard * FT_CARDLEN;
headinit.c: fits->acard = bytes/FT_CARDLEN ? bytes/FT_CARDLEN : FT_CARDS;
headinit.c: (void)Calloc(fits->cards, sizeof(FITSBuff) * fits->acard + 1);
headinit.c: ((char *)fits->cards)[sizeof(FITSBuff) * fits->acard] = '\0';
headinit.c: ft_cardclr(fits->cards, fits->acard);
headinit.c: fits->ncard = 0;
headinit.c: fits->data = fits->acard * FT_CARDLEN;
headinit.c: fits->index = NULL;
headinit.c: fits->last = fits->cards;
headinit.c: fits->ncard = 1;
headinit.c: ft_cardkey(fits->cards, "END", 0);
headinit.c: fits->sync = 0;
headinit.c: fits->cache = NULL;
headinit.c: if ( fits->primary )
headinit.c: ft_primlink(fits->primary, head);
headinit.c: memmove(head->cards, fits->cards, head->acard * FT_CARDLEN);
headinit.c: if( head->index && !fits->index ){
headinit.c: if ( --fits->rfcount ) return;
headinit.c: if ( fits->index ) Free(fits->index);
headinit.c: if ( fits->basic ) ft_basicfree(fits->basic);
headinit.c: if ( fits->image ) ft_imagefree(fits->image);
headinit.c: if ( fits->table ) ft_tablefree(fits->table);
headinit.c: if ( fits->mem == FT_MALLOC && freecards ) Free(fits->cards);
headinit.c: if ( fits->mem == FT_MMAP ) ft_munmap(fits);
headinit.c: if ( fits->mem == FT_SHMAT ) ft_shmdt(fits);
headinit.c: if ( fits->primary ) ft_headfree(fits->primary, 1);
headinit.c: fits->primary = prim;
headinit.c: fits->cards = (FITSCard) cards;
headtable.c: table->col[i-1].width = fits->basic->naxis[0] - table->col[i-1].offset;
headtable.c: ft_basicstorhead(fits, fits->basic);
|