5 int main(
int argc,
char*
const* argv)
9 char *outdir = NULL, *file = NULL, *outname = NULL;
14 while ((c =
getopt(argc, argv,
"o:")) != -1) {
20 printf(
"Unknown switch %c\n", c);
26 printf(
"Usage: dumpblocks [options] pstfile\n");
27 printf(
"\tcopies the datablocks from the pst file into separate files\n");
28 printf(
"Options: \n");
29 printf(
"\t-o target\tSpecify the output directory\n");
35 printf(
"Opening file %s\n", file);
37 printf(
"Failed to open file %s\n", file);
41 printf(
"Reading Indexes\n");
43 printf(
"Failed to load indexes in file %s\n", argv[1]);
49 printf(
"Failed to change into directory %s\n", outdir);
54 printf(
"Saving blocks\n");
60 if ((fp = fopen(outname,
"wb")) == NULL) {
61 printf(
"Failed to open file %s\n", outname);
67 printf(
"Failed to read block i_id %#"PRIx64
"\n", ptr->
i_id);
void * pst_malloc(size_t size)
int pst_close(pst_file *pf)
Close a pst file.
int getopt(int argc, char *const *argv, char *optstring)
int pst_open(pst_file *pf, const char *name, const char *charset)
Open a pst file.
size_t pst_ff_getIDblock_dec(pst_file *pf, uint64_t i_id, char **buf)
Get an ID block from file using pst_ff_getIDblock() and decrypt if necessary.
int main(int argc, char *const *argv)
#define DEBUG_INIT(fname, mutex)
int pst_load_index(pst_file *pf)
Load the index entries from the pst file.
size_t pst_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
fwrite with checking for null pointer.
pst_index_ll * i_table
the array of index structures