A simple man pages parser written in C
- meson
- ninja
$ meson setup build
$ cd build
$ ninja
$ ./ezmanpages
$ cd build
$ meson install
$ sudo ldconfig # reload cache
A very basic example without error handling:
#include <ezmanpages/ezmanpages.h>
#include <stdio.h>
int main(void) {
ezmanpages_t parser;
ezmanpages_init(&parser, "free", 3, "SYNOPSIS");
char buffer[4096];
ezmanpages_parse(parser, buffer, 4096);
fprintf(stdout, "%s", buffer);
return 0;
}
To compile it just run: gcc file.c -lezmanpages
!
If you want more examples check the main file.
- Parse files instead of the command (/usr/share/man)
- Write mine implementation of
col