1: #include <stdio.h>
   2: #include "bm.h"
   3: #include "Extern.h"
   4: extern char * malloc();
   5: /* makes a pattern descriptor */
   6: struct PattDesc *MakeDesc(Pattern)
   7: char *Pattern;
   8: {
   9:     struct PattDesc *Desc;
  10:     Desc = (struct PattDesc *) malloc(sizeof(struct PattDesc));
  11:     if (!(Desc->Skip1 = (int *) malloc( sizeof(int) * (MAXCHAR + 1)))){
  12:         fprintf(stderr,"bm: can't allocate space\n");
  13:         exit(2);
  14:     } /* if */
  15:     if (!(Desc->Skip2 = (int *) malloc(sizeof(int) * strlen(Pattern)))){
  16:         fprintf(stderr,"bm: can't allocate space\n");
  17:         exit(2);
  18:     } /* if */
  19:     Desc->Pattern=Pattern;
  20:     Desc->PatLen = strlen(Desc->Pattern);
  21:     MakeSkip(Desc->Pattern,Desc->Skip1,
  22:     Desc->Skip2,Desc->PatLen);
  23:     return(Desc);
  24: } /* main */

Defined functions

MakeDesc defined in line 6; used 3 times
Last modified: 1985-09-14
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2535
Valid CSS Valid XHTML 1.0 Strict