linecap implementation?

I use MonkVG, but it doesn’t support linecap. It can be VG_CAP_ROUND, VG_CAP_SQUARE, VG_CAP_BUTT.
Where can I see an algorithm/ready implementation of this feature?

I have found an example of implementation in ShivaVG