discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* Re: Proper Macro for Types
@ 2022-03-12  1:49 Paul A. Patience
  0 siblings, 0 replies; 2+ messages in thread
From: Paul A. Patience @ 2022-03-12  1:49 UTC (permalink / raw)
  To: discuss


Hi Robert,

> For types which are not directly related to a function or variable, in
> illumos we've been using .Vt. Is this correct? If not, what is the right
> macro to use? Either way could we perhaps add a statement to mdoc(7)
> about the right macro to use for this? The statement regarding .Fa has
> been very helpful and makes it quite clear what to do.

I would say .Vt is correct.
Some examples:

- elf(3): .Vt Elf, etc.
- timeradd(3): .Vt struct timeval
- CMS_add1_signer(3): .Vt SignedData, .Vt CMS_SignerInfo

However, there are inconsistencies (which we could term errors in light
of the above examples):

- clock_gettime(2): .Dv timespec
- ctime(3): .Li tm
- getnameinfo(3): .Li sockaddr (and sockaddr_in, sockaddr_in6)
- radio(4): .Fa "struct radio_info"
  (though seeing “.Fa int” above it makes me think it's being treated as
  the argument to ioctl)

I also found an unquestionable error in the elf(3) series of man pages:
They use .Ar rather than .Fa for function arguments (for example in
elf_flagdata(3)).

Best regards,
Paul

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


^ permalink raw reply	[flat|nested] 2+ messages in thread
* Proper Macro for Types
@ 2022-01-29 17:12 Robert Mustacchi
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Mustacchi @ 2022-01-29 17:12 UTC (permalink / raw)
  To: discuss

Hi there,

While guiding new folks through writing manual pages in illumos, there
is one area that comes up frequently and generates a little confusion
for folks, which is the proper markup for the name of a type (generally
a structure, but could be a typedef) and for members/fields of structures.

The mdoc(7) manual makes the latter of these pretty obvious with the use
of .Fa with "This macro is also used to specify the field name of a
structure."

When it comes to types themselves more generally, it's a little less
clear. We have .Ft and .Vt, which deal with types that are part of a
function synopsis (or related to the function in later prose) and the
latter is meant to deal with an explicit variable type. However, in a
lot of the illumos documentation we are often discussing a structure or
type that is not always directly related to a function signature or
global variable (for example, because we're in an overview section).

As an attempt at a more concrete example, consider a discussion of a
file system (illumos has chapters on various file systems, ioctl
interfaces, etc.) and wanting to discuss a time_t (or some other time
related C structure). In this context there is no function or variable
that is being referred to.

For types which are not directly related to a function or variable, in
illumos we've been using .Vt. Is this correct? If not, what is the right
macro to use? Either way could we perhaps add a statement to mdoc(7)
about the right macro to use for this? The statement regarding .Fa has
been very helpful and makes it quite clear what to do.

Thanks,
Robert
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv


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

end of thread, other threads:[~2022-03-12  1:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-12  1:49 Proper Macro for Types Paul A. Patience
  -- strict thread matches above, loose matches on Subject: below --
2022-01-29 17:12 Robert Mustacchi

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