int main(int argc, char *argv[]) { int i; Table_T identifiers = Table_new(0, NULL, NULL); for (i = 1; i < argc; i++) { FILE *fp = fopen(argv[i], "r"); if (fp == NULL) { fprintf(stderr, "%s: can't open '%s' (%s)\n", argv[0], argv[i], strerror(errno)); return EXIT_FAILURE; } else { xref(argv[i], fp, identifiers); fclose(fp); } } if (argc == 1) xref(NULL, stdin, identifiers); { int i; void **array = Table_toArray(identifiers, NULL); qsort(array, Table_length(identifiers), 2*sizeof (*array), compare); for (i = 0; array[i]; i += 2) { printf("%s", (char *)array[i]); print(array[i+1]); } FREE(array); } return EXIT_SUCCESS; }
//--------------------------------------------------------------------------- void File_Pdf::Read_Buffer_Continue() { switch (State) { case State_Parsing_xref : xref(); if (!Element_IsWaitingForMoreData()) trailer(); break; case State_Parsing_startxref : eof(); startxref(); break; case State_Parsing_object : break; //Using elements default : Finish(); } }
void I1::buildIndex() { try { XRef xref( fileName, row ); if( parentRes ) { primary->setTOC( document->tocIndexByRes( parentRes ) ); document->addXRef( parentRes, xref ); } else if( parentId ) { primary->setTOC( document->tocIndexById( parentId ) ); document->addXRef( parentId, xref ); } } catch( Class1Error& e ) { printError( e.code ); } }
void BlockSparseMatrix::RightMultiply(const double* x, double* y) const { CHECK_NOTNULL(x); CHECK_NOTNULL(y); for (int i = 0; i < block_structure_->rows.size(); ++i) { int row_block_pos = block_structure_->rows[i].block.position; int row_block_size = block_structure_->rows[i].block.size; VectorRef yref(y + row_block_pos, row_block_size); const vector<Cell>& cells = block_structure_->rows[i].cells; for (int j = 0; j < cells.size(); ++j) { int col_block_id = cells[j].block_id; int col_block_size = block_structure_->cols[col_block_id].size; int col_block_pos = block_structure_->cols[col_block_id].position; ConstVectorRef xref(x + col_block_pos, col_block_size); MatrixRef m(values_.get() + cells[j].position, row_block_size, col_block_size); yref += m.lazyProduct(xref); } } }
int main() { map<string, vector<int> > ret = xref(cin); for (map<string, vector<int> >::const_iterator it = ret.begin(); it != ret.end(); ++it) { cout << it->first << " occurs on line(s): "; vector<int>::const_iterator line_it = it->second.begin(); cout << *line_it; ++line_it; while(line_it != it->second.end()) { cout << ", " << *line_it; ++line_it; } cout << endl; } return 0; }