aboutsummaryrefslogtreecommitdiffstats
path: root/isdb-t/br-sp-Mairipora
blob: 7f7476dcb22708e57c86022851fa71d6dcb9a776 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# Channel table for Mairiporã - SP - Brazil
# Source: http://www.portalbsd.com.br/terrestres_channels.php?channels=3401

# Physical channel 18
[Globo SP]
	DELIVERY_SYSTEM = ISDBT
	BANDWIDTH_HZ = 6000000
	FREQUENCY = 497142857
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	ISDBT_LAYER_ENABLED = 7
	ISDBT_SOUND_BROADCASTING = 0
	ISDBT_SB_SUBCHANNEL_ID = 0
	ISDBT_SB_SEGMENT_IDX = 0
	ISDBT_SB_SEGMENT_COUNT = 0
	ISDBT_LAYERA_FEC = AUTO
	ISDBT_LAYERA_MODULATION = QAM/AUTO
	ISDBT_LAYERA_SEGMENT_COUNT = 0
	ISDBT_LAYERA_TIME_INTERLEAVING = 0
	ISDBT_LAYERB_FEC = AUTO
	ISDBT_LAYERB_MODULATION = QAM/AUTO
	ISDBT_LAYERB_SEGMENT_COUNT = 0
	ISDBT_LAYERB_TIME_INTERLEAVING = 0
	ISDBT_LAYERC_FEC = AUTO
	ISDBT_LAYERC_MODULATION = QAM/AUTO
	ISDBT_LAYERC_SEGMENT_COUNT = 0
	ISDBT_LAYERC_TIME_INTERLEAVING = 0

# Physical channel 20
[Record TV]
	DELIVERY_SYSTEM = ISDBT
	BANDWIDTH_HZ = 6000000
	FREQUENCY = 509142857
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	ISDBT_LAYER_ENABLED = 7
	ISDBT_SOUND_BROADCASTING = 0
	ISDBT_SB_SUBCHANNEL_ID = 0
	ISDBT_SB_SEGMENT_IDX = 0
	ISDBT_SB_SEGMENT_COUNT = 0
	ISDBT_LAYERA_FEC = AUTO
	ISDBT_LAYERA_MODULATION = QAM/AUTO
	ISDBT_LAYERA_SEGMENT_COUNT = 0
	ISDBT_LAYERA_TIME_INTERLEAVING = 0
	ISDBT_LAYERB_FEC = AUTO
	ISDBT_LAYERB_MODULATION = QAM/AUTO
	ISDBT_LAYERB_SEGMENT_COUNT = 0
	ISDBT_LAYERB_TIME_INTERLEAVING = 0
	ISDBT_LAYERC_FEC = AUTO
	ISDBT_LAYERC_MODULATION = QAM/AUTO
	ISDBT_LAYERC_SEGMENT_COUNT = 0
	ISDBT_LAYERC_TIME_INTERLEAVING = 0

# Physical channel 23
[Band]
	DELIVERY_SYSTEM = ISDBT
	BANDWIDTH_HZ = 6000000
	FREQUENCY = 527142857
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	ISDBT_LAYER_ENABLED = 7
	ISDBT_SOUND_BROADCASTING = 0
	ISDBT_SB_SUBCHANNEL_ID = 0
	ISDBT_SB_SEGMENT_IDX = 0
	ISDBT_SB_SEGMENT_COUNT = 0
	ISDBT_LAYERA_FEC = AUTO
	ISDBT_LAYERA_MODULATION = QAM/AUTO
	ISDBT_LAYERA_SEGMENT_COUNT = 0
	ISDBT_LAYERA_TIME_INTERLEAVING = 0
	ISDBT_LAYERB_FEC = AUTO
	ISDBT_LAYERB_MODULATION = QAM/AUTO
	ISDBT_LAYERB_SEGMENT_COUNT = 0
	ISDBT_LAYERB_TIME_INTERLEAVING = 0
	ISDBT_LAYERC_FEC = AUTO
	ISDBT_LAYERC_MODULATION = QAM/AUTO
	ISDBT_LAYERC_SEGMENT_COUNT = 0
	ISDBT_LAYERC_TIME_INTERLEAVING = 0

# Physical channel 24
[TV Cultura, Univesp, Multicultura Educação]
	DELIVERY_SYSTEM = ISDBT
	BANDWIDTH_HZ = 6000000
	FREQUENCY = 533142857
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	ISDBT_LAYER_ENABLED = 7
	ISDBT_SOUND_BROADCASTING = 0
	ISDBT_SB_SUBCHANNEL_ID = 0
	ISDBT_SB_SEGMENT_IDX = 0
	ISDBT_SB_SEGMENT_COUNT = 0
	ISDBT_LAYERA_FEC = AUTO
	ISDBT_LAYERA_MODULATION = QAM/AUTO
	ISDBT_LAYERA_SEGMENT_COUNT = 0
	ISDBT_LAYERA_TIME_INTERLEAVING = 0
	ISDBT_LAYERB_FEC = AUTO
	ISDBT_LAYERB_MODULATION = QAM/AUTO
	ISDBT_LAYERB_SEGMENT_COUNT = 0
	ISDBT_LAYERB_TIME_INTERLEAVING = 0
	ISDBT_LAYERC_FEC = AUTO
	ISDBT_LAYERC_MODULATION = QAM/AUTO
	ISDBT_LAYERC_SEGMENT_COUNT = 0
	ISDBT_LAYERC_TIME_INTERLEAVING = 0

# Physical channel 28
[SBT Vale]
	DELIVERY_SYSTEM = ISDBT
	BANDWIDTH_HZ = 6000000
	FREQUENCY = 557142857
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	ISDBT_LAYER_ENABLED = 7
	ISDBT_SOUND_BROADCASTING = 0
	ISDBT_SB_SUBCHANNEL_ID = 0
	ISDBT_SB_SEGMENT_IDX = 0
	ISDBT_SB_SEGMENT_COUNT = 0
	ISDBT_LAYERA_FEC = AUTO
	ISDBT_LAYERA_MODULATION = QAM/AUTO
	ISDBT_LAYERA_SEGMENT_COUNT = 0
	ISDBT_LAYERA_TIME_INTERLEAVING = 0
	ISDBT_LAYERB_FEC = AUTO
	ISDBT_LAYERB_MODULATION = QAM/AUTO
	ISDBT_LAYERB_SEGMENT_COUNT = 0
	ISDBT_LAYERB_TIME_INTERLEAVING = 0
	ISDBT_LAYERC_FEC = AUTO
	ISDBT_LAYERC_MODULATION = QAM/AUTO
	ISDBT_LAYERC_SEGMENT_COUNT = 0
	ISDBT_LAYERC_TIME_INTERLEAVING = 0

# Physical channel 29
[Rede TV!]
	DELIVERY_SYSTEM = ISDBT
	BANDWIDTH_HZ = 6000000
	FREQUENCY = 563142857
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	ISDBT_LAYER_ENABLED = 7
	ISDBT_SOUND_BROADCASTING = 0
	ISDBT_SB_SUBCHANNEL_ID = 0
	ISDBT_SB_SEGMENT_IDX = 0
	ISDBT_SB_SEGMENT_COUNT = 0
	ISDBT_LAYERA_FEC = AUTO
	ISDBT_LAYERA_MODULATION = QAM/AUTO
	ISDBT_LAYERA_SEGMENT_COUNT = 0
	ISDBT_LAYERA_TIME_INTERLEAVING = 0
	ISDBT_LAYERB_FEC = AUTO
	ISDBT_LAYERB_MODULATION = QAM/AUTO
	ISDBT_LAYERB_SEGMENT_COUNT = 0
	ISDBT_LAYERB_TIME_INTERLEAVING = 0
	ISDBT_LAYERC_FEC = AUTO
	ISDBT_LAYERC_MODULATION = QAM/AUTO
	ISDBT_LAYERC_SEGMENT_COUNT = 0
	ISDBT_LAYERC_TIME_INTERLEAVING = 0
#e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#ifdef __STDC__
#include <stdlib.h>
#endif

#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS (0)
#define EXIT_FAILURE (1)
#endif

#define DATE "20 Feb 1996"
#define VERSION "2.2"

/*
   chkfont
   By Glenn Chappell <ggc@uiuc.edu>

   This program checks figlet 2.0/2.1 font files for format errors.
   It also looks for signs of common problems and gives warnings.
   chkfont does not modify font files.

   Usage: chkfont fontfile ...

   Note: This is very much a spare-time project. It's probably
   full o' bugs ....
*/

/* Squashed some warnings and a double free(): Kenneth Davies Mar 14 2005 */

/* #define CHECKBLANKS */
#define FONTFILESUFFIX ".flf"
#define FONTFILEMAGICNUMBER "flf2"

const char
posshardblanks[9] = { '!', '@', '#', '$', '%', '&', '*', '\177', '\0' };

char *myname,*fontfilename;
FILE *fontfile;
char hardblank;
int charheight,upheight,old_layout;
int spectagcnt;
char *fileline = NULL;
int currline;
int maxlinelength=0;
int maxlen=0;
int ec,wc;

int incon_endmarkwarn,endmark_countwarn,nonincrwarn;
int bigcodetagwarn,deutschcodetagwarn,asciicodetagwarn;
int codetagcnt;
int gone;

void 
weregone(int really)
{
if (!really && 2*ec+wc<=40) {
  return;
  }
if (ec+wc>0) printf("*******************************************************************************\n");
if (!really) {
  printf("%s: Too many errors/warnings.\n",fontfilename);
  }
printf("%s: Errors: %d, Warnings: %d\n",fontfilename,ec,wc);
if (currline>1 && maxlen!=maxlinelength) {
  printf("%s: maxlen: %d, actual max line length: %d\n",
    fontfilename,maxlen,maxlinelength);
  if (codetagcnt>0 && spectagcnt==-1) {
    printf("%s: Code-tagged characters: %d\n",fontfilename,codetagcnt);
    }
  }
printf("-------------------------------------------------------------------------------\n");
gone=1;
}

char *
my_alloc(size_t size)
{
char *ptr;

ptr=(char *)malloc(size);
if (ptr==NULL) {
  fprintf(stderr,"%s: Out of memory\n",myname);
  exit(EXIT_FAILURE); /* Bail out now instead of not returning anything */
  }
else {
  return(ptr);
  }
}

int
badsuffix(char *path, char *suffix)
{
  char ucsuffix[10];
  char *s;

  strcpy(ucsuffix,suffix);
  for (s = ucsuffix; *s; s++) {
    *s = toupper(*s);
    }

  if (strlen(path)<strlen(suffix)) return 1;
  s = path + strlen(path) - strlen(suffix);
  if (strcmp(s,suffix) == 0) return 0;
  if (strcmp(s,ucsuffix) == 0) return 0;
  return 1;
}

void
usageerr()
{
fprintf(stderr,"chkfont by Glenn Chappell <ggc@uiuc.edu>\n");
fprintf(stderr,"Version: %s, date: %s\n",VERSION,DATE);
fprintf(stderr,"Checks figlet 2.0/2.1 font files for format errors.\n");
fprintf(stderr,"(Does not modify font files.)\n");
fprintf(stderr,"Usage: %s fontfile ...\n",myname);
exit(EXIT_FAILURE);
}


void
readchar()
{
int i,expected_width,k,diff,l;
char endmark,expected_endmark;
int leadblanks,minleadblanks,trailblanks,mintrailblanks;
int len, newlen; 

 minleadblanks=0;
 expected_endmark='\0';
 expected_width=0;
 mintrailblanks=0;

for (i=0;i<charheight;i++) {
  fgets(fileline,maxlen+1000,fontfile);
  if (feof(fontfile)) {
    printf("%s: ERROR (fatal)- Unexpected end of file after line %d.\n",
      fontfilename,currline);
    ec++;
    weregone(1); if (gone) return;
    }
  currline++;
  len=strlen(fileline)-1;
  if (len>maxlinelength) {
    maxlinelength=len;
    }
  if (len>maxlen) {
    printf("%s: ERROR- Line length > maxlen in line %d.\n",
      fontfilename,currline);
    ec++;
    weregone(0); if (gone) return;
    }
  k=len;
  endmark=k<0?'\0':(k==0||fileline[k]!='\n')?fileline[k]:fileline[k-1];
  for(;k>=0?(fileline[k]=='\n' || fileline[k]==endmark):0;k--) {
    fileline[k]='\0';
    }
  newlen=strlen(fileline);
  for (l=0;l<newlen ? fileline[l]==' ' : 0;l++) ;
  leadblanks = l;
  for (l=newlen-1;l>=0 ? fileline[l]==' ' : 0;l--) ;
  trailblanks = newlen-1-l;
  if (i==0) {
    expected_endmark = endmark;
    expected_width = newlen;
    minleadblanks = leadblanks;
    mintrailblanks = trailblanks;
    if (endmark==' ') {
      printf("%s: Warning- Blank endmark in line %d.\n",
        fontfilename,currline);
      wc++;
      weregone(0); if (gone) return;
      }
    }
  else {
    if (leadblanks<minleadblanks) minleadblanks = leadblanks;
    if (trailblanks<mintrailblanks) mintrailblanks = trailblanks;
    if (endmark!=expected_endmark && !incon_endmarkwarn) {
      printf("%s: Warning- Inconsistent endmark in line %d.\n",
        fontfilename,currline);
      printf("%s:          (Above warning will only be printed once.)\n",
        fontfilename);
      incon_endmarkwarn = 1;
      wc++;
      weregone(0); if (gone) return;
      }
    if (newlen!=expected_width) {
      printf("%s: ERROR- Inconsistent character width in line %d.\n",
        fontfilename,currline);
      ec++;
      weregone(0); if (gone) return;
      }
    }
  diff=len-newlen;
  if (diff>2) {
    printf("%s: ERROR- Too many endmarks in line %d.\n",
      fontfilename,currline);
    ec++;
    weregone(0); if (gone) return;
    }
  else if (charheight>1 && (diff!=(i==charheight-1)+1)) {
    if (!endmark_countwarn) {
      printf("%s: Warning- Endchar count convention violated in line %d.\n",
        fontfilename,currline);
      printf("%s:          (Above warning will only be printed once.)\n",
        fontfilename);
      endmark_countwarn = 1;
      wc++;
      weregone(0); if (gone) return;
      }
    }
  }
#ifdef CHECKBLANKS
if (minleadblanks+mintrailblanks>0 && old_layout>=0) {
  printf("%s: Warning- Leading/trailing blanks in char. ending at line %d.\n",
    fontfilename,currline);
  printf("%s:          (Above warning only given when old_layout > -1.)\n",
    fontfilename);
  wc++;
  weregone(0); if (gone) return;
  }
#endif /* #ifdef CHECKBLANKS */
}


void
checkit()
{
int i,k,cmtcount,numsread,ffrighttoleft,have_layout,layout;
char magicnum[5],cha;
long oldord,theord;
int tmpcnt,len;

ec=0;wc=0;
incon_endmarkwarn=0; endmark_countwarn=0; nonincrwarn=0;
bigcodetagwarn=0; deutschcodetagwarn=0;
asciicodetagwarn=0;
codetagcnt=0;
gone=0;
if (!strcmp(fontfilename,"-")) {
  fontfilename="(stdin)";
  fontfile=stdin;
  }
else {
  fontfile=fopen(fontfilename,"r");
  if (fontfile == NULL) {
    fprintf(stderr,"%s: Could not open file '%s'\n",myname,fontfilename);
    exit(EXIT_FAILURE);
    }
  }

if (fontfile!=stdin) {
  if (badsuffix(fontfilename,FONTFILESUFFIX)) {
    printf("%s: ERROR- Filename does not end with '%s'.\n",
      fontfilename,FONTFILESUFFIX);
    ec++;
    weregone(0); if (gone) return;
    }
  }
fscanf(fontfile,"%4s",magicnum);
if (strcmp(magicnum,FONTFILEMAGICNUMBER)) {
  printf("%s: ERROR- Incorrect magic number.\n",fontfilename);
  ec++;
  weregone(0); if (gone) return;
  }
cha=getc(fontfile);
if (cha!='a') {
  printf("%s: Warning- Sub-version character is not 'a'.\n",fontfilename);
  wc++;
  weregone(0); if (gone) return;
  }
fileline=(char*)my_alloc(sizeof(char)*(1001));
if (fgets(fileline,1001,fontfile)==NULL) {
  fileline[0] = '\0';
  }
if (strlen(fileline)>0 ? fileline[strlen(fileline)-1]!='\n' : 0) {
  while(k=getc(fontfile),k!='\n'&&k!=EOF) ; /* Advance to end of line */
  }
numsread=sscanf(fileline,"%c %d %d %d %d %d %d %d %d",
  &hardblank,&charheight,&upheight,&maxlen,&old_layout,&cmtcount,
  &ffrighttoleft,&layout,&spectagcnt);
free(fileline);
fileline = NULL;
if (numsread<7) {
  ffrighttoleft=0;
  }
if (numsread<9) {
  spectagcnt=-1;
  }
have_layout = (numsread>=8);
if (6>numsread) {
  printf("%s: ERROR (fatal)- First line improperly formatted.\n",fontfilename);
  ec++;
  weregone(1); if (gone) return;
  }
if (!strchr(posshardblanks,hardblank)) {
  printf("%s: Warning- Unusual hardblank.\n",fontfilename);
  wc++;
  weregone(0); if (gone) return;
  }
if (charheight<1) {
  printf("%s: ERROR (fatal)- charheight not positive.\n",fontfilename);
  ec++;
  weregone(1); if (gone) return;
  }
if (upheight>charheight || upheight<1) {
  printf("%s: ERROR- up_height out of bounds.\n",fontfilename);
  ec++;
  weregone(0); if (gone) return;
  }
if (maxlen<1) {
  printf("%s: ERROR (fatal)- maxlen not positive.\n",fontfilename);
  ec++;
  weregone(1); if (gone) return;
  }
if (old_layout<-1) {
  printf("%s: ERROR- old_layout < -1.\n",fontfilename);
  ec++;
  weregone(0); if (gone) return;
  }
if (old_layout>63) {
  printf("%s: ERROR- old_layout > 63.\n",fontfilename);
  ec++;
  weregone(0); if (gone) return;
  }
if (have_layout && layout<0) {
  printf("%s: ERROR- layout < 0.\n", fontfilename);
  ec++;
  weregone(0); if (gone) return;
  }
if (have_layout &&layout>32767) {
  printf("%s: ERROR- layout > 32767.\n", fontfilename);
  ec++;
  weregone(0); if (gone) return;
  }
if (have_layout && old_layout == -1 && (layout & 192)) {
  printf("%s: ERROR- layout %d is inconsistent with old_layout -1.\n",
    fontfilename,layout);
  ec++;
  weregone(0); if (gone) return;
  }
if (have_layout && old_layout == 0 && (layout & 192) != 64 &&
                                   (layout & 255) != 128) {
  printf("%s: ERROR- layout %d is inconsistent with old_layout 0.\n",
    fontfilename,layout);
  ec++;
  weregone(0); if (gone) return;
  }
if (have_layout && old_layout > 0 &&
      (!(layout & 128) || old_layout != (layout & 63))) {
  printf("%s: ERROR- layout %d is inconsistent with old_layout %d.\n",
    fontfilename,layout,old_layout);
  ec++;
  weregone(0); if (gone) return;
  }
if (cmtcount<0) {
  printf("%s: ERROR- cmt_count is negative.\n",fontfilename);
  ec++;
  weregone(0); if (gone) return;
  }
if (ffrighttoleft<0 || ffrighttoleft>1) {
  printf("%s: ERROR- rtol out of bounds.\n",fontfilename);
  ec++;
  weregone(0); if (gone) return;
  }

for (i=1;i<=cmtcount;i++) {
  while(k=getc(fontfile),k!='\n'&&k!=EOF) ; /* Advance to end of line */
  }

maxlinelength = 0;
currline=cmtcount+1;
fileline=(char*)my_alloc(sizeof(char)*(maxlen+1001));
for (i=0;i<102;i++) {
  readchar();
  if (gone) return;
  }

oldord=0;
while(fgets(fileline,maxlen+1000,fontfile)!=NULL) {
  currline++;
  len=strlen(fileline)-1;
  if (len-100>maxlinelength) {
    maxlinelength=len-100;
    }
  if (len>maxlen+100) {
    printf("%s: ERROR- Code tag line way too long in line %d.\n",
      fontfilename,currline);
    ec++;
    weregone(0); if (gone) return;
    }
  tmpcnt=sscanf(fileline,"%li",&theord);
  if (tmpcnt<1) {
    printf("%s: Warning- Extra chars after font in line %d.\n",
      fontfilename,currline);
    wc++;
    weregone(0); if (gone) return;
    break;
    }
  codetagcnt++;
  if (theord>65535 && !bigcodetagwarn) {
    printf("%s: Warning- Code tag > 65535 in line %d.\n",
      fontfilename,currline);
    printf("%s:          (Above warning will only be printed once.)\n",
      fontfilename);
    bigcodetagwarn = 1;
    wc++;
    weregone(0); if (gone) return;
    }
  if (theord==-1) {
    printf("%s: ERROR- Code tag -1 (unusable) in line %d.\n",
      fontfilename,currline);
    ec++;
    weregone(0); if (gone) return;
    break;
    }
  if (theord>=-255 && theord<=-249 &&!deutschcodetagwarn) {
    printf("%s: Warning- Code tag in old Deutsch area in line %d.\n",
      fontfilename,currline);
    printf("%s:          (Above warning will only be printed once.)\n",
      fontfilename);
    deutschcodetagwarn = 1;
    wc++;
    weregone(0); if (gone) return;
    }
  if (theord<127 && theord>31 && !asciicodetagwarn) {
    printf("%s: Warning- Code tag in ASCII range in line %d.\n",
      fontfilename,currline);
    printf("%s:          (Above warning will only be printed once.)\n",
      fontfilename);
    asciicodetagwarn = 1;
    wc++;
    weregone(0); if (gone) return;
    }
  else if (theord<=oldord && theord>=0 && oldord>=0 && !nonincrwarn) {
    printf("%s: Warning- Non-increasing code tag in line %d.\n",
      fontfilename,currline);
    printf("%s:          (Above warning will only be printed once.)\n",
      fontfilename);
    nonincrwarn = 1;
    wc++;
    weregone(0); if (gone) return;
    }
  oldord=theord;
  readchar();
  if (gone) return;
  }

if (spectagcnt!=-1 && spectagcnt!=codetagcnt) {
  printf("%s: ERROR- Inconsistent Codetag_Cnt value %d\n",
    fontfilename, spectagcnt);
  ec++;
  weregone(0); if (gone) return;
  }

if (fontfile!=stdin) fclose(fontfile);

weregone(1); if (gone) return;
}


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

if ((myname=strrchr(argv[0],'/'))!=NULL) {
  myname++;
  }
else {
  myname = argv[0];
  }
if (argc<2) {
  usageerr();
  }
for (arg=1;arg<argc;arg++) {
  fontfilename=argv[arg];
  fileline=NULL;
  checkit();
  if (fileline!=NULL) free(fileline);
  }
exit(0);
}