#include <errno.h>
#include <libgen.h>
#include <libxml/xmlwriter.h>
-#include <pwd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
{
char buf[30];
- struct passwd *pw = getpwuid (getuid ());
time_t t = time (NULL);
struct tm *tm = localtime (&t);
strftime (buf, 30, "%Y-%m-%dT%H:%M:%S", tm);
- xmlTextWriterStartElement (w, _xml ("meta:initial-creator"));
- xmlTextWriterWriteString (w, _xml (strtok (pw->pw_gecos, ",")));
- xmlTextWriterEndElement (w);
-
xmlTextWriterStartElement (w, _xml ("meta:creation-date"));
xmlTextWriterWriteString (w, _xml (buf));
xmlTextWriterEndElement (w);
- xmlTextWriterStartElement (w, _xml ("dc:creator"));
- xmlTextWriterWriteString (w, _xml (strtok (pw->pw_gecos, ",")));
-
- xmlTextWriterEndElement (w);
-
xmlTextWriterStartElement (w, _xml ("dc:date"));
xmlTextWriterWriteString (w, _xml (buf));
xmlTextWriterEndElement (w);