Fixed "-o" residue.
Added "-O" to usage() (-o didn't appear there either).
-/* $Id: html.c,v 1.65 2009/10/20 05:45:21 kristaps Exp $ */
+/* $Id: html.c,v 1.66 2009/10/26 08:18:15 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/types.h>
-#include <sys/queue.h>
#include <assert.h>
#include <err.h>
if (NULL == (h = calloc(1, sizeof(struct html))))
return(NULL);
- SLIST_INIT(&h->tags);
- SLIST_INIT(&h->ords);
+ h->tags.head = NULL;
+ h->ords.head = NULL;
if (NULL == (h->symtab = chars_init(CHARS_HTML))) {
free(h);
h = (struct html *)p;
- while ( ! SLIST_EMPTY(&h->ords)) {
- ord = SLIST_FIRST(&h->ords);
- SLIST_REMOVE_HEAD(&h->ords, entry);
+ while ((ord = h->ords.head) != NULL) {
+ h->ords.head = ord->next;
free(ord);
}
- while ( ! SLIST_EMPTY(&h->tags)) {
- tag = SLIST_FIRST(&h->tags);
- SLIST_REMOVE_HEAD(&h->tags, entry);
+ while ((tag = h->tags.head) != NULL) {
+ h->tags.head = tag->next;
free(tag);
}
if (NULL == (t = malloc(sizeof(struct tag))))
err(EXIT_FAILURE, "malloc");
t->tag = tag;
- SLIST_INSERT_HEAD(&h->tags, t, entry);
+ t->next = h->tags.head;
+ h->tags.head = t;
} else
t = NULL;
{
struct tag *tag;
- while ( ! SLIST_EMPTY(&h->tags)) {
- tag = SLIST_FIRST(&h->tags);
+ while ((tag = h->tags.head) != NULL) {
print_ctag(h, tag->tag);
- SLIST_REMOVE_HEAD(&h->tags, entry);
+ h->tags.head = tag->next;
free(tag);
if (until && tag == until)
return;
{
struct tag *tag;
- while ( ! SLIST_EMPTY(&h->tags)) {
- tag = SLIST_FIRST(&h->tags);
+ while ((tag = h->tags.head) != NULL) {
if (suntil && tag == suntil)
return;
print_ctag(h, tag->tag);
- SLIST_REMOVE_HEAD(&h->tags, entry);
+ h->tags.head = tag->next;
free(tag);
}
}
-/* $Id: html.h,v 1.13 2009/10/13 10:21:24 kristaps Exp $ */
+/* $Id: html.h,v 1.14 2009/10/26 08:18:16 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
};
struct tag {
+ struct tag *next;
enum htmltag tag;
- SLIST_ENTRY(tag) entry;
};
struct ord {
- int pos;
+ struct ord *next;
const void *cookie;
- SLIST_ENTRY(ord) entry;
+ int pos;
};
-SLIST_HEAD(tagq, tag);
-SLIST_HEAD(ordq, ord);
+struct tagq {
+ struct tag *head;
+};
+struct ordq {
+ struct ord *head;
+};
struct htmlpair {
enum htmlattr key;
-/* $Id: main.c,v 1.47 2009/10/26 04:15:42 kristaps Exp $ */
+/* $Id: main.c,v 1.48 2009/10/26 08:18:16 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
if ( ! moptions(&curp.inttype, optarg))
return(EXIT_FAILURE);
break;
- case ('o'):
+ case ('O'):
curp.outopts = optarg;
break;
case ('T'):
{
(void)fprintf(stderr, "usage: %s [-V] [-foption...] "
- "[-mformat] [-Toutput] [-Werr...]\n",
- __progname);
+ "[-mformat] [-Ooption] [-Toutput] "
+ "[-Werr...]\n", __progname);
exit(EXIT_FAILURE);
}
-/* $Id: man_html.c,v 1.13 2009/10/24 05:45:04 kristaps Exp $ */
+/* $Id: man_html.c,v 1.14 2009/10/26 08:18:16 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/types.h>
-#include <sys/queue.h>
#include <assert.h>
#include <ctype.h>
struct tag *t;
child = 1;
- t = SLIST_FIRST(&h->tags);
+ t = h->tags.head;
bufinit(h);
-/* $Id: mdoc_html.c,v 1.38 2009/10/26 04:09:45 kristaps Exp $ */
+/* $Id: mdoc_html.c,v 1.39 2009/10/26 08:18:16 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
*/
#include <sys/types.h>
#include <sys/param.h>
-#include <sys/queue.h>
#include <assert.h>
#include <ctype.h>
struct tag *t;
child = 1;
- t = SLIST_FIRST(&h->tags);
+ t = h->tags.head;
bufinit(h);
switch (n->type) {
print_otag(h, TAG_SPAN, 1, &tag);
break;
case (MDOC_Enum):
- ord = SLIST_FIRST(&h->ords);
+ ord = h->ords.head;
assert(ord);
nbuf[BUFSIZ - 1] = 0;
(void)snprintf(nbuf, BUFSIZ - 1, "%d.", ord->pos++);
err(EXIT_FAILURE, "malloc");
ord->cookie = n;
ord->pos = 1;
- SLIST_INSERT_HEAD(&h->ords, ord, entry);
+ ord->next = h->ords.head;
+ h->ords.head = ord;
return(1);
}
if (MDOC_Enum != a2list(n))
return;
- ord = SLIST_FIRST(&h->ords);
+ ord = h->ords.head;
assert(ord);
- SLIST_REMOVE_HEAD(&h->ords, entry);
+ h->ords.head = ord->next;
free(ord);
}