mdoc_validate.c (a66b65d0) mdoc_validate.c (aa2d850a)
1/* $Id: mdoc_validate.c,v 1.39 2009/12/22 23:58:00 schwarze Exp $ */
1/* $Id: mdoc_validate.c,v 1.40 2009/12/23 22:30:17 schwarze Exp $ */
2/*
3 * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 175 unchanged lines hidden (view full) ---

185 { NULL, NULL }, /* Pa */
186 { pres_rv, NULL }, /* Rv */
187 { NULL, posts_st }, /* St */
188 { NULL, NULL }, /* Va */
189 { NULL, posts_text }, /* Vt */
190 { NULL, posts_xr }, /* Xr */
191 { NULL, posts_text }, /* %A */
192 { NULL, posts_text }, /* %B */ /* FIXME: can be used outside Rs/Re. */
2/*
3 * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 175 unchanged lines hidden (view full) ---

185 { NULL, NULL }, /* Pa */
186 { pres_rv, NULL }, /* Rv */
187 { NULL, posts_st }, /* St */
188 { NULL, NULL }, /* Va */
189 { NULL, posts_text }, /* Vt */
190 { NULL, posts_xr }, /* Xr */
191 { NULL, posts_text }, /* %A */
192 { NULL, posts_text }, /* %B */ /* FIXME: can be used outside Rs/Re. */
193 { NULL, posts_text }, /* %D */
193 { NULL, posts_text }, /* %D */ /* FIXME: check date with mandoc_a2time(). */
194 { NULL, posts_text }, /* %I */
195 { NULL, posts_text }, /* %J */
196 { NULL, posts_text }, /* %N */
197 { NULL, posts_text }, /* %O */
198 { NULL, posts_text }, /* %P */
199 { NULL, posts_text }, /* %R */
200 { NULL, posts_text }, /* %T */ /* FIXME: can be used outside Rs/Re. */
201 { NULL, posts_text }, /* %V */

--- 454 unchanged lines hidden (view full) ---

656 case (MDOC_Tag):
657 if (width < 0 && ! mdoc_nwarn(mdoc, n, EMISSWIDTH))
658 return(0);
659 break;
660 case (MDOC_Column):
661 /* FALLTHROUGH */
662 case (MDOC_Diag):
663 /* FALLTHROUGH */
194 { NULL, posts_text }, /* %I */
195 { NULL, posts_text }, /* %J */
196 { NULL, posts_text }, /* %N */
197 { NULL, posts_text }, /* %O */
198 { NULL, posts_text }, /* %P */
199 { NULL, posts_text }, /* %R */
200 { NULL, posts_text }, /* %T */ /* FIXME: can be used outside Rs/Re. */
201 { NULL, posts_text }, /* %V */

--- 454 unchanged lines hidden (view full) ---

656 case (MDOC_Tag):
657 if (width < 0 && ! mdoc_nwarn(mdoc, n, EMISSWIDTH))
658 return(0);
659 break;
660 case (MDOC_Column):
661 /* FALLTHROUGH */
662 case (MDOC_Diag):
663 /* FALLTHROUGH */
664 case (MDOC_Ohang):
665 /* FALLTHROUGH */
664 case (MDOC_Inset):
665 /* FALLTHROUGH */
666 case (MDOC_Item):
667 if (width >= 0 && ! mdoc_nwarn(mdoc, n, ENOWIDTH))
668 return(0);
669 break;
670 default:
671 break;

--- 125 unchanged lines hidden (view full) ---

797 return(check_msec(mdoc, n, 4, 0));
798}
799
800
801static int
802pre_dt(PRE_ARGS)
803{
804
666 case (MDOC_Inset):
667 /* FALLTHROUGH */
668 case (MDOC_Item):
669 if (width >= 0 && ! mdoc_nwarn(mdoc, n, ENOWIDTH))
670 return(0);
671 break;
672 default:
673 break;

--- 125 unchanged lines hidden (view full) ---

799 return(check_msec(mdoc, n, 4, 0));
800}
801
802
803static int
804pre_dt(PRE_ARGS)
805{
806
807 /* FIXME: make sure is capitalised. */
808
805 if (0 == mdoc->meta.date || mdoc->meta.os)
806 if ( ! mdoc_nwarn(mdoc, n, EPROLOOO))
807 return(0);
808 if (mdoc->meta.title)
809 if ( ! mdoc_nwarn(mdoc, n, EPROLREP))
810 return(0);
811 return(1);
812}

--- 498 unchanged lines hidden ---
809 if (0 == mdoc->meta.date || mdoc->meta.os)
810 if ( ! mdoc_nwarn(mdoc, n, EPROLOOO))
811 return(0);
812 if (mdoc->meta.title)
813 if ( ! mdoc_nwarn(mdoc, n, EPROLREP))
814 return(0);
815 return(1);
816}

--- 498 unchanged lines hidden ---