Asterisk - The Open Source Telephony Project GIT-master-f36a736
Functions
ham84.c File Reference
#include "f2c.h"
Include dependency graph for ham84.c:

Go to the source code of this file.

Functions

int ham84_ (integer *input, integer *output, integer *errcnt)
 

Function Documentation

◆ ham84_()

int ham84_ ( integer input,
integer output,
integer errcnt 
)

Definition at line 85 of file ham84.c.

86{
87 /* Initialized data */
88
89 static integer dactab[128] = { 16,0,0,3,0,5,14,7,0,9,14,11,14,13,30,14,0,
90 9,2,7,4,7,7,23,9,25,10,9,12,9,14,7,0,5,2,11,5,21,6,5,8,11,11,27,
91 12,5,14,11,2,1,18,2,12,5,2,7,12,9,2,11,28,12,12,15,0,3,3,19,4,13,
92 6,3,8,13,10,3,13,29,14,13,4,1,10,3,20,4,4,7,10,9,26,10,4,13,10,15,
93 8,1,6,3,6,5,22,6,24,8,8,11,8,13,6,15,1,17,2,1,4,1,6,15,8,1,10,15,
94 12,15,15,31 };
95
96 integer i__, j, parity;
97
98/* Arguments */
99/* Parameters/constants */
100/* Local variables that need not be saved */
101/* Determine parity of input word */
102 parity = *input & 255;
103 parity ^= parity / 16;
104 parity ^= parity / 4;
105 parity ^= parity / 2;
106 parity &= 1;
107 i__ = dactab[*input & 127];
108 *output = i__ & 15;
109 j = i__ & 16;
110 if (j != 0) {
111/* No errors detected in seven bits */
112 if (parity != 0) {
113 ++(*errcnt);
114 }
115 } else {
116/* One or two errors detected */
117 ++(*errcnt);
118 if (parity == 0) {
119/* Two errors detected */
120 ++(*errcnt);
121 *output = -1;
122 }
123 }
124 return 0;
125} /* ham84_ */
static int input(yyscan_t yyscanner)
Definition: ast_expr2f.c:1570
INT32 integer
Definition: lpc10.h:80

References input().

Referenced by decode_().