- // Strip any leading spaces
- string::const_iterator Start = Bins.begin();
- for (; Start != Bins.end() && isspace(*Start) != 0; Start++);
+ if (Bins.length() >= BufSize)
+ {
+ delete [] Buffer;
+ // allocate new size based on buffer (but never smaller than 4000)
+ BufSize = max((unsigned long)4000, max((unsigned long)Bins.length()+1,2*BufSize));
+ Buffer = new char[BufSize];
+ }
+
+ strcpy(Buffer,Bins.c_str());
+ if (TokSplitString(',',Buffer,StaticBinList,
+ sizeof(StaticBinList)/sizeof(StaticBinList[0])) == false)
+ return 0;
+
+ return (const char **)StaticBinList;
+}
+ /*}}}*/
+// SrcRecordParser::BuildDepends - Return the Build-Depends information /*{{{*/
+// ---------------------------------------------------------------------
+/* This member parses the build-depends information and returns a list of
+ package/version records representing the build dependency. The returned
+ array need not be freed and will be reused by the next call to this
+ function */
+bool debSrcRecordParser::BuildDepends(vector<pkgSrcRecords::Parser::BuildDepRec> &BuildDeps, bool ArchOnly)
+{
+ unsigned int I;
+ const char *Start, *Stop;
+ BuildDepRec rec;
+ const char *fields[] = {"Build-Depends",
+ "Build-Depends-Indep",
+ "Build-Conflicts",
+ "Build-Conflicts-Indep"};
+
+ BuildDeps.clear();