Thread: handling man (groff) pages in C

  1. #1
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300

    handling man (groff) pages in C

    Does anyone know of a C library for processing man pages (they are in groff, i notice)?

    Or, looking at this differently, if I go man man > man.txt I still get something that is not really viewable as plain text. A total guess, having never used any of the 'w' string functions: I'm seeing "wide' characters in the output (or are those just for foriegn alphabets)?

    There are a few questions in here (i guess), but if you know anything useful about the topic please post.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    The funny characters appear to be ANSI formatting codes (if I set my terminal to something weird, they don't show up), as opposed to what's in the file itself. (I would guess that the C library for dealing with groff/troff/etc. is "groff" itself.) You should be able to find the raw man pages themselves in /usr/(something)/man. The Solaris box I'm looking at now appears to have the man pages in some XML-like language.

  3. #3
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by tabstop View Post
    You should be able to find the raw man pages themselves in /usr/(something)/man. The Solaris box I'm looking at now appears to have the man pages in some XML-like language.
    My raw pages are definately in groff (commands prefaced on a single line by a '.', eg. .pp).
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  4. #4
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    For posterity's sake, man command | col -b > command.txt works and leaves so few "non-standard" characters in you won't even notice
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. man page's
    By xlordt in forum C Programming
    Replies: 19
    Last Post: 10-13-2003, 05:58 AM
  2. HTML Man Pages?
    By mart_man00 in forum Tech Board
    Replies: 1
    Last Post: 04-16-2003, 03:13 PM
  3. man pages for unix
    By iain in forum Linux Programming
    Replies: 2
    Last Post: 04-06-2003, 12:52 AM
  4. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 12:01 PM
  5. we of the cage
    By mithrandir in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 08-21-2002, 10:14 AM