source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: Cleanup, no functional change: Move the roffhash_*() functions
@ 2018-12-13  6:18 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2018-12-13  6:18 UTC (permalink / raw)
  To: source

Log Message:
-----------
Cleanup, no functional change:
Move the roffhash_*() functions from roff.h to roff_int.h 
because they are only intended for use by parsers,
neither by main programs nor by formatters.

Modified Files:
--------------
    mandoc:
        mandoc_headers.3
        read.c
        roff.h
        roff_int.h

Revision Data
-------------
Index: roff_int.h
===================================================================
RCS file: /home/cvs/mandoc/mandoc/roff_int.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -Lroff_int.h -Lroff_int.h -u -p -r1.10 -r1.11
--- roff_int.h
+++ roff_int.h
@@ -1,7 +1,7 @@
 /*	$Id$	*/
 /*
  * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2013, 2014, 2015, 2018 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -14,6 +14,8 @@
  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Parser internals shared by multiple parsers.
  */
 
 struct roff_node *roff_node_alloc(struct roff_man *, int, int,
@@ -29,6 +31,10 @@ void		  roff_node_unlink(struct roff_man
 void		  roff_node_relink(struct roff_man *, struct roff_node *);
 void		  roff_node_free(struct roff_node *);
 void		  roff_node_delete(struct roff_man *, struct roff_node *);
+
+struct ohash	 *roffhash_alloc(enum roff_tok, enum roff_tok);
+enum roff_tok	  roffhash_find(struct ohash *, const char *, size_t);
+void		  roffhash_free(struct ohash *);
 
 /*
  * Functions called from roff.c need to be declared here,
Index: roff.h
===================================================================
RCS file: /home/cvs/mandoc/mandoc/roff.h,v
retrieving revision 1.62
retrieving revision 1.63
diff -Lroff.h -Lroff.h -u -p -r1.62 -r1.63
--- roff.h
+++ roff.h
@@ -14,6 +14,8 @@
  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Common data types for all syntax trees and related functions.
  */
 
 struct	ohash;
@@ -577,7 +579,4 @@ extern	const char *const *roff_name;
 
 
 void		 deroff(char **, const struct roff_node *);
-struct ohash	*roffhash_alloc(enum roff_tok, enum roff_tok);
-enum roff_tok	 roffhash_find(struct ohash *, const char *, size_t);
-void		 roffhash_free(struct ohash *);
 void		 roff_validate(struct roff_man *);
Index: mandoc_headers.3
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mandoc_headers.3,v
retrieving revision 1.23
retrieving revision 1.24
diff -Lmandoc_headers.3 -Lmandoc_headers.3 -u -p -r1.23 -r1.24
--- mandoc_headers.3
+++ mandoc_headers.3
@@ -167,6 +167,9 @@ and the functions
 and
 .Fn mandoc_xr_free .
 .It Qq Pa roff.h
+Common data types for all syntax trees and related functions;
+can be used everywhere.
+.Pp
 Requires
 .Qq Pa mandoc_ohash.h
 for
@@ -189,10 +192,7 @@ Provides
 the constant array
 .Va roff_name
 and the functions
-.Fn deroff ,
-.Fn roffhash_alloc ,
-.Fn roffhash_find ,
-.Fn roffhash_free ,
+.Fn deroff
 and
 .Fn roff_validate .
 .Pp
@@ -300,14 +300,24 @@ from
 .Pa roff.h
 as an opaque type for function prototypes.
 .It Qq Pa roff_int.h
+Parser internals shared by multiple parsers.
+Can be used in all parsers, but not in main programs or formatters.
+.Pp
 Requires
 .Qq Pa roff.h
 for
-.Vt enum roff_type .
+.Vt enum roff_type
+and
+.Vt enum roff_tok .
 .Pp
 Provides functions named
 .Fn roff_*
-to handle roff nodes and the two special functions
+to handle roff nodes,
+.Fn roffhash_alloc ,
+.Fn roffhash_find ,
+and
+.Fn roffhash_free ,
+and the two special functions
 .Fn man_breakscope
 and
 .Fn mdoc_argv_free
Index: read.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/read.c,v
retrieving revision 1.200
retrieving revision 1.201
diff -Lread.c -Lread.c -u -p -r1.200 -r1.201
--- read.c
+++ read.c
@@ -39,6 +39,7 @@
 #include "mdoc.h"
 #include "man.h"
 #include "libmandoc.h"
+#include "roff_int.h"
 
 #define	REPARSE_LIMIT	1000
 
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-12-13  6:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-13  6:18 mandoc: Cleanup, no functional change: Move the roffhash_*() functions 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).