Any help or pointers to the right document will beappreciated.
You could check out the retro changelog code : it does exactly what you are trying to do --- maintain a flat file change log like we had in UMich, OpenLDAP, Netscape DS 1-4x and so on. Somewhere right around here would be a good place to look: http://cvs.fedora.redhat.com/lxr/dirsec/source/ldapserver/ldap/servers/plugins/retrocl/retrocl_po.c#492