summaryrefslogtreecommitdiffstats
path: root/mfppmain.c
blob: 3011aeeae0f2da0d4f37f246f01761ede6ff574b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * mfppmain.c
 *
 * Main program for mfpp
 *
 * Copyright  1996 H. Peter Anvin
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include "mfpp.h"

/*
 * Debug level
 */

int debug = 0;

int main(int argc, char *argv[])
{
  FILE *f;

  if ( argc < 2 || argc > 3 )
    {
      fprintf(stderr, "Usage: %s filename [debuglevel]\n", argv[0]);
      exit(1);
    }

  f = fopen(argv[1], "rt");
  if ( !f )
    {
      perror(argv[1]);
      exit(1);
    }

  if ( argc == 3 )
    debug = atoi(argv[2]);

  exit(ppfile(f));
}