-#define BUFF_SIZE 8192
-
-
-/*
- * add single product to repo
- *
- */
-
-static void
-add_code11_product(struct parsedata *pd, FILE *fp)
-{
- char buf[BUFF_SIZE];
- int l;
- struct stat st;
-
- if (!fstat(fileno(fp), &st))
- {
- pd->currentproduct = st.st_ino;
- pd->ctime = (unsigned int)st.st_ctime;
- }
- else
- {
- pd->currentproduct = pd->baseproduct + 1; /* make it != baseproduct if stat fails */
- perror("fstat");
- pd->ctime = 0;
- }
-
- XML_Parser parser = XML_ParserCreate(NULL);
- XML_SetUserData(parser, pd);
- XML_SetElementHandler(parser, startElement, endElement);
- XML_SetCharacterDataHandler(parser, characterData);
-
- for (;;)
- {
- l = fread(buf, 1, sizeof(buf), fp);
- if (XML_Parse(parser, buf, l, l == 0) == XML_STATUS_ERROR)
- {
- pool_debug(pd->pool, SAT_ERROR, "%s: %s at line %u:%u\n", pd->filename, XML_ErrorString(XML_GetErrorCode(parser)), (unsigned int)XML_GetCurrentLineNumber(parser), (unsigned int)XML_GetCurrentColumnNumber(parser));
- pool_debug(pd->pool, SAT_ERROR, "skipping this product\n");
- XML_ParserFree(parser);
- return;
- }
- if (l == 0)
- break;
- }
- XML_ParserFree(parser);
-}
-
-
-void