discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml version 1.10.9 available
@ 2011-01-07 15:16 Kristaps Dzonsons
  2011-01-07 15:36 ` Kristaps Dzonsons
  2011-01-09  5:00 ` Joerg Sonnenberger
  0 siblings, 2 replies; 4+ messages in thread
From: Kristaps Dzonsons @ 2011-01-07 15:16 UTC (permalink / raw)
  To: discuss

Hello,

I'm pleased to announce mdocml 1.10.9, now at http://mdocml.bsd.lv/. 
Among many other fixes and improvements, this is a significant release 
in that it has tbl functionality.  mandoc can now accept simple tables:

  % tbl foo.1tbl | nroff -mandoc

becomes simply

  % mandoc foo.1tbl

See http://mdocml.bsd.lv/tbl.7.html for details.  This is an initial 
implementation and many parts are missing, but the interface is solid 
and can now be fleshed out.

For a full list of changes, see http://mdocml.bsd.lv/ChangeLog.html. An 
abbreviated list of changes is on the NEWS section of the web-site.

As usual, sources are at http://mdocml.bsd.lv/snapshots/mdocml.tar.gz.

Thanks,

Kristaps
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: mdocml version 1.10.9 available
  2011-01-07 15:16 mdocml version 1.10.9 available Kristaps Dzonsons
@ 2011-01-07 15:36 ` Kristaps Dzonsons
  2011-01-09  5:00 ` Joerg Sonnenberger
  1 sibling, 0 replies; 4+ messages in thread
From: Kristaps Dzonsons @ 2011-01-07 15:36 UTC (permalink / raw)
  To: discuss

Right, one more thing.

In merging from http://tbl.bsd.lv/ (the basis for mandoc's tbl), enough 
changes have taken place that the original software has been deprecated. 
  This is noted on the tbl.bsd.lv site.

If anybody thinks a standalone tbl(1) utility would be handy, please let 
me know and I can guide you in how to pull it off (tbl now lives in 
libroff, so it's possible).

Thanks,

Kristaps
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: mdocml version 1.10.9 available
  2011-01-07 15:16 mdocml version 1.10.9 available Kristaps Dzonsons
  2011-01-07 15:36 ` Kristaps Dzonsons
@ 2011-01-09  5:00 ` Joerg Sonnenberger
  2011-01-09 23:15   ` Kristaps Dzonsons
  1 sibling, 1 reply; 4+ messages in thread
From: Joerg Sonnenberger @ 2011-01-09  5:00 UTC (permalink / raw)
  To: discuss

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

On Fri, Jan 07, 2011 at 04:16:56PM +0100, Kristaps Dzonsons wrote:
> I'm pleased to announce mdocml 1.10.9, now at http://mdocml.bsd.lv/.
> Among many other fixes and improvements, this is a significant
> release in that it has tbl functionality.

Attached is man page from libpcap which currently takes ages to crash.
I've attached a fix for the crash (ensure that the columns are limited),
but it doesn't fix the formatting.

Joerg

[-- Attachment #2: pcap-savefile.manfile.in --]
[-- Type: text/plain, Size: 4801 bytes --]

'\" t
.\" @(#) Header: /tcpdump/master/libpcap/pcap-savefile.manfile.in,v 1.2 2008-10-24 07:33:50 guy Exp
.\"
.\" Copyright (c) 1994, 1996, 1997
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that: (1) source code distributions
.\" retain the above copyright notice and this paragraph in its entirety, (2)
.\" distributions including binary code include the above copyright notice and
.\" this paragraph in its entirety in the documentation or other materials
.\" provided with the distribution, and (3) all advertising materials mentioning
.\" features or use of this software display the following acknowledgement:
.\" ``This product includes software developed by the University of California,
.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
.\" the University nor the names of its contributors may be used to endorse
.\" or promote products derived from this software without specific prior
.\" written permission.
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
.TH PCAP-SAVEFILE @MAN_FILE_FORMATS@ "21 October 2008"
.SH NAME
pcap-savefile \- libpcap savefile format
.SH DESCRIPTION
NOTE: applications and libraries should, if possible, use libpcap to
read savefiles, rather than having their own code to read savefiles. 
If, in the future, a new file format is supported by libpcap,
applications and libraries using libpcap to read savefiles will be able
to read the new format of savefiles, but applications and libraries
using their own code to read savefiles will have to be changed to
support the new file format.
.PP
``Savefiles'' read and written by libpcap and applications using libpcap
start with a per-file header.  The format of the per-file header is:
.RS
.TS
box;
c s
c | c
c s.
Magic number
_
Major version	Minor version
_
Time zone offset
_
Time stamp accuracy
_
Snapshot length
_
Link-layer header type
.TE
.RE
.PP
All fields in the per-file header are in the byte order of the host
writing the file.  The first field in the per-file header is a 4-byte
magic number, with the value 0xa1b2c3d4.  The magic number, when read by
a host with the same byte order as the host that wrote the file, will
have the value 0xa1b2c3d4, and, when read by a host with the opposite
byte order as the host that wrote the file, will have the value
0xd4c3b2a1.  That allows software reading the file to determine whether
the byte order of the host that wrote the file is the same as the byte
order of the host on which the file is being read, and thus whether the
values in the per-file and per-packet headers need to be byte-swapped.
.PP
Following this are:
.IP
A 2-byte file format major version number; the current version number is
2.
.IP
A 2-byte file format minor version number; the current version number is
4.
.IP
A 4-byte time zone offset; this is always 0.
.IP
A 4-byte number giving the accuracy of time stamps in the file; this is
always 0.
.IP
A 4-byte number giving the "snapshot length" of the capture; packets
longer than the snapshot length are truncated to the snapshot length, so
that, if the snapshot length is
.IR N ,
only the first
.I N
bytes of a packet longer than
.I N
bytes will be saved in the capture.
.IP
a 4-byte number giving the link-layer header type for packets in the
capture; see
.BR pcap-linktype (@MAN_MISC_INFO@)
for the
.B LINKTYPE_
values that can appear in this field.
.PP
Following the per-file header are zero or more packets; each packet
begins with a per-packet header, which is immediately followed by the
raw packet data.  The format of the per-packet header is:
.RS
.TS
box;
c.
Time stamp, seconds value
_
Time stamp, microseconds value
_
Length of captured packet data
_
Un-truncated length of the packet data
.TE
.RE
.PP
All fields in the per-packet header are in the byte order of the host
writing the file.  The per-packet header begins with a time stamp giving
the approximate time the packet was captured; the time stamp consists of
a 4-byte value, giving the time in seconds since January 1, 1970,
00:00:00 UTC, followed by a 4-byte value, giving the time in
microseconds since that second.  Following that are a 4-byte value
giving the number of bytes of captured data that follow the per-packet
header and a 4-byte value giving the number of bytes that would have
been present had the packet not been truncated by the snapshot length. 
The two lengths will be equal if the number of bytes of packet data are
less than or equal to the snapshot length.
.SH SEE ALSO
pcap(3PCAP), pcap-linktype(@MAN_MISC_INFO@)

[-- Attachment #3: tbl_term.c.diff --]
[-- Type: text/x-diff, Size: 1178 bytes --]

--- tbl_term.c.orig	2011-01-07 16:07:54.000000000 +0100
+++ tbl_term.c	2011-01-09 05:52:41.095174334 +0100
@@ -342,7 +342,7 @@
 tbl_literal(struct termp *tp, const struct tbl_dat *dp, 
 		const struct roffcol *col)
 {
-	size_t		 padl, padr, ssz;
+	size_t		 padl, padr, ssz, tsz;
 	enum tbl_cellt	 pos;
 	const char	*str;
 
@@ -352,24 +352,37 @@
 	str = dp && dp->string ? dp->string : "";
 
 	ssz = term_len(tp, 1);
+	tsz = term_strlen(tp, str);
 
 	switch (pos) {
 	case (TBL_CELL_LONG):
 		padl = ssz;
-		padr = col->width - term_strlen(tp, str) - ssz;
+		if (col->width >= tsz + ssz)
+			padr = col->width - tsz - ssz;
+		else
+			padr = 0;
 		break;
 	case (TBL_CELL_CENTRE):
-		padl = col->width - term_strlen(tp, str);
+		if (col->width >= tsz)
+			padl = col->width - tsz;
+		else
+			padl = 0;
 		if (padl % 2)
 			padr++;
 		padl /= 2;
 		padr += padl;
 		break;
 	case (TBL_CELL_RIGHT):
-		padl = col->width - term_strlen(tp, str);
+		if (col->width >= tsz)
+			padl = col->width - tsz;
+		else
+			padl = 0;
 		break;
 	default:
-		padr = col->width - term_strlen(tp, str);
+		if (col->width >= tsz)
+			padr = col->width - tsz;
+		else
+			padr = 0;
 		break;
 	}
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: mdocml version 1.10.9 available
  2011-01-09  5:00 ` Joerg Sonnenberger
@ 2011-01-09 23:15   ` Kristaps Dzonsons
  0 siblings, 0 replies; 4+ messages in thread
From: Kristaps Dzonsons @ 2011-01-09 23:15 UTC (permalink / raw)
  To: discuss; +Cc: Joerg Sonnenberger

>> I'm pleased to announce mdocml 1.10.9, now at http://mdocml.bsd.lv/.
>> Among many other fixes and improvements, this is a significant
>> release in that it has tbl functionality.
>
> Attached is man page from libpcap which currently takes ages to crash.
> I've attached a fix for the crash (ensure that the columns are limited),
> but it doesn't fix the formatting.

Joerg,

The last check-in to the repository fixes this in an entirely different 
way (see commit message for nitty-gritty details).

Spans aren't supported yet---I'll be working this in to the next 
release.  So there's bound to be some nonsense...

Thanks!

Kristaps
--
 To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-09 23:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-07 15:16 mdocml version 1.10.9 available Kristaps Dzonsons
2011-01-07 15:36 ` Kristaps Dzonsons
2011-01-09  5:00 ` Joerg Sonnenberger
2011-01-09 23:15   ` Kristaps Dzonsons

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