comparison src/lspst.c @ 118:0f1492b7fe8b

patch from Fridrich Strba for building on mingw and general cleanup of autoconf files add processing for pst files of type 0x0f start adding support for properly building and installing libpst.so and the header files required to use it. remove version.h since the version number is now in config.h more const correctness issues regarding getopt()
author Carl Byington <carl@five-ten-sg.com>
date Sat, 31 Jan 2009 12:12:36 -0800
parents 7133b39975f7
children 6395ced2b8b2
comparison
equal deleted inserted replaced
117:0a3d854b53f6 118:0f1492b7fe8b
15 #include <ctype.h> 15 #include <ctype.h>
16 #include <errno.h> 16 #include <errno.h>
17 #include <unistd.h> 17 #include <unistd.h>
18 18
19 #include "libpst.h" 19 #include "libpst.h"
20 #include "common.h"
20 #include "timeconv.h" 21 #include "timeconv.h"
21 22
22 struct file_ll { 23 struct file_ll {
23 char *dname; 24 char *dname;
24 int32_t stored_count; 25 int32_t stored_count;
28 }; 29 };
29 30
30 31
31 void canonicalize_filename(char *fname); 32 void canonicalize_filename(char *fname);
32 void debug_print(char *fmt, ...); 33 void debug_print(char *fmt, ...);
33 int usage(char *prog_name); 34 void usage(char *prog_name);
34 int version(); 35 void version();
35 36
36 // global settings 37 // global settings
37 pst_file pstfile; 38 pst_file pstfile;
38 39
39 40
147 close_enter_dir(&ff); 148 close_enter_dir(&ff);
148 DEBUG_RET(); 149 DEBUG_RET();
149 } 150 }
150 151
151 152
152 int usage(char *prog_name) { 153 void usage(char *prog_name) {
153 DEBUG_ENT("usage"); 154 DEBUG_ENT("usage");
154 version(); 155 version();
155 printf("Usage: %s [OPTIONS] {PST FILENAME}\n", prog_name); 156 printf("Usage: %s [OPTIONS] {PST FILENAME}\n", prog_name);
156 printf("OPTIONS:\n"); 157 printf("OPTIONS:\n");
157 printf("\t-d <filename> \t- Debug to file. This is a binary log. Use readlog to print it\n"); 158 printf("\t-d <filename> \t- Debug to file. This is a binary log. Use readlog to print it\n");
158 printf("\t-h\t- Help. This screen\n"); 159 printf("\t-h\t- Help. This screen\n");
159 printf("\t-V\t- Version. Display program version\n"); 160 printf("\t-V\t- Version. Display program version\n");
160 DEBUG_RET(); 161 DEBUG_RET();
161 return 0; 162 }
162 } 163
163 164
164 165 void version() {
165 int version() {
166 DEBUG_ENT("version"); 166 DEBUG_ENT("version");
167 printf("lspst / LibPST v%s\n", VERSION); 167 printf("lspst / LibPST v%s\n", VERSION);
168 #if BYTE_ORDER == BIG_ENDIAN 168 #if BYTE_ORDER == BIG_ENDIAN
169 printf("Big Endian implementation being used.\n"); 169 printf("Big Endian implementation being used.\n");
170 #elif BYTE_ORDER == LITTLE_ENDIAN 170 #elif BYTE_ORDER == LITTLE_ENDIAN
174 #endif 174 #endif
175 #ifdef __GNUC__ 175 #ifdef __GNUC__
176 printf("GCC %d.%d : %s %s\n", __GNUC__, __GNUC_MINOR__, __DATE__, __TIME__); 176 printf("GCC %d.%d : %s %s\n", __GNUC__, __GNUC_MINOR__, __DATE__, __TIME__);
177 #endif 177 #endif
178 DEBUG_RET(); 178 DEBUG_RET();
179 return 0; 179 }
180 } 180
181 181
182 182 int main(int argc, char* const* argv) {
183 int main(int argc, char** argv) {
184 pst_item *item = NULL; 183 pst_item *item = NULL;
185 pst_desc_ll *d_ptr; 184 pst_desc_ll *d_ptr;
186 char *temp = NULL; //temporary char pointer 185 char *temp = NULL; //temporary char pointer
187 int c; 186 int c;
188 char *d_log = NULL; 187 char *d_log = NULL;