C言語でaproposコマンドを書きたい

■要求定義
– manページの内容を検索する
– whatisと名付けられたいくつかのファイルを検索している

e.g.
$ apropos passwd
chgpasswd (8) – update group passwords in batch mode
chpasswd (8) – update passwords in batch mode
fgetpwent_r (3) – get passwd file entry reentrantly
getpwent_r (3) – get passwd file entry reentrantly
gpasswd (1) – administer /etc/group and /etc/gshadow
grub-mkpasswd-pbkdf2 (1) – generate hashed password for GRUB
htpasswd (1) – Manage user files for basic authentication
openssl-passwd (1ssl) – compute password hashes
pam_localuser (8) – require users to be listed in /etc/passwd
passwd (1) – change user password
passwd (1ssl) – compute password hashes
passwd (5) – the password file
passwd2des (3) – RFS password encryption
update-passwd (8) – safely update /etc/passwd, /etc/shadow and /etc/group

キーワード検索の原理はregexと同じか。。