home *** CD-ROM | disk | FTP | other *** search
- /*
- showmail:
- */
- #include <stdio.h>
- #include <dos.h>
- #include <string.h>
- #include <errno.h>
- #include <assert.h>
- #include <stddef.h>
- #include <stdlib.h>
-
-
- struct _msg
- {
- char from[36];
- char to[36];
- char subj[72];
- char date[20];
- int times;
- int dest;
- int orig;
- int cost;
- int caca[6];
- unsigned reply;
- int attr;
- int up;
- char content[4096];
- } msg;
-
- char msgbuffer[4091];
- char mailfile[128];
- char badname[36];
-
-
- void main(int, char*[]);
-
- void main(argc, argv)
- int argc;
- char *argv[];
- {
- int i;
- char *c, *cme;
- struct find_t ft;
-
- FILE *fp;
-
- strcpy(mailfile,"1.MSG");
-
- for(i=1; i<argc; i++) {
- if (*(c=argv[i])=='-') ;
- else {
- strcpy(mailfile,c);
- }
- }
-
- if (!(fp=fopen(mailfile,"rb"))) {
- printf("Error: %s not found\n",mailfile);
- exit(1);
- }
- fread((void *)&msg,sizeof(msg),1,fp);
- fclose(fp);
-
- printf("The fido-formatted mail message header to %s is:\n"
- "To: %s\nFrom: %s\nRe: %s\nDate: %s\nRead %d times\n",
- mailfile,msg.to,msg.from,msg.subj,msg.date,msg.times);
-
-
- exit(0);
- }
-