예제 #1
0
long getFITSCards( FILE * FITSFile, long maxKeys, struct keyword * keys[])
/*  *    *    *    *    *    *    *    *    *    *    *    *    *    *    *  */
/* getFITSCards() reads file and table headers and returns an array of       */
/* keyword structures                                                        */
/*  *    *    *    *    *    *    *    *    *    *    *    *    *    *    *  */
{ long nCards = 0, nRead = 0, i = 0, cardType = FITSUNKNOWN;
  char aCard[90] = "";

  for (i = 0; i < maxKeys; i++) {
    nRead = fread( aCard, 80, 1, FITSFile);
    if (nRead != 1) 
      break;
    aCard[80] = EOS;
    cardType = parseCard( aCard, keys[i]);
    stripWhite( aCard);
    nCards++;
    if (cardType == FITSEND) 
      break;
  } /* end of for all cards in header */

  for (i = 0; (i + nCards) % 36 != 0; i++) 
    nRead = fread( aCard, 80, 1, FITSFile);

  return( nCards);
} /* end of getFITSCards */
예제 #2
0
파일: 54.cpp 프로젝트: ps-kostikov/puzzles
Hand parseHand(std::istream& in)
{
    Hand hand;
    std::string part;
    for (size_t i = 0; i < 5; ++i) {
        std::getline(in, part, ' ');
        hand.cards.push_back(parseCard(part));
    }
    return hand;
}