source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: mdoc_action.c is no more.
Date: Tue, 30 Nov 2010 08:04:14 -0500 (EST)	[thread overview]
Message-ID: <201011301304.oAUD4EZ8028322@krisdoz.my.domain> (raw)

Log Message:
-----------
mdoc_action.c is no more.  Attic it and remove it from the Makefile.
Remove references to MDOC_ACTED (it was only assertions) and the pre-
and post-action functions.

Modified Files:
--------------
    mdocml:
        Makefile
        libmdoc.h
        mdoc.c
        mdoc_macro.c

Removed Files:
-------------
    mdocml:
        mdoc_action.c

Revision Data
-------------
--- mdoc_action.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*	$Id: mdoc_action.c,v 1.88 2010/11/30 12:59:20 kristaps Exp $ */
-/*
- * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * 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.
- */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifndef	OSNAME
-#include <sys/utsname.h>
-#endif
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#include "mandoc.h"
-#include "libmdoc.h"
-#include "libmandoc.h"
-
-/* 
- * FIXME: this file is deprecated.  All future "actions" should be
- * pushed into mdoc_validate.c.
- */
-
-#define	POST_ARGS struct mdoc *m, struct mdoc_node *n
-#define	PRE_ARGS  struct mdoc *m, struct mdoc_node *n
-
-struct	actions {
-	int	(*pre)(PRE_ARGS);
-	int	(*post)(POST_ARGS);
-};
-
-static	const struct actions mdoc_actions[MDOC_MAX] = {
-	{ NULL, NULL }, /* Ap */
-	{ NULL, NULL }, /* Dd */ 
-	{ NULL, NULL }, /* Dt */ 
-	{ NULL, NULL }, /* Os */ 
-	{ NULL, NULL }, /* Sh */ 
-	{ NULL, NULL }, /* Ss */ 
-	{ NULL, NULL }, /* Pp */ 
-	{ NULL, NULL }, /* D1 */
-	{ NULL, NULL }, /* Dl */
-	{ NULL, NULL }, /* Bd */ 
-	{ NULL, NULL }, /* Ed */
-	{ NULL, NULL }, /* Bl */ 
-	{ NULL, NULL }, /* El */
-	{ NULL, NULL }, /* It */
-	{ NULL, NULL }, /* Ad */ 
-	{ NULL, NULL }, /* An */
-	{ NULL, NULL }, /* Ar */
-	{ NULL, NULL }, /* Cd */
-	{ NULL, NULL }, /* Cm */
-	{ NULL, NULL }, /* Dv */ 
-	{ NULL, NULL }, /* Er */ 
-	{ NULL, NULL }, /* Ev */ 
-	{ NULL, NULL }, /* Ex */
-	{ NULL, NULL }, /* Fa */ 
-	{ NULL, NULL }, /* Fd */ 
-	{ NULL, NULL }, /* Fl */
-	{ NULL, NULL }, /* Fn */ 
-	{ NULL, NULL }, /* Ft */ 
-	{ NULL, NULL }, /* Ic */ 
-	{ NULL, NULL }, /* In */ 
-	{ NULL, NULL }, /* Li */
-	{ NULL, NULL }, /* Nd */ 
-	{ NULL, NULL }, /* Nm */ 
-	{ NULL, NULL }, /* Op */
-	{ NULL, NULL }, /* Ot */
-	{ NULL, NULL }, /* Pa */
-	{ NULL, NULL }, /* Rv */
-	{ NULL, NULL }, /* St */
-	{ NULL, NULL }, /* Va */
-	{ NULL, NULL }, /* Vt */ 
-	{ NULL, NULL }, /* Xr */
-	{ NULL, NULL }, /* %A */
-	{ NULL, NULL }, /* %B */
-	{ NULL, NULL }, /* %D */
-	{ NULL, NULL }, /* %I */
-	{ NULL, NULL }, /* %J */
-	{ NULL, NULL }, /* %N */
-	{ NULL, NULL }, /* %O */
-	{ NULL, NULL }, /* %P */
-	{ NULL, NULL }, /* %R */
-	{ NULL, NULL }, /* %T */
-	{ NULL, NULL }, /* %V */
-	{ NULL, NULL }, /* Ac */
-	{ NULL, NULL }, /* Ao */
-	{ NULL, NULL }, /* Aq */
-	{ NULL, NULL }, /* At */ 
-	{ NULL, NULL }, /* Bc */
-	{ NULL, NULL }, /* Bf */ 
-	{ NULL, NULL }, /* Bo */
-	{ NULL, NULL }, /* Bq */
-	{ NULL, NULL }, /* Bsx */
-	{ NULL, NULL }, /* Bx */
-	{ NULL, NULL }, /* Db */
-	{ NULL, NULL }, /* Dc */
-	{ NULL, NULL }, /* Do */
-	{ NULL, NULL }, /* Dq */
-	{ NULL, NULL }, /* Ec */
-	{ NULL, NULL }, /* Ef */
-	{ NULL, NULL }, /* Em */ 
-	{ NULL, NULL }, /* Eo */
-	{ NULL, NULL }, /* Fx */
-	{ NULL, NULL }, /* Ms */
-	{ NULL, NULL }, /* No */
-	{ NULL, NULL }, /* Ns */
-	{ NULL, NULL }, /* Nx */
-	{ NULL, NULL }, /* Ox */
-	{ NULL, NULL }, /* Pc */
-	{ NULL, NULL }, /* Pf */
-	{ NULL, NULL }, /* Po */
-	{ NULL, NULL }, /* Pq */
-	{ NULL, NULL }, /* Qc */
-	{ NULL, NULL }, /* Ql */
-	{ NULL, NULL }, /* Qo */
-	{ NULL, NULL }, /* Qq */
-	{ NULL, NULL }, /* Re */
-	{ NULL, NULL }, /* Rs */
-	{ NULL, NULL }, /* Sc */
-	{ NULL, NULL }, /* So */
-	{ NULL, NULL }, /* Sq */
-	{ NULL, NULL }, /* Sm */
-	{ NULL, NULL }, /* Sx */
-	{ NULL, NULL }, /* Sy */
-	{ NULL, NULL }, /* Tn */
-	{ NULL, NULL }, /* Ux */
-	{ NULL, NULL }, /* Xc */
-	{ NULL, NULL }, /* Xo */
-	{ NULL, NULL }, /* Fo */ 
-	{ NULL, NULL }, /* Fc */ 
-	{ NULL, NULL }, /* Oo */
-	{ NULL, NULL }, /* Oc */
-	{ NULL, NULL }, /* Bk */
-	{ NULL, NULL }, /* Ek */
-	{ NULL, NULL }, /* Bt */
-	{ NULL, NULL }, /* Hf */
-	{ NULL, NULL }, /* Fr */
-	{ NULL, NULL }, /* Ud */
-	{ NULL, NULL }, /* Lb */
-	{ NULL, NULL }, /* Lp */
-	{ NULL, NULL }, /* Lk */
-	{ NULL, NULL }, /* Mt */
-	{ NULL, NULL }, /* Brq */
-	{ NULL, NULL }, /* Bro */
-	{ NULL, NULL }, /* Brc */
-	{ NULL, NULL }, /* %C */
-	{ NULL, NULL }, /* Es */
-	{ NULL, NULL }, /* En */
-	{ NULL, NULL }, /* Dx */
-	{ NULL, NULL }, /* %Q */
-	{ NULL, NULL }, /* br */
-	{ NULL, NULL }, /* sp */
-	{ NULL, NULL }, /* %U */
-	{ NULL, NULL }, /* Ta */
-};
-
-
-int
-mdoc_action_pre(struct mdoc *m, struct mdoc_node *n)
-{
-
-	switch (n->type) {
-	case (MDOC_ROOT):
-		/* FALLTHROUGH */
-	case (MDOC_TEXT):
-		return(1);
-	default:
-		break;
-	}
-
-	if (NULL == mdoc_actions[n->tok].pre)
-		return(1);
-	return((*mdoc_actions[n->tok].pre)(m, n));
-}
-
-
-int
-mdoc_action_post(struct mdoc *m)
-{
-
-	if (MDOC_ACTED & m->last->flags)
-		return(1);
-	m->last->flags |= MDOC_ACTED;
-
-	switch (m->last->type) {
-	case (MDOC_TEXT):
-		/* FALLTHROUGH */
-	case (MDOC_ROOT):
-		return(1);
-	default:
-		break;
-	}
-
-	if (NULL == mdoc_actions[m->last->tok].post)
-		return(1);
-	return((*mdoc_actions[m->last->tok].post)(m, m->last));
-}
-
Index: mdoc_macro.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_macro.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -Lmdoc_macro.c -Lmdoc_macro.c -u -p -r1.96 -r1.97
--- mdoc_macro.c
+++ mdoc_macro.c
@@ -259,15 +259,11 @@ rew_last(struct mdoc *mdoc, const struct
 	while (mdoc->last != to) {
 		if ( ! mdoc_valid_post(mdoc))
 			return(0);
-		if ( ! mdoc_action_post(mdoc))
-			return(0);
 		mdoc->last = mdoc->last->parent;
 		assert(mdoc->last);
 	}
 
-	if ( ! mdoc_valid_post(mdoc))
-		return(0);
-	return(mdoc_action_post(mdoc));
+	return(mdoc_valid_post(mdoc));
 }
 
 
@@ -696,10 +692,8 @@ blk_exp_close(MACRO_PROT_ARGS)
 		if (later &&
 		    MDOC_EXPLICIT & mdoc_macros[later->tok].flags)
 			continue;
-		if (MDOC_CALLABLE & mdoc_macros[n->tok].flags) {
-			assert( ! (MDOC_ACTED & n->flags));
+		if (MDOC_CALLABLE & mdoc_macros[n->tok].flags)
 			later = n;
-		}
 	}
 
 	if ( ! (MDOC_CALLABLE & mdoc_macros[tok].flags)) {
@@ -1143,7 +1137,6 @@ blk_full(MACRO_PROT_ARGS)
 		if (MDOC_BLOCK == n->type && 
 				MDOC_EXPLICIT & mdoc_macros[n->tok].flags &&
 				! (MDOC_VALID & n->flags)) {
-			assert( ! (MDOC_ACTED & n->flags));
 			n->pending = head;
 			return(1);
 		}
@@ -1281,7 +1274,6 @@ blk_part_imp(MACRO_PROT_ARGS)
 		if (MDOC_BLOCK == n->type &&
 		    MDOC_EXPLICIT & mdoc_macros[n->tok].flags &&
 		    ! (MDOC_VALID & n->flags)) {
-			assert( ! (MDOC_ACTED & n->flags));
 			if ( ! make_pending(n, tok, m, line, ppos))
 				return(0);
 			if ( ! mdoc_endbody_alloc(m, line, ppos,
Index: libmdoc.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/libmdoc.h,v
retrieving revision 1.62
retrieving revision 1.63
diff -Llibmdoc.h -Llibmdoc.h -u -p -r1.62 -r1.63
--- libmdoc.h
+++ libmdoc.h
@@ -128,9 +128,6 @@ const char	 *mdoc_a2vol(const char *);
 const char	 *mdoc_a2msec(const char *);
 int		  mdoc_valid_pre(struct mdoc *, struct mdoc_node *);
 int		  mdoc_valid_post(struct mdoc *);
-int		  mdoc_action_pre(struct mdoc *, 
-			struct mdoc_node *);
-int		  mdoc_action_post(struct mdoc *);
 enum margverr	  mdoc_argv(struct mdoc *, int, enum mdoct,
 			struct mdoc_arg **, int *, char *);
 void		  mdoc_argv_free(struct mdoc_arg *);
Index: mdoc.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc.c,v
retrieving revision 1.165
retrieving revision 1.166
diff -Lmdoc.c -Lmdoc.c -u -p -r1.165 -r1.166
--- mdoc.c
+++ mdoc.c
@@ -328,8 +328,6 @@ node_append(struct mdoc *mdoc, struct md
 
 	if ( ! mdoc_valid_pre(mdoc, p))
 		return(0);
-	if ( ! mdoc_action_pre(mdoc, p))
-		return(0);
 
 	switch (p->type) {
 	case (MDOC_HEAD):
@@ -355,8 +353,6 @@ node_append(struct mdoc *mdoc, struct md
 	switch (p->type) {
 	case (MDOC_TEXT):
 		if ( ! mdoc_valid_post(mdoc))
-			return(0);
-		if ( ! mdoc_action_post(mdoc))
 			return(0);
 		break;
 	default:
Index: Makefile
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/Makefile,v
retrieving revision 1.293
retrieving revision 1.294
diff -LMakefile -LMakefile -u -p -r1.293 -r1.294
--- Makefile
+++ Makefile
@@ -43,15 +43,15 @@ MANDOCSRCS = mandoc.c
 MANDOCOBJS = mandoc.o
 
 MDOCLNS	   = mdoc_macro.ln mdoc.ln mdoc_hash.ln mdoc_strings.ln \
-	     mdoc_argv.ln mdoc_validate.ln mdoc_action.ln \
+	     mdoc_argv.ln mdoc_validate.ln \
 	     lib.ln att.ln arch.ln vol.ln msec.ln st.ln
 
 MDOCOBJS   = mdoc_macro.o mdoc.o mdoc_hash.o mdoc_strings.o \
-	     mdoc_argv.o mdoc_validate.o mdoc_action.o lib.o att.o \
+	     mdoc_argv.o mdoc_validate.o lib.o att.o \
 	     arch.o vol.o msec.o st.o
 
 MDOCSRCS   = mdoc_macro.c mdoc.c mdoc_hash.c mdoc_strings.c \
-	     mdoc_argv.c mdoc_validate.c mdoc_action.c lib.c att.c \
+	     mdoc_argv.c mdoc_validate.c lib.c att.c \
 	     arch.c vol.c msec.c st.c
 
 MANLNS	   = man_macro.ln man.ln man_hash.ln man_validate.ln \
@@ -248,8 +248,6 @@ man_argv.ln man_argv.o: man_argv.c libma
 man_validate.ln man_validate.o: man_validate.c libman.h
 
 mdoc_validate.ln mdoc_validate.o: mdoc_validate.c libmdoc.h
-
-mdoc_action.ln mdoc_action.o: mdoc_action.c libmdoc.h
 
 libmdoc.h: mdoc.h
 
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2010-11-30 13:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201011301304.oAUD4EZ8028322@krisdoz.my.domain \
    --to=kristaps@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).