/* extract_gp_occ.c

   This program extracts the values from the array
   _occidental_hershey_glyphs[] in the GNU Plotutils file
   "libplot/g_her_glyph.c".

   It should be compiled together with "g_her_glyph.h",
   which in turn requires that files "sys-defines.h" and
   "extern.h" exist (but they may be null).  One possible
   makefile entry for this would be:

extract_gp_occ: extract_gp_occ.c
	touch sys-defines.h
	touch extern.h
	cc -o extract_gp_occ extract_gp_occ.c g_her_glyph.c

   This program takes no input and writes to stdout.

   This program has been tested only against the GNU Plotutils
   release 2.4.1 g_her_glyphs.c file.

*/


#include <stdio.h>

extern const char * const _occidental_hershey_glyphs[];


int main()
{
int ix;
int num_pairs;
int max_num_pairs;
int longest_glyph;

   max_num_pairs = 0;
   longest_glyph = 0;
   for (ix = 0; ix <= 4194; ix++) {
      num_pairs = (int)strlen(_occidental_hershey_glyphs[ix])/2;
      if (num_pairs > max_num_pairs) {
         max_num_pairs = num_pairs;
         longest_glyph = ix;
      }
      printf ("%5d%3d%s\n", ix, num_pairs, _occidental_hershey_glyphs[ix]);
   }
   printf ("longest glyph: %d\n", longest_glyph);
   printf ("max num pairs: %d\n", max_num_pairs);
}

/*
Copyright 2003 by David M. MacMillan

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This work is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Free Documentation License for more details.
You should have received a copy of the GNU Free Documentation License
along with this work; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA  02111-1307, USA.


In no event will the author(s), editor(s), or publisher(s) of this work
be liable to you or to any other party for damages,
including but not limited to any general, special, incidental 
or consequential damages arising out of your use of or inability to use this
work or the information contained in it, even if you have been advised 
of the possibility of such damages.

In no event will the author(s), editor(s), or publisher(s) of this work
be liable to you or to any other party for any injury, death,
disfigurement, or other personal damage arising out of your use of
or inability to use this work or the information
contained in it, even if you have been advised of the
possibility of such injury, death, disfigurement, or other
personal damage.

*/
