Initial snark14m import
[snark14.git] / src / snark / chtoin.cpp
1 /*
2  ***********************************************************
3  $SNARK_Header: S N A R K  1 4 - A PICTURE RECONSTRUCTION PROGRAM $
4  $HeadURL: svn://dig.cs.gc.cuny.edu/snark/trunk/src/snark/chtoin.cpp $
5  $LastChangedRevision: 85 $
6  $Date: 2014-07-02 16:07:08 -0400 (Wed, 02 Jul 2014) $
7  $Author: agulati $
8  ***********************************************************
9
10  CONVERT A NUMERIC CHARACTER INTO A DIGIT
11  REVISED BY G. FRIEDER, JULY 1981
12  */
13
14 #include <cstdio>
15
16 #include "blkdta.h"
17 #include "chtoin.h"
18
19 INTEGER chtoin(CHAR hol)
20 {
21         CHAR digits[10] =
22         { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
23         int i;
24
25         for (i = 0; i < 10; i++)
26         {
27                 if (hol != digits[i])
28                         continue;
29
30                 return i;
31         }
32         return 0;
33 }