home *** CD-ROM | disk | FTP | other *** search
- ===========================================================================
- BBS: The Abacus * HST/DS * Potterville, MI
- Date: 05-15-93 (17:07) Number: 130
- From: DANNY MATHEWS Refer#: NONE
- To: ALL Recvd: NO
- Subj: <string.h> 2/2 Conf: (36) C Language
- ---------------------------------------------------------------------------
- #include <stdio.h>
- #include <stdlib.h>
- /* #include <string.h> */
-
- FILE *fin; /* log file for misti data */
-
- char date[9] = "93/05/13";
- char time[9] = "04:30:20";
-
- long ddate = 0;
- long pm_ddate = 0;
-
-
- /*------------------------------------------------------------------
- ** function prototypes
- */
-
- int main(void);
-
- void grp_data(void); /* group data for output */
-
- /*------------------------------------------------------------------
- ** function declarations
- */
-
- void grp_data()
- {
- FILE *fin; /* misti data file */
- FILE *fout; /* data output file */
- FILE *fmod; /* module data file */
- FILE *flog; /* log file */
-
- int r;
- int len;
-
- char entity[9] = "";
- char pm_date[8] = "";
- char mach[9] = "";
- char state[6] = "";
- char pm[14] = "";
- char descript[31] = "";
- char target[31] = "";
-
- if ((fin = fopen("misti.dat","r")) == NULL) {
- fprintf(stderr, "Cannot open MISTI.DAT file.\n");
- exit(1);
- }
- fout = fopen("pm.rpt","w");
- fmod = fopen("module.dat","r");
- flog = fopen("error.log","w");
-
- while (!feof(fin)) { /* get machine data */
- fscanf(fin,"%6s %5s %7s %12s",entity,state,pm_date,pm);
-
- rewind(fmod);
- r = 1;
-
- while (( r !=0 ) && (!feof(fmod))){ /* get machine description */
-
- fscanf(fmod,"%6s ",mach);
- fgets(descript,30,fmod);
-
- r = strcmp(entity,mach); /* was it in the list */
-
- if (r == 0) { /* if so, write to report */
- len = strxfrm(target,descript,30);
- strxfrm(target,descript,len);
- fprintf(fout," %-7s %-25s %5s %-13s %7s"
- ,mach,target,state,pm,pm_date);
- fprintf(fout,"\n");
- }
- } /* end while fmod */
- } /* end while fin */
-
- fclose(fin);
- fclose(fout);
- fclose(fmod);
- fclose(flog);
- } /* end grp_data */
-
- /*------------------------------------------------------------------
- ** main function
- */
-
- int main(void)
- {
- grp_data();
- return(0);
- } /* end main */
-
- ... OFFLINE 1.52 "For fresh breath and white teeth brush with `PENTIUM'"
-
- --- Maximus 2.01wb
- * Origin: The MOCHINE BBS * Irving, TX * 214/399-8414 * HST DS * (1:124/1301)
- SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1
- SEEN-BY: 153/752 154/40 77 157/2 159/100 125 575 950 203/23 209/209 261/1023
- SEEN-BY: 280/1 390/1 396/1 5 15 2270/1 2440/5 3603/20
-