* mdocml: Allow saving more than one mlink per mpage in the mlinks ohash.
@ 2013-12-27 16:17 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2013-12-27 16:17 UTC (permalink / raw)
To: source
Log Message:
-----------
Allow saving more than one mlink per mpage in the mlinks ohash.
We are still only using one of them for now.
Actually, we are now using a different one,
but the order the mlinks are found is random anyway.
Modified Files:
--------------
mdocml:
mandocdb.c
Revision Data
-------------
Index: mandocdb.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandocdb.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.85 -r1.86
--- mandocdb.c
+++ mandocdb.c
@@ -142,7 +142,6 @@ static void filescan(const char *);
static void *hash_alloc(size_t, void *);
static void hash_free(void *, size_t, void *);
static void *hash_halloc(size_t, void *);
-static int inocheck(const struct stat *);
static void mlink_add(struct mlink *, const struct stat *);
static void mlink_free(struct mlink *);
static void mpages_free(void);
@@ -558,10 +557,6 @@ treescan(void)
if (warnings)
say(path, "Extraneous file");
continue;
- } else if (inocheck(ff->fts_statp)) {
- if (warnings)
- say(path, "Duplicate file");
- continue;
} else if (NULL == (fsec =
strrchr(ff->fts_name, '.'))) {
if ( ! use_all) {
@@ -711,10 +706,6 @@ filescan(const char *file)
exitcode = (int)MANDOCLEVEL_BADARG;
say(file, "Not a regular file");
return;
- } else if (inocheck(&st)) {
- if (warnings)
- say(file, "Duplicate file");
- return;
}
start = buf + strlen(basedir);
mlink = mandoc_calloc(1, sizeof(struct mlink));
@@ -769,20 +760,6 @@ filescan(const char *file)
mlink->name = mandoc_strdup(mlink->name);
mlink_add(mlink, &st);
-}
-
-static int
-inocheck(const struct stat *st)
-{
- struct inodev inodev;
- uint32_t hash;
-
- memset(&inodev, 0, sizeof(inodev));
- inodev.st_ino = hash = st->st_ino;
- inodev.st_dev = st->st_dev;
-
- return(NULL != ohash_find(&mpages, ohash_lookup_memory(
- &mpages, (char *)&inodev, sizeof(inodev), hash)));
}
static void
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-12-27 16:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-27 16:17 mdocml: Allow saving more than one mlink per mpage in the mlinks ohash schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).