PR_PUBLIC_API(void) updateNewHistItem (DBT *key, DBT *data);
PR_PUBLIC_API(void) updateNewHistItem (DBT *key, DBT *data) { time_t	last,first,numaccess; int32 flg = (int32)*((char*)data->data + 3*sizeof(int32)); if (!displayHistoryItem((char*)key->data)) return; if (grdf != NULL) { HIST_COPY_INT32(&last, (time_t *)((char *)data->data)); HIST_COPY_INT32(&first, (time_t *)((char *)data->data + sizeof(int32))); HIST_COPY_INT32(&numaccess, (time_t *)((char *)data->data + 2*sizeof(int32)));  if (hostHash) collateOneHist(grdf, gNavCenter->RDF_HistoryBySite, (char*)key->data,                         ((char*)data->data + 4*sizeof(int32)),    last, first, numaccess, 0); if (ByDateOpened) collateOneHist(grdf, gNavCenter->RDF_HistoryByDate, (char*)key->data,                         ((char*)data->data + 4*sizeof(int32)),    last, first, numaccess, 1); }
PR_PUBLIC_API(void) updateNewHistItem (DBT *key, DBT *data);	/* XXX this should be elsewhere */	/* externs */extern	char	*profileDirURL;extern	char	*gGlobalHistoryURL;	/* external string references in allxpstr */extern	int	RDF_WEEKOF, RDF_WITHINLASTHOUR, RDF_TODAY, RDF_DAY_0;extern	int	RDF_RELATEDLINKSNAME;	/* globals */PLHashTable     *hostHash = 0;RDFT grdf = NULL;RDFT gHistoryStore = 0;PRBool ByDateOpened = 0;char    *prefixList[] = {	"about:", "javascript:", "livescript:", "mailbox:", "mailto:",	"mocha:", "news:", "pop3", "snews:", "view-source", "wysiwyg:", NULL	};char    *suffixList[] = {	".gif", ".jpg", ".jpeg", ".xbm", ".pfr", ".class", ".tmp", ".js", ".rdf", 	".mcf", ".mco", NULL	};char   *intermediateList[] = {        ".gif", ".GIF",  NULL	};voidcollateHistory (RDFT r, RDF_Resource u, PRBool byDateFlag){  HASHINFO hash = { 4*1024, 0, 0, 0, 0, 0};  DBT key, data;  time_t	last,first;  uint32	numaccess;  PRBool firstOne = 0;  DB* db = CallDBOpenUsingFileURL(gGlobalHistoryURL,  O_RDONLY ,0600,                                  DB_HASH, &hash);  grdf = r;  if (db != NULL)	{    if (!byDateFlag) {      hostHash = PL_NewHashTable(500, idenHash, PL_CompareValues,  PL_CompareValues,  null, null);    } else ByDateOpened = 1;    while (0 ==   (*db->seq)(db, &key, &data, (firstOne ? R_NEXT : R_FIRST))) {      char* title =    ((char*)data.data + 16);                /* title */      char* url =      (char*)key.data;                       /* url */      /* int32 flag = (int32)*((char*)data.data + 3*sizeof(int32)); */      int32 flag;      HIST_COPY_INT32(&flag, (int8 *)data.data + 3 * sizeof(int32));      firstOne = 1;#ifdef XP_UNIX      if ((/*1 == flag &&*/ displayHistoryItem((char*)key.data))) {#else      if (1 == flag && displayHistoryItem((char*)key.data)) {#endif	HIST_COPY_INT32(&last, (time_t *)((int8 *)data.data));	HIST_COPY_INT32(&first, (time_t *)((int8 *)data.data + sizeof(int32)));	HIST_COPY_INT32(&numaccess, (time_t *)((int8 *)data.data + 2*sizeof(int32)));	collateOneHist(r, u,url,title, last, first, numaccess, byDateFlag);      }    }    (*db->close)(db);  }}