aboutsummaryrefslogtreecommitdiffstats
path: root/transfug_oe.c
diff options
context:
space:
mode:
authorYves Duret <yduret@mandriva.com>2001-06-14 01:15:30 +0000
committerYves Duret <yduret@mandriva.com>2001-06-14 01:15:30 +0000
commit698b2b8643c3213eaeee3c2fa5265ccd507a49ed (patch)
treebf665076633a2a2835ed79ad9db790f599e4ad9d /transfug_oe.c
parenta6ce2ae4d095408f34d2e0fc03b944894bd5cb7e (diff)
downloadtransfugdrake-698b2b8643c3213eaeee3c2fa5265ccd507a49ed.tar
transfugdrake-698b2b8643c3213eaeee3c2fa5265ccd507a49ed.tar.gz
transfugdrake-698b2b8643c3213eaeee3c2fa5265ccd507a49ed.tar.bz2
transfugdrake-698b2b8643c3213eaeee3c2fa5265ccd507a49ed.tar.xz
transfugdrake-698b2b8643c3213eaeee3c2fa5265ccd507a49ed.zip
more features...
Diffstat (limited to 'transfug_oe.c')
-rw-r--r--transfug_oe.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/transfug_oe.c b/transfug_oe.c
index 143558b..a8eb928 100644
--- a/transfug_oe.c
+++ b/transfug_oe.c
@@ -346,9 +346,6 @@ oe_data* oe_readbox(char* filename,void (*oput)(char*)) {
/* SIGNATURE */
fread(&signature,16,1,data->oe);
-#ifdef DEBUG
- printf("signature: %.8x\n",signature[0]);
-#endif
if ((signature[0]!=0xFE12ADCF) || /* OE 5 & OE 5 BETA SIGNATURE */
(signature[1]!=0x6F74FDC5) ||
(signature[2]!=0x11D1E366) ||
@@ -407,6 +404,14 @@ oe_data* oe_readmbox(char* filename,void (*oput)(char*)) {
FILE *mbox = NULL;
char *filename = NULL, *fn;
+void msgandquit(int h) {
+ if (h==0)
+ printf("transfug_oe\nSyntax: transfug_oe [oe_mbox]*\n"
+ "based on OE2MBX 1.21 (c) 2000 Stephan B. Nedregaard - stephan@micropop.com\n");
+ else if (h==1)
+ printf("OE2MBX cannot run on this platform. Please consult the Web site at http://www.micropop.com/code/\n");
+ exit(h);
+}
void fatal(char *s) {
printf("Fatal error: %s\n\n",s);
@@ -414,33 +419,26 @@ void fatal(char *s) {
}
void writeit(char *s) {
- if (mbox==NULL) {
- mbox=fopen(fn,"w");
- if(mbox==NULL) {
- fprintf (stderr, "TransfugDrake ERROR: cannot create file %s\n",fn);
- exit (1);
- }
- fprintf(mbox,"%s",s);
- }
+ if (mbox==NULL) {
+ mbox=fopen(fn,"w");
+ if(mbox==NULL) fatal("Cannot create output file");
+ }
+ fprintf(mbox,"%s",s);
}
int main(int argc, char*argv[]) {
int i;
- oe_data *j;
-
- /* Handle errors, help and syntax */
- if (argc<3) {
- printf("transfug_oe\nSyntax: transfug_oe oe_dbx output_mbox \n");
- return (0);
- }
+ oe_data *j;
- /* Process mailbox */
+ /* Handle errors, help and syntax */
+ if (argc<3) msgandquit(0);
+ /* Process mailboxes */
printf("Converting %s...\n",argv[1]);
fn = argv[2];
+ if (*fn==SLASH) fn++;
printf(" => %s\n",fn);
j = (oe_data*) oe_readbox(argv[1],writeit);
- printf("yy\n");
if (j!=NULL) {
if (!j->success) printf(" No messages converted"); else
printf(" %d messages converted",j->success);