Skip to content

FrancescoXD/ezmanpages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ezmanpages (v0.2.1a)

A simple man pages parser written in C

Requirements

  • meson
  • ninja

How to build

$ meson setup build
$ cd build
$ ninja
$ ./ezmanpages

How to install

$ cd build
$ meson install
$ sudo ldconfig # reload cache

Example

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.

TODO

  • Parse files instead of the command (/usr/share/man)
  • Write mine implementation of col