source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Export the manpath_manconf() function, slightly reorderng
@ 2011-11-24 10:43 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2011-11-24 10:43 UTC (permalink / raw)
  To: source

Log Message:
-----------
Export the manpath_manconf() function, slightly reorderng manpath.c while
doing so.  This will be used by a jailed man.cgi, as the cache built by
manup(8) creates a man.conf for it to use.

Modified Files:
--------------
    mdocml:
        manpath.c
        manpath.h

Revision Data
-------------
Index: manpath.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/manpath.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lmanpath.h -Lmanpath.h -u -p -r1.1 -r1.2
--- manpath.h
+++ manpath.h
@@ -29,6 +29,7 @@ struct	manpaths {
 
 __BEGIN_DECLS
 
+void	 manpath_manconf(struct manpaths *);
 void	 manpath_parse(struct manpaths *, char *, char *);
 void	 manpath_parseconf(struct manpaths *);
 void	 manpath_parseline(struct manpaths *, char *);
Index: manpath.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/manpath.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lmanpath.c -Lmanpath.c -u -p -r1.1 -r1.2
--- manpath.c
+++ manpath.c
@@ -92,8 +92,8 @@ manpath_add(struct manpaths *dirs, const
 void
 manpath_parseconf(struct manpaths *dirs)
 {
-	FILE		*stream;
 #ifdef	USE_MANPATH
+	FILE		*stream;
 	char		*buf;
 	size_t		 sz, bsz;
 
@@ -123,6 +123,25 @@ manpath_parseconf(struct manpaths *dirs)
 	free(buf);
 	pclose(stream);
 #else
+	manpath_manconf(dirs);
+#endif
+}
+
+void
+manpath_free(struct manpaths *p)
+{
+	int		 i;
+
+	for (i = 0; i < p->sz; i++)
+		free(p->paths[i]);
+
+	free(p->paths);
+}
+
+void
+manpath_manconf(struct manpaths *dirs)
+{
+	FILE		*stream;
 	char		*p, *q;
 	size_t	 	 len, keysz;
 
@@ -152,16 +171,4 @@ manpath_parseconf(struct manpaths *dirs)
 	}
 
 	fclose(stream);
-#endif
-}
-
-void
-manpath_free(struct manpaths *p)
-{
-	int		 i;
-
-	for (i = 0; i < p->sz; i++)
-		free(p->paths[i]);
-
-	free(p->paths);
 }
--
 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:[~2011-11-24 10:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-24 10:43 mdocml: Export the manpath_manconf() function, slightly reorderng kristaps

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).