Martin Porter’s Stemming algorithm as a C library. There’s also a CLI: stmr(1).
clib:
clib install wooorm/stmr.c
Or clone the repo.
#include <stdio.h>
#include <string.h>
#include "stmr.h"
int
main(int argc, char **argv) {
char *word = argv[1];
int end = stem(word, 0, strlen(word) - 1);
word[end + 1] = 0;
printf("%s", word);
}