LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   how to access man pages using C++ ? (https://www.linuxquestions.org/questions/programming-9/how-to-access-man-pages-using-c-235602/)

ambitionless 09-26-2004 10:44 PM

how to access man pages using C++ ?
 
how to access man and info pages?

is there some lib or something out there that can access man? i need to be able to get a program to view these pages by implementing the program using C++ (using Qt toolkit preferred ) Can anyone help me out with it? Thanks.

itsme86 09-26-2004 10:54 PM

They're just files in the /usr/man (sometimes /usr/local/man) directory. Are you just wondering how to process the formatting codes?

ambitionless 09-27-2004 12:18 AM

yes...Those formats that looks similar to HTML Tags. Formats e.g." .BR ", " .B ".......Any idea how can i get them out? Changing them into readable text that QTextEdit or any other widgets that can read and show it just like how it is in a Terminal. If there are other ways...sugguestions are welcome!~Thanks

dustu76 09-27-2004 01:20 AM

First of all, this is just a guess from a C newbie. So dont be angry I'm missing something obvious.

IIRC the codes are the roff/troff formatting commands. So can we use something like (works on a solaris box):

nroff -man < ${file_name}

On linux, /etc/man.config (I think) can give you some pointers about the exact command...

Dont know you are going to implement this in C++. Somthing like system(nroff...) ?!

HTH.

ambitionless 09-27-2004 02:25 AM

I need a sample code in C++ as guide. Can anyone help out? ( Best if it is done using QT Designer )


All times are GMT -5. The time now is 01:58 AM.