int main(int argc, char* argv[]){ //cout<<"The MIT License (MIT)\n\nPSpice to Oscad Schematic Converter\nCopyright (c) 2014, Siddhant Ranade and Ashlesha Atrey, FOSSEE, IIT Bombay\n\nSee LICENSE.txt"<<endl; for(int fcounter=1; fcounter<argc; fcounter++){ ifstream file(argv[fcounter]); string fbasename=basename(string(argv[fcounter]), 1); string flname=fbasename + ".lib"; flib.open(flname.c_str()); cerr<<"Library file name: "<<flname<<endl; //Write .lib header: flib<<libDescr; string line=skipTo(file, "*symbol"); while(line!="__ERROR__"){ int d=line.find(" "); string cnametmp = line.substr(d+1, line.npos); ///cerr<<cnametmp<<endl; ///DEBUG; d=cnametmp.find(" "); string cname=cnametmp.substr(0, d); ///cerr<<cname<<endl; ///DEBUG; ifstream fileTMP(argv[fcounter]); Component c(fileTMP, cname); ///cerr<<"Created "<<cname<<endl; fixComp(c); bool write=true; for(int i=0; i<REMOVEDCOMPONENTS.size(); i++){ //Don't let these components be saved. if(cname==REMOVEDCOMPONENTS[i]) { write=false; ///cerr<<"Skipping "<<cname<<endl; break; } } if(write){ c.type = c.type + nameAppend; c.print(flib); //components.push_back(c); } line=skipTo(file, "*symbol"); ///cerr<<line<<endl; ///DEBUG } //Write .lib file footer: flib<<"#\n#End Library"<<endl; flib.close(); } }
void PlayerInterface::previous() { if(d->m_playlist->currentTrack() >= 0) { skipTo(d->m_playlist->currentTrack() - 1); } }
uchar rid( FILE *fp ) { skipTo(fp,'('); uint id; fscanf(fp,"%i)\n",&id); return id; }
char *mustSkipTo(struct lineFile *lf, char *lineStart) /* Skip to line that starts with lineStart or die. */ { char *line = skipTo(lf, lineStart); if (line == NULL) errAbort("Couldn't find a line that starts with '%s' in %s", lineStart, lf->fileName); return line; }
bool PhotoFrameSource::deserializeFromPb(const PbPhotoFrameSource * pbSource) { assert(pbSource); // read the current resource id if (pbSource->has_current_resource_id()) skipTo(qstring(pbSource->current_resource_id())); return true; }
static void skipToOneOf3 (tokenInfo *const token, const tokenType type1, const tokenType type2, const tokenType type3) { while (token->type != TOKEN_EOF && token->type != type1 && token->type != type2 && token->type != type3) { readToken (token); if (token->type == TOKEN_OPEN_CURLY) { skipTo (token, TOKEN_CLOSE_CURLY); readToken (token); } else if (token->type == TOKEN_OPEN_SQUARE) { skipTo (token, TOKEN_CLOSE_SQUARE); readToken (token); } } }
bool LocalPhotoFrameSource::unserialize(unsigned char *buf, uint &bufSz) { // XXX // xxx-photoframe: versioning eventually // if version 1 then ... // else ... QString datStr; if (!SERIALIZE_READ_QSTRING(&buf, datStr, bufSz)) return false; // The last source resource id skipTo(datStr); if (!SERIALIZE_READ_QSTRING(&buf, datStr, bufSz)) return false; _localPath = QDir(datStr); return true; }
bool FlickrPhotoFrameSource::unserialize(unsigned char *buf, uint &bufSz) { // XXX // xxx-photoframe: versioning eventually // if version 1 then ... // else ... // Read each parameter QString datStr; QString rssFeed, groupId, tag, userId; bool success = true; if (!SERIALIZE_READ_QSTRING(&buf, datStr, bufSz)) return false; // The last source resource id skipTo(datStr); // In version 14 we removed serializing the rssFeed in FlickrPhotoFrames // now the rssFeed is sourced in FlickrPhotoFrames parent, RSSPhotoFrame if (SCENE_VERSION_NUMBER < 14) { if (!SERIALIZE_READ_QSTRING(&buf, datStr, bufSz)) return false; rssFeed = datStr; } if (!SERIALIZE_READ_QSTRING(&buf, datStr, bufSz)) return false; groupId = datStr; if (!SERIALIZE_READ_QSTRING(&buf, datStr, bufSz)) return false; tag = datStr; if (!SERIALIZE_READ_QSTRING(&buf, datStr, bufSz)) return false; userId = datStr; // If we are using an old scene, store the rssFeed inside the RSSPhotoFrameSource // member _rssFeedUrl if (SCENE_VERSION_NUMBER < 14) _rssFeedUrl = rssFeed; _tag = tag; _groupId = groupId; _userId = userId; // Create the FlickrFrames directory to dump photos in createLocalCacheDirectory(); return true; }
struct segment *parseSegment(char *fileName, int start, int end, char *retSeqName) /* Read in a genscan file into segment. */ { struct lineFile *lf = lineFileOpen(fileName, TRUE); struct segment *seg; char *line; struct genScanFeature *gsfList = NULL, *gsf; struct genScanGene *gsg; char *words[2]; if (!lineFileNext(lf, &line, NULL)) errAbort("%s is empty", fileName); if (!startsWith("GENSCAN ", line)) errAbort("%s is not a GENSCAN output file", fileName); if (retSeqName != NULL) { line = mustSkipTo(lf, "Sequence"); if (chopLine(line, words) < 2) errAbort("Expecting sequence name line %d of %s", lf->lineIx, lf->fileName); strcpy(retSeqName, words[1]); } mustSkipTo(lf, "Predicted genes/exons"); mustSkipTo(lf, "Gn.Ex"); mustSkipTo(lf, "-----"); AllocVar(seg); seg->start = start; seg->end = end; for (;;) { if (!lineFileNext(lf, &line, NULL)) break; line = skipLeadingSpaces(line); if (line == NULL || line[0] == 0) continue; if (!isdigit(line[0])) { lineFileReuse(lf); break; } gsf = parseGenscanLine(lf, line); slAddHead(&gsfList, gsf); } slReverse(&gsfList); printf("Got %d exons\n", slCount(gsfList)); seg->geneList = bundleGenes(gsfList); seg->geneList = filterEmptyGenes(seg->geneList); gsfList = NULL; printf("Got %d genes\n", slCount(seg->geneList)); if (!lineFileNext(lf, &line, NULL)) errAbort("Unexpected end of file in %s", lf->fileName); if (startsWith("Suboptimal exons", line)) { mustSkipTo(lf, "-----"); for (;;) { if (!lineFileNext(lf, &line, NULL)) break; line = skipLeadingSpaces(line); if (line == NULL || line[0] == 0) continue; if (!startsWith("S.", line)) break; gsf = parseGenscanLine(lf, line); slAddHead(&gsfList, gsf); } slReverse(&gsfList); seg->suboptList = gsfList; printf("Got %d suboptimal exons\n", slCount(seg->suboptList)); } lineFileReuse(lf); mustSkipTo(lf, "Predicted peptide sequence"); if ((line = skipTo(lf, ">")) != NULL) { lineFileReuse(lf); for (gsg = seg->geneList; gsg != NULL; gsg = gsg->next) { aaSeq seq; if (!faPepSpeedReadNext(lf, &seq.dna, &seq.size, &seq.name)) errAbort("Not enough predicted peptides in %s\n", lf->fileName); gsg->translation = cloneString(seq.dna); } } lineFileClose(&lf); return seg; }
bool AbstractAllTermDocs::next() { return skipTo(_doc + 1); }
void PlayerInterface::next() { const int nextTrackIndex = d->m_playlist->nextTrack(); skipTo(nextTrackIndex); }
void KSB_MediaWidget::skipToWrapper(int second) { emit skipTo((unsigned long)(second*1000)); }