automake --add-missing # optional - for developers
autoconf # optional - for developers
./configure
make
su
make installNote - It may happen usage of autoreconf && autoupdate is needed if you use newer automake tools than original.
- Use libpst as code base.
- Code cleanup. Get rid of Python support - the binding should be implemented in another repo.
- Make API calls reentrant/thread safe.
- Get rid of single purpose binaries (readpst, lspst, ...).
- Make programmable abstraction over non-basic original binaries' functionality:
-
lspst -
readpst -
pst2ldif -
pst2dii
-
- Make API integrable to other languages.
- Allow streaming of records from pst and parallell export.
- Redefine old single purpose binaries to support NDJSON format on input/output and create separate repo.
- Create separate bindings:
- Golang - gopst,
- Python.
- Rename project to
libpst2?
This is simplistic alternative to readpst utility in modern API.
#include <regex.h>
#include <string.h>
#include "define.h"
#include "pst.h"
int main(int argc, char* const* argv) {
if (argc < 2) {
return 1;
}
const char * path = argv[1];
pst_record_enumerator *ie = record_enumerator_new(path);
pst_list(ie);
pst_record ** lst = ie->items;
pst_export * ppe = pst_export_new(pst_export_conf_default);
ppe->pstfile = ie->file; // misconception
int nth = 0;
while(*lst) {
pst_record * pr = *lst;
lst++;
if(!pr) continue;
printf("Known type with path %s / %s\n", pr->logical_path, pr->name);
char * rename = calloc(128, sizeof(char));
snprintf(rename, 96, "output_%d.eml", nth++ );
pr->renaming = rename;
int error;
uint64_t written = pst_record_to_file(pr, ppe, &error);
free(rename);
pr->renaming = NULL;
printf("Written %lu, error: %d\n", written, error);
}
record_enumerator_destroy(ie);
pst_export_destroy(ppe);
return 0;
}