SCANNER TO COMBINE PARTIAL FRAGMENTS OF A COMPLETE CODE

Abstract: A scanner (100) can read machine-readable code (86) on an object. A scanner has a scanning device, a data device, and a registration device. The scanning device can repetitively scan the code and provide a scan signal repetitively corresponding to at least fragments of the code (86). The data device is coupled to the scanning device and responds to its scan signal for repetitively storing it. The registration device is coupled to the data device for reconstructing the code from at least two of the fragments of the code by relatively shifting the code fragments until they are in registration (103).

Description: SCANNER TO COMBINE PARTIAL FRAGMENTS OF A COMPLETE CODE RELATED CASE *•*. This is a continuation-in-part of prior copending patent application Serial No. 07/237,517, filed August 26, 1988, which is incorporated by reference herein. 5 BACKGROUND OF THE INVENTION The present invention relates to code scanning devices and, in particular, to apparatus and methods for restoring a code from differing code fragments. Well known equipment exists for reading a bar code that 10 is printed on a package. Bar codes on merchandise may be scanned at the point of sale to identify the goods and correlate them to a price. Such equipment is commonly used at supermarket checkout counters. A basic principle conventionally applied in bar code 15 scanning is that of detecting reflected light contrasts. A source of illumination such as a low powered helium neon laser, can produce a beam which is moved across the bar code. Dark areas (bars) absorb laser light, whereas light areas (spaces) reflect light that is subsequently detected by the scanner. 20 Optics are used to "move" a laser beam. Without these * optics, the laser beam appears as a dot. When the optics are used, the beam appears as a line of laser light. This is defined as moving-beam scanning. As the moving beam "travels" across the conveyor (or area to be scanned for a code, commonly called the scanning zone) any light or dark transitions are detected and converted to a digital signal known as code. A valid bar code consists of a defined number of light and dark transitions with correct ratios between the wide and narrow intervals. Existing codes consist of a series of parallel bars separated by spaces. The bars and spaces are printed at either a full width or half width. The bars and spaces may signify a bit pattern wherein wide spaces or bars are denominated a "one" while narrow spaces and bars are denominated a "zero" (or vice versa) . A basic objective in known bar code scanning is laying down a trace that is dense and varied enough to ensure that at least one scan will recover a complete bar code. The denser the scanning, the more rapidly scanning must occur and, therefore, a higher demand is placed upon the circuitry processing the scanned data. Known equipment (for example, U. S. Patent 3,728,677) employs a mirrored wheel having a polygonal periphery. Rotation of the mirrored wheel scans a laser beam across two azimuthally spaced mirrors which deflect the beam downwardly to trace an "X" shaped pattern. Other known equipment has used prisms, mirrors, vidicons, or other apparatus to turn the scan direction of an optical code scanning system. (See, for example, U.S. Patents 3,663,800; 3,774,014; 3,800,282; 3,902,047; and ,064,390) . It is also known (U.S. Patent 3,906,203) to scan a bar code and measure its interval widths by recording the time required to traverse each interval. The successive interval widths are multiplied by three, five, and eight. By storing and comparing the multiplied widths of successive scans, the equipment can determine whether the latest interval is about the same size as, or much smaller or larger than, the prior interval. This equipment, however, performs a relatively coarse comparison and will accept as valid, scan times that are excessively short or long. Accordingly there is a need for a code scanner that does not require support from extraordinarily high speed circuitry, but yet has a high probability of obtaining a complete code when an object passes by the scanner. SUMMARY OF THE INVENTION In accordance with the principles of the present invention, a scanner is provided for reading machine-readable code on an object. The scanner includes a scanning means, a data means, and a registration means. The scanning means can repetitively scan the code and provide a scan signal repetitively corresponding to at least fragments of the code. The data means is coupled to the scanning means and responds to its scan signal for repetitively storing the scan signal. The registration means is coupled to the data means for reconstructing the code from at least two of the fragments of the code, by relatively shifting them until they are in registration. Thus, one of the fragments provides a first portion of the code and the other a second portion. Both fragments provide a registered middle portion of the code. In accordance with the principles of the same invention, a related method is provided for reading machine-readable code on an object. The method includes repetitively scanning the code and obtaining at least fragments of the code. Another step is repetitively recording the fragments of the code. The method also includes the step of reconstructing the code from at least two of the fragments of the code, by relatively shifting them until they are in registration. Thus, one of the fragments provides a first portion of the code and the other a second portion, both providing a registered middle portion of the code. By employing methods and apparatus of the foregoing type, an improved scanner is provided. In a preferred embodiment, the scanner can begin operation when an object passes a checkpoint. Preferably, an optical scanner measures the distance between transitions from light to dark and dark to light. These distances between transitions are assigned numeric values based upon a timing process. A preferred "digital filter" compares the numeric values of successive interval widths. Depending upon the pattern of the interval widths, a pattern detecting process determines whether the measured widths are to be considered wide or narrow. For example, a ratio test may be used to determine if the widths are part of a pattern that may be a segment of a bar code. All segments of "n" transitions (a value that can be set by software) or more that pass this ratio test are stored as a pattern of wide and narrow values for a subsequent reconstruction process. Patterns of less than five transitions are rejected. If no pattern has a code that is sufficiently long to be considered valid, the preferred apparatus attempts to reconstruct code fragments into a complete bar code pattern. The fragments are compared to each other in consecutive order. The fragments are overlaid, shifting each subsequent segment until the wide and narrow patterns of the segments match or register. When a complete bar code pattern has been reconstructed from two or more fragments, a microprocessor can decode the reconstructed bar code and verify that its checksum is valid. In a preferred embodimen , the code is scanned optically by a pattern of staggered "X" shaped traces. These staggered scans may be centered at the vertices of a triangle. By using three "X" shaped patterns a pattern of modest complexity is used, which has a high probability of obtaining a full bar code. But if only a fragment of a bar code need be obtained, the probability is nonetheless high that subsequent fragments will be able to reconstruct the full bar code. BRIEF DESCRIPTION OF THE PREFERRED EMBODIMENTS The above brief description as well as other objects, features and advantages of the present invention will be more fully appreciated by reference to the following detailed description of presently preferred but nonetheless illustrative embodiments in accordance with the present invention, with reference being made to the following figures in which: Fig. l is a schematic perspective diagram of a scanning means that may be used in an embodiment of the present invention; Fig. 2A is a plan diagram of the scans produced by the apparatus of Fig. 1; Fig. 2B is an elevational view of a scanner employing the scanning means of Fig. 1; Fig. 3 is a schematic block diagram of the data means and registration means that may be used in an embodiment of the present invention; Figs. 4A and 4B are timing diagrams illustrating signals associated with the apparatus of Fig. 3; Fig. 5 is a plan diagram showing successive scans across a bar code; Fig. 6 is a state diagram associated with the pattern detecting circuitry of Fig. 3; Fig. 7A is a flow chart showing in a general way the sequence of operations of the state means of Fig. 3; Fig. 7B is a flow chart schematically illustrating the sequence of operations of the microprocessor of Fig. 3; Fig. 8A is a block diagram which schematically illustrates the code scanning system shown in Figs. 1 to 7; Fig. 8B is a block diagram which schematically illustrates an alternative embodiment code scanning system in accordance with the present invention; and Figs. 9A and 9B are block diagrams of information processing portions of the alternative embodiment system shown in Fig. 8B. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Referring to Fig. 1, it illustrates a scanning means employing a source 10 in the form of a laser beam producing through lenses 12 and 14, a narrowly focused coherent beam of light. Lens 12 can be axially shifted by a galvanometer 98 which is part of a dynamic focussing system, described in further detail hereinafter. Briefly however, larger objects scanned by this system appear closer to the scanner while smaller objects appear further away. By dynamically focussing with lens 12, relatively fine bar codes can be clearly examined by the scanner. For example, for code resolution of 0.01 inch, object size is measured by quantizing its size into three inch zones. For each zone transition, lens 12 is axially adjusted 0.001 inch. Of course the specific dimensions applicable in other embodiments will depend upon the specific of the optics employed. -7- The beam is reflected by mirrors 16 and 18 and passes through aperture 20 in beam splitting mirror 22. The beam is thus directed to the periphery of a deflecting means, shown herein as a rotating mirrored wheel 24. Wheel 24 has twelve, peripheral, mirrored facets, each acting as a rotating mirror. Wheel 24 is driven by a motor (not shown) that determines the scan speed of the laser beam. After reflecting from wheel 24 (and depending on the angle of the reflected beam) , the beam is then reflected from one of the faces of a pair of non-coplanar mirrors, shown " herein as first and second contiguous mirrors 26. These mirrors 26 are in the shape of a folded mirror having an obtuse angle facing wheel 24. Accordingly, a beam deflected by wheel 24 can traverse the peak of mirrors 26 and be reflected right or left to intercept either mirror 28 or 30, respectively. Depending upon which path is taken by the laser beam, one or the other branches of "X" pattern 32 is produced. As illustrated by returning rays 34, light may return along the original path of the outgoing laser beam and be reflected again onto mirror 30 (or mirror 28) . Thereafter the returning laser light is reflected by mirrors 26, 24, and the reflecting side of beam-splitting mirror 22, before reaching a collector lens 36. The light thus collected is focused by lens 36 onto sensor 38 to measure whether a dark or light interval is being scanned. The foregoing describes the path for one scan of half of an "X" shaped pattern. The same principles apply to the functioning of the other half of the pattern. In operation, the mirrors are used to split the single scan line into two parts. As the mirror wheel 24 rotates at high speed, beam handling mirrors 26, 28 and 30 cause two lines of the "X" pattern to alternate rapidly. For example: five facets of the mirror wheel at a slow speed would appear as "\ / \ / \"• When projected at high speed, the "X" pattern becomes visible. The scan head of Fig. 1 will be supplemented with additional mirror systems to produce three "X" patterns and each will have separate processing electronics of the type described hereinafter. Accordingly, only one "X" pattern need be processed by one circuit. In this preferred embodiment, mirrors 20, 26, 28 and 30 are twice replicated, so that three mirror systems are placed at positions spaced 90 degrees apart. By using three lasers, three separate "X" shaped scans can be produced. Figs. 2A and 2B show three scans "X"I, "X'-II, and "X"III produced by three optical systems each as shown in Fig. 1. In a preferred embodiment, the line of an "X" shaped pattern has a length terminating at A and B, for the usable length (80% efficiency) and effective line length, respectively. These two lengths are for objects placed at 28 inches from the scanner. The terminus C represents the total physical line length for an object placed at 42 inches from the scanner of Fig. 1. The spacing LI in the direction of travel, between scan "X"I and "X"II, is 2 3/4" in the preferred embodiment. The effective length L2 of scan line A along the direction of travel is preferably 6 2/3". The length L3 in the direction of travel is about 16". In this embodiment, the pattern to pattern spacing wi between "X" patterns in a direction perpendicular to the direction of travel is 4 2/3". Preferably, the usable width W2 along a conveyor would be 16". The cart signal is derived from start and end cart photoeyes 40, 41. In this embodiment, cart photoeyes 40, 41 cover an optical path which when interrupted by an object moving in the direction of travel, produces a signal indicating the need to commence scanning. The spacing of photoeye 40 from endpoints B of patterns "X"II and "X"III (spacings Ml and M2) are set to ensure complete scanning of the coded object. It will be appreciated, however, that all of these dimensions can change depending upon the size of the code and the relative uncertainty of the placement or distance of the object or the code on the object to be scanned. A typical scanning system will employ a mirror wheel with the mirrors on two adjacent sides used to produce the other two "X" patterns in Fig. 2. By using two "X" scanners, a conveyor can be covered with six "X" patterns, and a scanning zone is created to ensure that bar codes located on products travelling the conveyor will be intercepted by one or more of the scanning lines. As shown in Fig. 2B, the scanner can be contained in housing S and supported by bracket BR mounted on platform P above working surface W. For a large spacing between platform P and work surface W, there is a large depth of field required for laser focussing. Accordingly, the height of an object is determined by the zone detector Z. Relatively small objects will not intercept any of the beams associated with photoeyes Z1-Z7. The next larger class of objects will intercept the beam associated with photoeye Zl. Successively larger objects will intercept the beams of the other photoeyes, the largest object intercepting all photoeyes. Zone detector Z produces in response a digital signal indicating the number of zones intercepted. The zone to zone spacing depends on the fineness of the bar codes being examined. For example, an interleaved 2 of 5 bar code with 0.01 inch minimum bar would require the photoeyes to be placed three inches apart from each other. If the code had a minimum bar size of 0.02 inch, the photoeyes would be placed five inches apart. Referring to Fig. 3, a registration means is shown herein as microprocessor board 42 which, in this embodiment, employs a microprocessor chip such as a type 80286 manufactured by Intel. Microprocessor board 42 is shown coupled to three data means: data means 44 and 46, the third data means being more elaborately illustrated. The third data means is the balance of the system, excluding blocks 42, 44 and 46. In this embodiment, microprocessor board 42 has its own internal memory. In addition, each data means includes a common memory means shown herein as dual port, random access memory 48. Memory 48 has one port constituting data bus DA and address bus AD, both buses coupled between microprocessor board 42 and common memory 48. The other port comprises data bus DATA and address bus ADR. The dual port memory can be a high speed RAM (SRAM) having one kbyte (type IDT7130) . It will be noted that the buses DATA and ADR allow the automatic updating of code data and string qualifier data into RAM 48 without the intervention of microprocessor board 42. This frees microprocessor board 42 and allows for a very high speed update of code data without being limited by the speed of board 42. A counter 50 is shown connected to clock input CLK to count it. Counter 50 has a capacity and speed determined by the desired resolution and scan speed. As further described hereinafter, counter 50 is enabled by terminal CART*SCAN during a scan, after an object is detected by the cart photoeyes (elements 40, 41 of Fig. 2A) . The count is determined just before the counter is cleared by the transition signal on terminal DEC2. The count accumulated in counter 50 is loaded into the first register 52A, an eight bit data latch, by the transition signal on terminal DECl in synchronism with the clock input on terminal C K3. Register 52A is cascaded with registers 52A and 52B which are interconnected to shift data from register 52A downstream, that is, to registers 52B and 52C. The data loaded into register 52A are compared to an upper and lower limit through limit devices 54A and 54B, respectively, to signal an out-of-range condition. Second and third registers 52B and 52C each have their outputs connected to separate inputs of multiplexers 56 and 58. The output of multiplexer 56 is applied to the data input of a quantizing means which is shown herein as a programmable read only memory 60, organized to act as a look-up means. Memory 60 is actually composed of six sections. Each section responds to the common data input to produce a signal which signifies a tolerance limit. The limits are three pairs each centered about a nominal value with a predetermined tolerance off that nominal value. The three nominal values are the input value multiplied by one, one-half or two. As explained in further detail hereinafter, these tolerances around the nominal values, allow comparison of successive latched values to determine whether successive scanned intervals are the same, greater or less than the proceeding interval of the code. The three pairs of data limits of the look-up means 60 are applied to separate inputs of a comparator means 62. Comparator means 62 has six digital comparators that compare the output of first register 52A against each of the six limit values from memory 60. Accordingly, the recent, output of first register 52A can be bracketed (or found not to be bracketable) within limits established by memory 60 as a function of the earlier values (stored in either second register 52B or third register 52C) . The bracketed values are indicated by the six output lines of comparators 62. The outputs of comparators 62 are applied to a pattern means shown herein as pattern detecting machine 64. In a preferred embodiment, pattern detecting machine 64 includes a XILINX logic configurable array type XC2064. This array is a 68 pin CMOS programmable gate array. Such an array allows implementation of a substantial amount of logic in one integrated package. This high speed circuit is able to detect bar widths as small as four hundred nanoseconds. As described in further detail hereinafter, pattern means 64 is a nine state machine whose state is determined, in part, by the inputs from comparators 62. The other terminals of pattern means 64, CODE, WRXN, CNTZ, XTNDEC, SCAN, CLK and DEC, correspond to: the state of the optical scan (light or dark) , the end of a scan, a clocking event, an extended pulse synchronous with a code transition, the start of a scan, the clock pulse and a non-extended code transition signal, respectively. Pattern machine 64 provides a pair of outputs to control the state of multiplexers 56 and 58. The control signal of multiplexer 56 is also connected to one input of memory 60. An important feature of pattern means 64 is the register means 66. In operation, the logic array of pattern means 64 can set certain data bits. As explained hereinafter, the successive bits detected in a scanned bar code are stored by the pattern means in register means 66 before being transmitted to dual port memory 48. Pattern means 64 produces outputs on five control lines 68 to a state means 70 having a logic array similar to that of pattern means 64. In addition, in this embodiment, state machine 70 (operating as a control signal state machine) employs three programmable logic arrays (PALS) to enable the various other devices illustrated herein. Control is effected over control lines 72. The three PLD's in state machine 70 include one type PAL16R6 and two type PAL16L8 devices. The type PAL16R6 device is an array with registered outputs that is used to generate twenty-three different states that are synchronous with the system clocks. These states are coded by five binary bits that are the outputs to the combinational logic. Two type PAL16L8 devices are used here to implement the combinational logic based strictly on the state that the state machine 70 is in. The outputs are a function of only the current state. Thus, this design may be deemed a Moore machine; that is, the outputs are dependent on the previous input history as held in this state, but are not directly affected by input values. For this reason, a totally synchronous control circuit is used to insure freedom from timing problems. Control lines 72 include four inputs to dual port RAM 48. Enabling signals are also provided along lines 72 to empty means 74. Means 74 includes a counter and latch so that the total number of bad scans as read on terminal BAD SCANS can be written onto data line DATA. A position means is shown herein as label position counter 76, a latched counter enabled by control lines 72. An input is provided from state machine 70 along line 72 digitally signifying the position where the valid scanned code ends. The count stored on counter 76 can be written onto bus DATA. A scan means, shown herein as scan number counter 78 is incremented at the start of each scan and enabled by line 72 from state machine 70. Means 78 is latched so its count can be written onto data bus DATA. The length of the string stored in register means 66 is loaded by state machine 70 into string length counter 80. Counter 80 also provides the facility for counting the consecutive number of transitions where the ratio of interval widths is one. Counter 80 also has a data output to data bus DATA. A narrow means is shown herein as latch 86, which stores the data outputs from multiplexer 58. As will be explained hereinafter, the value stored is a value corresponding to the width of a narrow interval as measured by counter 50. The output of narrow means 86 is coupled to data line DATA. An address means is shown herein as string data counter 82 and low string qualifier counter 84. The outputs of counters 82 and 84 are connected to address bus ADR to indicate a location in dual port RAM 48 where data is to be stored. String data counter 82 is used to point to a location for storing the code bits of register means 66. Counter 84 is used to point to a location in RAM 48 for storing the counts of counters 74, 76, 78 and 80. A focussing means is shown herein as latches 85 coupled to zone detector Z (Fig. 2B) and galvanometric focussing device 98 (Fig. 1). When interrogated by microprocessor 42, means 85 transmits a signal corresponding to the highest zone number intercepted by the object carrying the bar code. When a focussing number is transmitted by microprocessor 42, a latch (not shown) in means 85 is set. This setting is converted by a digital to analog converter (not shown) to an analog signal that drives the galvanometer in focussing means 98 (Fig. 1) . Accordingly focussing of the laser is accomplished under processor control. To facilitate an understanding of the principles associated with the foregoing apparatus, its operation will now be briefly described. With laser 10 (Fig. 1) illuminating mirror wheel 24, the "X" pattern 32 is traced. Reflected light and dark bars of a code that fall within "X" pattern 32 are reflected back to photo detector 38. As shown in Fig. 5, successive scans from one branch of "X" pattern 32 can traverse bar code 86 to produce a code signal. Referring to Fig. 4A, the previously mentioned clock signal CLK is shown as a number of high frequency square pulses. The response of photo detector 38 in the scanner of Fig. 1 is indicated as the output CODE in Fig. 4A. A D-type flip flop (not shown) is triggered by the clock input CLK to hold the data indicated by signal CODE. A synchronous code signal is indicated as signal SYNCODE in Fig. 4A. The signal SYNCODE is combined with the clock signal CLK to produce a single pulse DECl which begins at the rising edge of signal SYNCODE and ends one clock pulse period later. A following pulse in signal DECl is produced in a similar fashion following the falling edge of signal SYNCODE. Transition signal DEC2 is a pulse delayed by one clock pulse period from signal DECl. The relationship between signal CODE and transition signals DECl and DEC2 are shown on a larger time scale in Fig. 4B. Referring to Fie f . 3, a code transition causes terminal DECl to latch the current count of counter 50 into register 52A. One clock pulse period later, the pulse on terminal DEC2 clears counter 50. Thus, at each code transition a new count* is stored and then cleared so that a subsequent interval can be measured. It will be noted that any values stored in registers 52A and 52B are first transferred to registers 52B and 52C, respectively. Therefore between successive transitions, counter 50 counts the width of the interval detected by the scanner of Fig. 1. After each transition, the counts then ripple through registers 52A, B and C. Thus, registers 52A, B and C can be considered snapshots of the last three interval widths as determined by the scanner of Fig. 1. Once register 52B has been loaded, a comparison can take place. Initially, register 52B is connected through multiplexer 56 to memory 60 to generate six outputs: the input multiplied by 1/2 -20%, 1/2 +20%, 1 -20%, 1 +20%, 2 -20%, 2 +20% (0.4, 0.6, 0.8, 1.2, 1.6 and 2.4). These values are used to determine if the previous count in counter 52B is about half, equal or double the currently latched count in register 52A. Thus, the memory 60 is used to set a 20% window or tolerance around each value. The bottom line (Counts) of Fig. 4B, and Table 1 illustrate how the counter values latched into registers 52A, B and C are stepped through the registers so that bars can be compared to bars and spaces to spaces. Using scan 2B of Table 1 as an example, register 52B would contain a count of 19. The outputs of memory 60 would then be 8, 12, 16, 24, 32 and 48. Th value in register 52A is compared against the value of register 52B in this case a first bar (IB) is compared against ' a first space (IS) . The eighteen count value of register 52A falls, therefore, between a pair of values from memory 60, namely, 16 and 24. In response, the states of comparators 62 would indicate this bracketing to pattern means 64. It will be noted that a bar is compared to a space only in the initial phase when insufficient data is available to compare like intervals. Comparing like intervals is more desirable since in practical embodiments of printed bar codes, the width of bars will tend to be equal as will the width of spaces. But bars and spaces will not necessarily have the same width. 42 38 42 The pattern means 64 determines what binary values should be loaded into the code pattern register 66 in response to the six outputs of the comparator 62. Regardless of the width of the first interval, a zero is initially written into register 66, -20- designating the first bar as a zero. The first interval would be subsequently defined as a one by pattern means 64 if the following space was half the value. After the next bar is received, the data is shifted in registers 52A, B and C, in response to the transition signal on terminal DECl. Thereafter, the value of register 52C can be compared with the value of register 52A. This process enables bars to be compared with bars and spaces with spaces. After each comparison, the pattern means 64 determines from the previous state what to load into register 66 (either a zero or a one) . A zero represents a narrow bar or space and a one indicates a wide bar or space. When eight bits of information are shifted into register 66 (creating a byte) , the information is written into the dual port RAM memory 48 by the state means 70. In the example of Table 1, the first byte written is 02 (hex) . The second byte is 33 (hex) . Fig. 6 illustrates the pattern detecting algorithm of the pattern means 64. The machine is a synchronous state machine. A bar or space is compared to an adjacent or alternate bar or space. If the ratio is either equal, half or twice (within tolerances) , then a valid pattern is found. A pattern is invalid if none of the above comparisons are true (nothing is stored for invalid patterns) . If the number of consecutive valid ratios exceeds five (up to eight) the numerical representation of these patterns, that is a binary string of ones and zeros, is saved in memory. Because of the nature of the algorithm, the pattern detecting means 64 is highly fault tolerant. A variable error margin set by memory 60, is incorporated with the digital comparator circuit 62 to allow more flexible comparison of the width of bars and spaces. Because of this comparison, it is possible for a bar to vary from another bar by a large percentage and still be recognized as part of a valid pattern. In most cases, a bar is compared only with a bar and a space only with another space. This is important because most bar code label printing is breached, causing the width of the bar to vary considerably with the width of the space. As shown in Fig. 6, the pattern means 64 (Fig. 3) has a total of nine unique states, labelled A-I. Pattern means 64 operates on an asymmetric clock identified as terminal XTNDEC (Fig. 3), a pulse generated on each transition between intervals and extended for five clock cycles. The operation of the pattern means 64 can be divided into two halves because only one half of the machine is active at any instant, either the left or right half. Fig. 6 clearly shows the two halves being symmetrical. The left half consists of states C, E, G and I while the right half contains states B, F, D and H. The right half of the pattern means 64 is used if the first bar scanned is determined to be narrow. Otherwise, the left half is active. The function of each state is described below: State A: Power-on State. Also occurs if comparison is equal in this state or if any undefined comparison occurs. State F: Comparison is twice in state A, state B, or comparison is equal in state H. Also, comparison is twice AND WINDOW is low (i.e.: no string of more than four transitions is found, no data stored) in state D or state C. State D: Comparison is twice in state F or comparison is equal in this state. State H: Comparison is equal in state F or comparison is half in state D. State B: Comparison is half in state H or comparison is equal in this state. State G: Comparison is half in state A, state C, or comparison is equal in state I. Also, comparison is half AND WINDOW is low (i.e.: no string of more than four transitions is found, no data stored) in state E or state B. State E: Comparison is half in state G or comparison is equal in this state. State I: Comparison is equal in state G or comparison is half in state E. State C: Comparison is twice in state I or comparison is equal in this state. ZOUT: The signal ZOUT is the output signal from the state machine. A "one" will be shifted into the shift register for a wide interval, and a "zero" will be shifted in for a narrow interval. (A "one" means a wide interval.) In addition to the functions described above, the LCA of pattern means 64 also contains several timing signals to load counters and store data. TABLE 2 State machine 70 (Fig. 3) writes latched data bytes from various registers into dual port RAM memory 48. This memory is accessed at the same time by microprocessor board 42 which permits high speed operation. While the state machine 70 stores the current data from the present scan in port ADR, DATA, the stored data from the previous scan is read by the microprocessor board 42 at the other port DA, AD. Referring to Table 2, on each scan, one or more bytes of data indicating bar and space widths can be obtained. After the scanned width data are written onto bus DATA, the data in the latches and counters connected to bus DATA sequentially write the indicated string length, narrow value, label position, and the number of bad scans. For example, the third scan produces two data bytes indicating the code pattern of narrow and wide bars and spaces. The string length, however, is only fifteen bits long, indicating that the last byte has only seven valid data bits. For this scan, the narrow value stored by counter 81 is 99 which compares properly with the narrow value of the prior scan, scan number two. Similarly, the label position from counter 76 is 50 which compares properly with the prior label position value. In this embodiment, the data bytes indicating the interval widths are stored between location XF00 and XF1F in the dual port RAM 48. The maximum that can be saved is thirty-two bytes (i.e. 256 transitions) . The following block in memory is the string qualifier data. This block includes the narrow value, string length, label position and number of bad scans. The string qualifier data is stored between memory locations XF20 and XFCl. The output from counters 74-81 are "tristated" so that only one uses the bus DATA at one time. Referring to the flow chart of Fig. 7A, it shows the sequence of operations of state machine 70. When initialized, state means 70 starts at step SI (Fig. 7A) . Loop I starts with a branching decision. If a transition occurs (signal DEC) and the scan is not over, branches SI and S2 transfer control to steps S3 and S4 so that a byte of values indicating a bit pattern of bars and spaces is loaded into memory 48. The string data counter 82 which points to the appropriate address is incremented. If at the next transition all scanning is completed, then loop II is executed. In loop II, the state machine 70 successively stores bytes of interval pattern data and then increments the address pointer. Steps S5 and S6 are essentially the same as previously described steps S3 and S4. In the following steps S7 and S8, the string length of counter 80 is written into memory 48 along data bus DATA. String qualifier byte counter 84 is incremented. Next, in steps S9 and S10, narrow value latch 81 is loaded into memory 48 along data bus DATA. The string qualifier byte counter 84 is incremented to indicate the next position. In steps Sll and S12, the value in label position counter 76 is loaded along bus DATA into memory 48 and counter 84 is incremented. In steps S13 and S14, the bad scans counter 74 is loaded into memory 48 along bus DATA and counter 84 is again incremented. If the scan has ended, loop III is executed so that the scan number stored in counter 78 is loaded into memory 48 along bus DATA to the address indicated by counter 84 which is then incremented. The actual control signals for registers and memory interface are implemented in the state means 70. The function of various timing events are described below: WINDOW: Indicates a save of the current string. This occurs if the minimum string length of five is exceeded. This signal resets at the end of the string. SAVSD (L5) : Indicates a byte of string data was saved. This occurs when the eight-bits shift register is full or when the string is ended. SAVALL (L3) : Indicates all data was saved (i.e.: string data, string length, narrow value, label position, and the number of bad scans) . This signal is active if the string is ended. SLEQCR (LI) : Determines whether the String Length Counter 80 is loaded with a "1," or the number of consecutive equal WIDE/NARROWS. It chooses a "1" if the string is ended or no string is being saved. It chooses later if the comparison to a wide is twice or comparison to a narrow is half AND the current string is not being saved. LDSLC/ (L2) : Synchronous load of String Length Counter (SLC) . Occurs if the current string is being saved or if the comparison is JUNK. LDEQ/ (L4): Synchronously loads a "1" into the Consecutive Equal Counter (CEC) . Occurs if the comparison is not equal. JUNK: Occurs if the comparison is not half, equal or twice. It also occurs if the bar/space width exceeds the preset limits. SELREG2 (Mux_sel) : Selects register 52B or register 52C for an adjacent or alternate comparison, respectively. It chooses the adjacent comparison if in state A and comparison is JUNK. It chooses later if comparison is not JUNK. Because the state machine 70 is arranged as just described, each state either proceeds to the next state or does not change. Also the next state is always a new state and never a previous state. This ensures that within one iteration, no state can be active more than one time. Referring to Fig. 7B, it shows the operation associated with the microprocessor board 42 of Fig. 3, when scan data is available. The flow chart in Fig. 7B is executed starting at S20, to read the scanned data bytes. Next in step S21, the string qualifier data is read: the scan count number, the string length, the narrow value, the label position and the number of bad scans. Next in step S22, the microprocessor determines whether the latest scan is equivalent to the earlier scans in label position value and narrow width value. If it is not, control returns to step S20; otherwise, control is given to step S23. In step S23, the microprocessor shifts the latest bit pattern with respect to prior bit patterns to see whether there is a matching subinterval. If there is, control is shifted to step S24; otherwise control reverts to step S20. steps S24 and S25 are executed to store the reconstructed string. If the reconstructed string is sufficiently long, the microcomputer indicates that a complete and valid code has been assembled. This valid code once assembled, can be used in a conventional manner. It will be appreciated that various modifications and alterations can be made to the apparatus just described. For example, while three "X" patterns are illustrated, a different number can be used. Scanning geometries other than an "X" pattern may also be used. For example, a single line may be used if the code passes through the line at a shallow enough angle. A circle may be used if the code is constrained to the circumference of a circle. Two or more intersecting line segments may be used if the code passes through at least one of them at a shallow enough angle. Any of these scan patterns may be rastered to increase their area of coverage. The arrangement and use of mirrors can be altered depending upon the desired mode of slewing the laser beam. While the comparison between data strings is conditioned on having corresponding label positions and narrow values, in other embodiments different comparisons or no comparisons may be employed. The tolerance placed on the ratios of current to former interval widths can be varied depending upon the expected accuracy of the printed codes. While optically-readable printed labels are described, it will be understood that other media such as magnetic media may be employed instead. The illustrated digital circuits can be composed of larger or smaller scale integrated circuits without departing from the scope of the present invention, and can be composed of arrays as shown or may in some embodiments employ another independent microprocessor or digital signal processor. Also the speed and the dimension of the scan can be altered depending upon the particular application. It is even possible to alter the sequence in which various steps are performed. For example, Fig. 8A schematically summarizes the system earlier described in conjunction with Figs. 1 to 7 of the drawings. Thus, a scanner 100 is provided for optically scanning the machine-readable code, providing electrical signals for further processing. Such processing includes the development of specified counts, at 101, followed by the compression (i.e., conversion) of data into digital form, at . 102. The compressed data is then shifted and matched, at 103, to recreate the scanned bar code (from discrete portions which have been read). The reconstructed bar code is then decoded, at 104, providing the desired output. Thus, by means of digital comparison, a complete bar code can be reconstructed from two or more discrete fragments as previously described. Fig. 8B shows an alternative sequence of steps for scanning a bar code. Once again, a scanner 100 is provided for optically scanning the machine-readable code. This is again followed by the development of specified counts, at 101*. However, unlike the system of Fig. 8A, the system of Fig. 8B then operates to shift and match the scanned data, at 105, based upon the counts which have been developed, to reconstruct the bar code. The reconstructed bar code is then decoded (compressed to digital form and decoded), at 104', providing the desired output. Thus, a complete bar code can in this case be numerically reconstructed from two or more discrete fragments. Further detail regarding this alternative technique for reading machine-readable code is provided below. Scanning (at 100) of the machine-readable code is accomplished in a manner which substantially corresponds to that previously described in connection with the system schematically illustrated in Fig. 8A, or using some other appropriate scanning pattern, so that "slices" of the bar code are read by the scanner as the bar code passes the scanner. Generally, no one slice will contain a complete bar cede, and a plurality of slices will have to be processed to reconstruct the complete bar code. To this end, the scanner provides three output signals. A CART signal is provided to indicate that an object has entered the scan area. A SCAN signal is provided at the beginning of the scan pattern, and is discontinued at the end of the scan pattern. A CODE signal indicates black and white areas within each scan. These signals are then applied to.the pulse-counting portions 101' of the system. During each scan, pulse width counts (PWC) are generated to represent the widths of the black and white sections identified by the CODE signal. Each fragment (slice) of the bar code will therefore generate a plurality of bars (black) and spaces (white) , producing a succession of counts (for each bar and space) incremented at the system's clock frequency. To be noted is that these pulse width counts are generated in real time, as is preferred, although other implementations are possible (provided appropriate buffers are made available between the scanning operation and the subsequent processing operations which are described below) . In addition to the development of pulse width counts, an additional counter is started at the beginning of each scan (i.e., reset to "0") to develop an absolute position counter. During the scan, this counter is also incremented at the system's clock frequency, reaching a maximum value at the end of each scan. Thus, the absolute position counter functions to indicate the location of the pulse width counts collected during each scan. To this end, on each black to white transition, the content of the absolute position counter is latched to identify the transition position count (i.e., location), while on each white to black transition, the pulse width count of the previous bar, the pulse width count of the previous space, and the transition position count for the pair, are saved (in memory) for further processing. Transfers of pulse width counts and transition position counts to memory are done in real time making use of a DMA (direct memory access) process. An alternative approach to this would be to make use of a single, high speed counter which starts at zero at the start of a scan, and which counts to some maximum value at the end of the scan. The content of the counter would then be stored for each transition of the CODE signal, with simple subtraction of one value from the next serving to provide an accurate indication of bar-pulse-width counts, space-pulse-width counts, and transition position counts (for subsequent processing) . Following each scan, all data for the scan is processed to determine if one or more series of pulse width counts (strings) constitute part of a possible valid bar code. Any string which exceeds a certain minimum length meeting this criteria is stored in memory. This process is repeated at the end of every scan while the object to be scanned is in the scanning area. Between the end of this process and the end of the next scan, steps are taken to recreate the bar code in memory making use of the pulse width counts and transition position counts which have been developed. Referring now to Figs. 9A and 9B, the first step in this process is to check each string, at 110, to find a string which contains a valid beginning portion (start) or ending portion (stop) of a bar code, at 111. It is important to note that since this can be recognized whether the pattern is in a forward or a backward orientation, or anywhere within the string, a white area (so-called "quiet zone") around the bar code is not required. When a valid start or stop pattern is found, the corresponding string is used to form the first string of a "cluster", at 112. To be noted is that plural clusters may be started, and that a single string can lead to the creation of more than one cluster. Further to be noted is that since the strings of each scan are processed in the order in which they are transferred to memory, plural clusters may be processed in parallel. Upon the formation of a cluster, at 112, a valid middle portion of the first string is identified. The transition position count for this valid middle portion is then recorded and a range (plus/minus) is created. Following this, the next scan is searched, at 113, for a string which matches (test 114) at least part, if not all of the previous string in the cluster. To prevent a mismatch, only the part of the next string which falls within the transition position count range of the previous string is used. It is possible that no string from the subsequent scan will fit within the range which has been selected, in which case a string from the following scan will be analyzed. If after a few scans, no matching string can be found (test 115) , the cluster is discarded, at 116, and another is analyzed. The above-described matching process is summarized as follows. The strings of each scan are represented as a series of pulse width counts (i.e., bar, space, bar, space, etc.). The second string is shifted to each possible location within the calculated range specified for the first string. A comparison is then made between the pulse width counts for both strings in each possible location. To improve the accuracy of this comparison, adjacent bars and spaces are preferably summed so that a bar and an adjacent space create a bar/space pair while that same space and the next adjacent bar create a space/bar pair (and so on) , which are then used for comparison purposes. Alternatively, a bar can be matched to a bar, and a space can be matched to a space. In any event, as the data is relatively shifted and comparisons are made, the pulse width counts of both strings will eventually match (i.e., the pulse width counts will fall within an acceptable tolerance) , identifying a registered middle portion of adjacent strings (fragments) of a scanned bar code. To be noted is that it is not necessary to match the entire string, but only some middle portion containing at least a predefined minimum number of bar/space pairs. This allows for non-bar-code data on either end of the strings, eliminating the need for a quiet zone around the label. Once a match is found, the second string is added to the first (the cluster), at 117. To this end, the pulse width counts which match are preferably averaged together to create a longer string containing more of the bar code than either string would separately constitute. This string is then preferably decoded to identify at least a part of the bar code and confirm that the shift and match procedure was correctly accomplished. This process is than repeated for successive scans (loop 118) , each time creating a longer string containing more of the bar code being scanned. Eventually, a string will be added to the cluster which contains the end (stop) portion of the bar code, assuming that the beginning (start) portion led to the creation of the cluster, or the beginning (start) portion of the bar code, assuming that the end (stop) portion led to the creation of the cluster. When this is detected, at 119, a single string of pulse width counts containing an entire bar code will have been formed, and the cluster is closed, at 120. The final string is then decoded, at 121, to complete the reconstructed bar code. As a further test, at 122, additional strings from subsequent scans (if any) are preferably matched with the completed string to make sure that there is no overrun, and that the assembled cluster is in fact a complete bar code and not part of a larger bar code which has not yet been completely reconstructed. If an overrun occurs, the cluster is reopened so that a bar code of greater length may be decoded. Otherwise, the cluster is discarded, at 123. If no overrun occurs, the cluster is deemed complete and a valid bar code has been decoded. This same procedure is repeated, at 124, for each cluster which has been formed. Each identified cluster is either completed or discarded, as previously described. This allows for multiple bar codes to be decoded, and for another section of the pattern developed by the scanner (e.g., an "X") to again decode the same label. The foregoing operations contribute to various advantages in operation. For example, as previously indicated, no quiet zone is required on any side of the label. Rather, pulse width counts representing non-bar-code data on the ends of the strings are simply ignored during the shifting and matching procedure. This also has the advantage that even badly damaged bar codes can still be recreated. What is more, strings which are damaged can be salvaged if the section which falls within the transition position count range is nevertheless valid, otherwise the string is ignored and the next string is analyzed. It is not necessary that all partial strings be used to recreate a particular bar code. Another advantage is that multiple labels on a single object can now be decoded, whether or not the labels are of the same code type and/or length. The absolute position counter produces highly accurate transition position counts for each bar/space pair, ensuring valid string matches and allowing for separate bar codes as close as 0.25 inches to be decoded. Yet another advantage is that except for the initial scanning procedure, and transitional hardware necessary for the counting and memory transfer procedures, the above described system can be fully implemented in software. A computer program listing which implements the foregoing processing steps is attached as an appendix following this specification. This program is advantageously implemented in a RISC (Reduced Instruction Set Computer) processor, preferably that available from Texas Instruments under the model number TMS320C30, providing still further advantages in accordance with the present invention. In any event, it will be appreciated that various modifications can be implemented to the above described embodiment and that the foregoing shall be considered illustrative and that various modifications thereto will not depart from the scope and spirit of the present invention. APPENDIX J EFEEF FFFFF FFFFF J E F •J E F F J EEEE FFFF FFFF E F F J J E F F J.J.J FFFEE F F •.:>):**>.:>fc*****>..**#**^ PROCRΛHHER: Jeff Shirpe PF.SΠRIPTIOHΪ - t! DRX TECHNOLOGY tllTH DSP-THS 3?βC3β Copyright (c) 1991 Accu-Sort Systens, inc. All rights reserved. rhide "ronn.Jit" elude 'co .ext* FϋKCπOH: c_intβt() RFTURHB: DESCRIPTION: - _%/ c intβlO FUKCTIOH: c_intl2() RETURNS: DESCRIPTION: - / i c intf2() FUNCTION: c_int!3() RETURNS: KSCRIPTIOHi - %f j c_iι»tt3() ister int box; isier strpct hox_t*hle_struct IHox_fj * .< • or 2l8l ,st'); ~ It changed fron 2IHh XI _ti_.e..? r(box - If box < HAX OXES? boxH) )x_P - (struct box_table_struct t)(Kbor_ctbox])); f(box_p-.tx_tac_tiι.e ) «f) * ox_p-.tx_t*r_tjι.e--; if(box_p-Hx_tac_tiι.e =- §1 tx_code*.(box); -C xot 2itfh,sl a ); /» hjsgfd fron 2liih «/ FUHCT10H: c intHO -_-υι__rι_ un; - — — XI ■ \-\ union elpftent cnjon tp?, *start_data, Ip3, *end_dataj ster int index, count, len, nlen, leg, Ipl, old_scan_index, stat_reg_vai; :<-χ sc< * n_ , itruct (Jscan_struct_p); - ( int t)HF.H_HAP_PF.R]F_BASF.; /*__-dM global control disable XI Uβxβ) = DHA. DISABLE; /f__-read in status_register xl/x? XI t_ιeg_val =- ϊ(i nt ~ ϊ )STATϋS_REC; /t__-save ending dna address tl it - (union elenent.union tXKpl.lxϋ ); /t__-?ave starting in* address, tl it. data - (union elei.ent_union t)((int)end_data k (int) (DHA_START .Ol._i.ASK)) ; /t_,-dpteπ.in which half of Ik block of internal ran gets It the dna data on the next scan tl /* -flag light off / <(' and βfaf ,iof ); Uast.x " <si*t_reg_val fc till)) (first.flag « •)) rtC nr Mlh,iof); It flag light on tl ror_int_M - Xt_X2_SAHE; t_x * (slal_reg.val & Bill); ( last.* '= •> /l__-get ne« ύnt starting address leg IS/ Hi i) - DKA_START~ADD_X1; (head == X) eg - I- se f(head ~* SϋPER_X) leg = ((stat.reg.val i βx7l)/U) - 2; Ise if(head == H_55) leg - I; /*__-get nev dna starting address leg it pt.βxA) = DHA_START_ADD_X2 if(head !- SUPER_X) )eg = β? else leg = ((siat_reg_val J> βx71)/J6) - ?; /» -init dna registers tl ■HfixR) = DHAJ.fi.lNTF.R , RF.t; It dna transfer counter register */ n t x - _ _; ena e na t_r(.(»HA_FNABI.F._HASK); / !.*_int_enab)e .ask tl /t__-enable interrupt irβ for dna tl Λ(' or rβ,ie')? (fjrsi_f ) i»5 ~ 1 ) /* - j f first scan init for nee read cycle tl irst_flap - β; se /ϊ__-save only the scans that have 1 or nore strings over ix " _ KIH.TRANSJ-ENCTH and turn on flag light */ en = end_data - start_data; fden ) 52B) len ** len; filen - nlen; f (len )= HCN RAHS.LENCTH) le tf-! »can_struct_p - (struct scan_struct t){4(Ieg_sCleg]tscan_indeχ[leg]3 )) ; -.can_ιtract_p-><.can_nuι. = scan_countClegl? p2 ~ (union elenent inion l)scai_stn_ct_p->elei.ents; .?-)a)J = β; •?.t*1 fi3 - !i2} count * = I; for(index - 0; index (lea ; indeiΗ) if ( (start data-)fteH.i.ar ( HIH.COUNT) !! ( start data-)fjeld.spare < KIN COUNT) ) ( if (count ( H(N TRANS I.EHCTH) C λ=p3? start.datao; } else f *-*( • or Mlh,iof); It flag light on / if (nlen == I) nlen - I; nlen «= nlen ♦ count; if((ttarl_data-)field.bar I' D I! (start.data-)field.space .«-§)) { Ip2 -■ tttart_data; pλ-)fJeld.open_type » •; P2* nlen**; .1 tfii- p3'?2; start_data-i; } else { Jp2 - tstart.data; p?->f)pJd.open_type = ft; εtart.data - if((p?-)f)eJri.rel_pos . « * tart_data-)field.rel_pos) ) { if(pzr-tl.field.rel_po « i == «) C P?-)fie)d.re)_pos = staτt_data->fie)d.rel_pos - (slart_.dataU3.field.rel.pos - start_data->field.rel_pos ) ; } else if(( « -t*r._dala->fie ) d.h*r < HIN.COUNT) i! (slart ' data-. field. space < HIN.COUNT)) C p2->field.rel_pos = p2C-U. field. rel.pos ♦ (p2r-π. field. rel_pos - p2r-?3. field. rel.pos); } else C p2-)fieJd.re._pos field. rel.pos ♦ (( la-)field rel_pos - p2C-13. field. rel.pos)/2); J ) f.2-H; counto; ifUnlen < count) ) (HAX ELEMENTS -?)) C index = len; βrror_int_«4 = SCAN OO.LQKC; ) ) ) if (nlen >= HI RAHS.LEN TH) old_scan_index - scan.indextlegl; • ϊcan.indexClegl ♦►; It index into leg_«. array tl if (scan.indexClegJ >= HAX .SCANS) sran ndexDeg] <■ I; It urap arround tl if (scan.indexUegl -= proc_scan_indexIleg3) It field. space for new data ?? tl { scan.indexClegl = old.scan.index; It throit auay new data 1/ error ' nl.M = FtHI .SCANS; " ) • -.can.-.truct.p-Hen = nlen; scan_struct_p->depth - gdepth; f.ran_siruct_p->tac.tiι.e = tar.tine; ) can.countClegl H; It increnented every scan tl (legX2) isnC or 8Mh,iof a ); It cart light on *7 se asnC and lfbh,iof ( ); IX cart light off tl FUNCTION: c_intl5() RETURNS: " PFSCRIPT10H: - XI d c_intl5() FUNCTION: c.intltiO RF TURNS: DESCRIPTION: - XI d c intiάO FUNCTION: c_int!7() RF TURNS: DESCRIPTION: - XI d c intl7() FUNCTION: c.intlβO RF TURNS: DESCRIPTION: - XI d c intlβO FUNCTION: c.intKO RETURNS: DFSCRIPTION: - tl d c intl?(J FUNCTION: c.intlK) RETURNS: DESCRIPTION: - XI i-c_intll() RFTURNS: OI-TSΠRIPTCDHS - il ; r jntHO . .. - . . . -. ^ User Names JEFF <") Queues ~ . ~ ΕR4 PRIIΓTO_-6 * ' File aples F'REPFϊf . C Server: S ER4 T * Ϊ. p fc i on s F : 'F* * EPROC - C BF.PTFMPFR :i v :l99fl 11:10 an >}:#*##:#>.::>.:>.:-*:$::#: J FF.FEF FFFFF FFFFF >.:>.:>.:*:+.*.t_5t.rt.*.*..*>.: PPPP RRRR EEEEE F : 'F*-F : 'P RRRR 000 CCC CCC I * P R R F P P R R 0 0 C C C C P F * R R E P P R R 0 0 C C PPPP RFϊRR FREE PPPP RRRR 0 O C C P R R E P R R 0 0 C ... C P R R F P R R 0 0 C C ... C . C F * R R EEEEE P R R 000 CCC CCC -R:{c:{c:<c:{c:{c:{_:{c$:{<_«:ft:{{c$^ ♦ __ NAHE: preproc.c ϊ . ._ DATE: <.9/H/9β !__ PROCRAHHER: Jeff Sharpe t INSCRIPTION: - *...*/ t PRX TF.CHHOI OCY UITH DSP-THS 3?βC3β t Copyright (c) 1998 Accu-Sort Syβtens, inc. J All right", reserved. / intJude *roι.(..lJ(" include 'conn.ext' *__ X . FUHCTION: prtproc ϊ__ RFTURKS: t„ 6F8CR1P1I0K: - *-.*/ aid preprac(leg) at leg; truri sran.st ruct Iscan.p, tenp_ιιork_scan} truct elenent.struct telenent.p, ttenp.elenent.p; tract clβster_struct Jcluster i; trβct string.strβct tstring.p; trurt strfng ilrurt tenp.string, nni.string, teiφ iork.string, cβrrent.string} nan cluster.status ten .status; nt rJ ster.index, theck.code, box, i, decoded_good, len, done, j, owlajr.recover.count, overlay.recurce.count, x, scan.diff; nun aver y.responce overstates; nun boolean overlay.recover, c ster.is.old; bar rode rKAX_CKARS3; if(proc_next_εcan(leg, iteι.p_βtring)) /*__- there are scans to process 17 c sran.p = (struct sran.struct t)(l()eg_srieg][proc_scan_indexπegJ] ) ); /t__-get next string tl iihtle (getj-βxt itrxng (scan_p, ielenent.p, Itenp.string) ) jf( r Jesters startTIeg? .= dusters endClegJ) { cluster.tndex = clusters.startClegl} cluster p «■ (struct cluster.struct t)(l(leg c[legHcluster_index3))| do C c luster. is.old = FALSF j if( (clύster_p-)nuι»_strings ( KAX.STRIKGS) 11 (*5trtng_ftts_in_cluster(leg, elenent_p, duster.p, itenp.st ing, istring.p)) U ( (cluster is.old «= is.duster.olddeg, luster.p, string.p ) ) c = FALSE) U (cJuster.p-)status \- STATUS.UKKHOUH) ) IX -string fits into next cluster XI f lenp_«ork_string r duster.p-liork.stringj _. _ . _ . _ x(cluster_p-)Mork_s- i.len; x**) rk_scan,ele B entsCxϊ lι*-*ter_p-)t* * ork_scan.elenents [χ] ; (eBp_siatυs = r)uster_p->sl»tus; scan.diff • * ■ scan..p-)scan_nun - Jeg_sCleg][string_p-)index3.scan_nuB; a-ςtring_pt+; Jstring_p = tenp.string; uster _p->nun_strings<*; dverlay.recover - FALSE; ver y_recover_count - 8; overlay_recurce_count = β; do C nen.string = ien .string; /t__-tri« the string tl trindeg, scan.p, cluster.p, inen.string, elenent.p ) ; if(cluster_p-)string dir == FORyARD) f if((duster_p-)status = *■■ DECODEINC) kk (over .status != OVERLAY.RECURCE) ) { done - β; if(cluster p->rhange rel pos == HAX CHAHCF REl PUS) i' else Hhi)e(((neM_string. start - tenp.string.start) ( HIK.OVERIAY) 11 (done -* I) ) £ if((duster_p-> * * * ork_5can.elenent5 [ cluster " p-)eork " εtring.end ♦ KIK.HATCH jl.space ) HIH.COUKT ) ti (cluster_p-)«ork_scan.elenents [cluster~p->«ork~string.end ♦ HIH.HATCH jl.bar ) HIH.COUKT) ) t clu5ter_p->»ork_string.end.*; nβu.string » teitp .string; /.__-triι. the string tl trindeg, scan..p, cluster.p, Inee.string, elenent.p); if((duster_p->_.ork scan.elenents [cluster_p-)«ork_string.end * HIH.MATCH ♦ jl. space ) HIH.COUKT) kk (cluster_p-)eork sran. lements Ecluεler.p-leork.string.end * HIH.HATCH ♦ jl.bar ) HIK.COUKT ) It kk (scan diff ) l)J/ ) i". else } else done=l; 1 ) if ((nee.string. start - ten .string. start) < HIH.OVERLAY) neu.string. tart = tenp.string.start ♦ HIH.OΫERLAY; if((teRp_string.end - nev.string.end) ( HIH.HATCH) nee.st ring. end » tei.p_slring.end - HIH.HATCH; if((cluster.p-)status I- DECODEIHC) ti ( * inpd_s.rjng.ewi < ne*._stπng..5tart ) - 49 - ) C net._stnng.end = neu.string. start; ) ) pise £ jf((r)nsier.p->sia(us == DFCODF.IHG) kk (over. status != OVERLAY.RECURCE) ) . done = β; if (duster p-)rhange rel pos == HAX.CHAKCE.REI _POS) else j=t; «hi)p(((teBp_string.end - nen.st ring. end) < HIN.OVERIAY) kk (done «•= %) ) ( if( (dusipr_p->*_ork_sran.e)eBentsrcluster_p->i.ork_st ring. start - HIH.HATCH -jl. space ) HIH.COUKT) kk ' (cluster p-)«ork scan. eleι»ents[cluster_p-)uork. tring. start - HIH.HATCH -jl.ϋar > HIH.COUKT) ) ( duster_p->»ιork_st ring, start--; tiPK.stririg = lenp.string; /J -trin the string tl trindeg, scan.p, cluster.p, &nea_string, elenent.p); jf( (cluster.p- >work_scan.eleι.entsrrlu5ter.p->«ork string. start - HI ATCH -jjlspace ) HIH.COUKT) k (cluster_p->»ork_scan.βlenentsCcluster.p->»ork_βtring. start - HIH.HATCH -jl ' bar ) HIH.COUKT) IX kk (scan.diff > 1)1/ ) else doned; 1 else doned; J ) if((tenp_string.end - net._string.en-l) < HIH.OVERLAY) nev string.end = ten .string. end - HIH.OVERLAY; if((itt__βtring.start - ' tenp.string.start) ( HIH.HATCH) nee string. tart - tenp.string.start ♦ H1H HATCH; if((clusteτ_p-)staiκs ! = DEC05EIHC) kk (over.status != OVERLAY.RECURCE) kk (nev string.end ( nev.string. start) ) £ neu string. start = nee.st ring. nd; ) 7 cluster_p-)old_last_natch « cluster.p-)last.natch; jf((over status = overlay ( scan_p, Anee.βtring, cluster p)) *=TRUE) £ /l__-string overlays correctly tl /l " -if status = POSS.OPEH change it to OPEK tl if(dιιster_p-)status == POSS.OPF.K) . . . <_ . _ _ /J _-'if 1 a ~ c ' ■» call in.conpi.ufl7 /t__- j f last g. character ( last.natch «ake /$__ last.natch = last good character XI cluster o->avr t*c tine (cluster_p- )avr_tac_tine * scan_p- )tac_tine ) / 2; der_) i npar(leg, c luster.p , sran.p ); i f(overJ ay_recover - - TRUE) ( /♦__ re_overlayed last string , re.do current string */ iprip.st rj ng = d«ster_p->stringsrduster_p-)nun_5trings-π ; scan_p - &leg_sCleg]Ctenp ^ string. index]; denent.p = 4scan_p-)elenentsCtenp_string. tart]; overlay.recover - FALSE; over.status = 0VF.R1.AY_0FF_START_REC; ove l ay_recurce count - i; ) else r dusler_p-)old_«ork_string = tenp_work_string; cluster_p-)old_ι.ork_scan.scan_nun = tenp_nork_scan.scan.nun ; c ster_p-)old_ * _ork_scan.len * tenp_«ork_scan.len; for(r=fl; x( lenp.nork_scan.len; x+O duster_p-)old_Mork_scan.elenentsCχ] = tenp.nork.scan.elenentsCx ] ; ) } else C if ( over status == OVERLAY RECOVFR) t if((overlay_recover != TRUE) kk (ov-jr y " recover count ( HAX RECOVER COUKT)) £ overlay.recover - TRUE; overlay_recover_count»»; tenp.string - cluster_p-)strin|sCcluster_p->nun_stringβ-23; sran.p = *-leg_εNegJrtenp_string.index]; elenenlj ) - 4εcan_p-)ele«entsCtenp_string.start]; over.status = OVERLAY JFF.START.REC; } else { /t__ could not re.overlay last string, restore last st ring and scip.current string */ cluster_p-)«ork_string * tenp.eork.string; dusier_p- )eork_sran.sran_nun = tenp.nork.sran.sran.nun; dttster_p-)Nork_scan.Ien = tenp.vorfc_scan.len; fod ; x( tenp_i.ork_scan. len; ι** ) cluster_p-)«ork_scan.elenentsCχ] •* tenp_«ork_scan.elenentsCχ]; over.status = OVF.RLAY.BAB; tenp.string = cluster_p-)stringsCcluεter_p-)nun_strings-l] ; cluster_p->status = tenp.status; scan_p = ileg_sCl«g]Ctenp_βtring. index]; elenent p - 4sran p-)e)enentsTtenp string. start]; ) } == iovprJ<»y_reπ.rce_ro(int . HftX.K iKUh. uuilNJ £ /$__ could not re.ovei / last string, restore last string and scip.current string */ dustpr_p->*_ork_string = tenp_«ork_string; cluster_p->ι*ork_scan.scan_nun = tenp_work_scan.scan_nun; cluster. p->ι.ork_scan. len = tenp_work.scan.len; for(x=*; x< tenp_work_sran.Jen; IH) duster_p->t_ork_scan.elenentsCχ] = tenp_uork_scan.elenentsC χ] ; over.s tu*. = 0VERLAY.8AD; tenp_string = cluster_p-)stringsCcluster_p-)nun_strings-13; scan p = 41pg_sDeg]rtenp. tring. index]; pieι-ιpiιl_p = (.scan. -)elenents£tenp_string. start]; 1 else C overlay_recurce_counU*; ) ) /*__-over_si at us=OVF.RI.AY.OFF_START- retry with updated lt__ uork_string.end tl )«hile(<over_ ** tatus == OVERI.ήY_OFF_START_REC) !! (over_status « OVERLAY.RECURCE)); ) ( It -if string does not fit into cluster, should it lt_~_ be killed (is.cluster.old) $/ if(cluster_is.old) kiJJ.dusterdeg, duster p); ) /t__-try next cluster </ } vhile (get..next_clustβrdeg, 4cluster_index, iduster.p)); til] (his string open any neπ clusters tl .urrent.string = tenp.string; 10 cherk.rode = %- /f__-get free cluster tl ■hile ( (get.free.clisterdeg, iduster.p, 4string_p>) kk It free cluster tl (check code < (2NHAX CODE TYPES-1))) ) £ snitch (check_code) £ rase fl. /t__-I?5 FORUARD tl cherk.codeM; if(enabled_code_typesCI251 « YES) £ clusleτ_p-)open_type » 125; is.open.fordeg, cluster.p, scan.p, tenp.string, elenent.p, string.p); hreak; 3 case I: /I..-125 REVERCE tl check.rodeHj if(enabled code t esCI25] -- YES) ιf(enah)ed_rode_typesrc.?.8 == £ break; ) ■ - ■ 9 9: /t__-Cl?8 REVERCE tl che k_<:oden-; if(enabled code_typesCCt28] == YES ) £ break; ) ) } κhile(get.next_elenent(4e]enent_p, 4tenp_string )) ; /t__-update to next elenent, see if this new string /!__ opens any clusters / /«.__done proc. all strings in this scan return to idle * / roc_scan_indexCle l»»; f (proc.scan.indexClegl >= HAX.SCAHS) ror_sran_JndexfJeg3 - ft; -- /»___- f no neu scans to process, should any clusters /t__ be killed (is.cluster.rold)l/ f(dusters_startClegl != clusters.endCleg]) htster.index = rlusters.siartrieg]; :luster_p - (struct cluster.struct t)(4(leg_cCleg]Cduster_indeχ])); itring.p - 4(duster_p-)stringsC((clister_p-)nun_βtrings)-l)l); if(ts_cluster_rolddeg, cluster.p, string.p)) kill_rl«ster(leg, cluster.p); FUMCTIOH: proc.next.scan RETURNS: TRUE/FALSE sets up STRIHC.P for nee string PFSCRIPTIOM: -are there scans to process for current leg tl ι boolean proc_next_scandeg, tenp.stringj.) ister int leg; ist r struct string.struct ttenp_string_p; (proc.scan.indexClegl !* scan.indexClegl) It is there scans to process tl 'np_s(ring.p-) pror.sran.indexriegJ;/! init string for first string */ ?np_slιing_p-)end« * -1; * .«p_string_p->st..rt= ST P.UHKHOUH; .turn (OVERLAY.COOD); - ■ turn (πVERLAY. AD); FUHCTIOKt get_next_string c. usιer_ρ-.open_type = s; is_open_rev(leg, d- ter_p, scan.p, tenp.string, elenent_p, •string. , current_string); break; case 2: /t__-C3? FORWARD XI check.code. ♦; iftenable*. corte.typesCI.391 == YES) C break; ) r.--- ~i /I..-C3? REVERCE tl rheck_rode*<; if(enabled_code_typesCC3?] == YES ) ( break; ) case «.: /t__-CODF._A_BAR FORWARD */ check_codeH; tf(enabled_code_typesCCOϋE_A_BARl « YES) c r)tιsier_p->open_type = (.OOF._A.BAR; jε.open.fordeg, cluster.p, scan.p, tenp.string, elenent.p, string_p); break; ) case S: /»__-C0»E_A_BAR REVERCE tl check code..; if(enabled code.typesCC00E_A.BAR] " YES) C dusier_p-)open_type = CODF_A_BAR; is_open_revdeg, cluster_p, scan.p, tenp.string, elenent.p, string.p, current.string); break; ) case i: /*__-UPCEAN FORUARB tl check.code**; if(enabled_code_typesCUPCEAH] « YES) £ duster_p-)open_iype = UPCFAN; is_open_for(leg, cluster.p, scan_p, tenp.string, elenent_p, strtng_p); break; ) rase 7: /t_.-UPCEAH REVERCE »/ check rodeH; if(enabled_code_typesCUPCEAH] « YES) c duβter_p-)open_type = UPCEAH; is_open_rev(leg, cluster.p, scan_p, tenp.string, elenent.p, string.p, current.string); break; ) case fl; /l -C128 FORUARB tl _ . _ . start elenent_p DESCRIPTION: -get next string in current string Jl n boolean get_next_string(scan..p, elenent_p, tenp_string_p ) uct 5can_struct tscan_p; uct βlenent.struct )lelenent_p; uri string_sirurt ttenp_string_p; gister int index; gister struct elenent_struct Ipl; ile((ienp_strjng_p-)end ♦ 2) ( sran_p-)len) tenp_string_p-)end ♦ 2; 3elenent_p) = 4(scan_p-)elenentsCindeχ]); index*.; ?H<; enp_string.p-)end - --index; f((lenp_string_p-)end - lenp_slring_p-)start) >= (HIH VERI.AY » HIH.HATCH * ' ?.) ) return (TRUF); turn (FALSE); FUHCTIOH: string.fitβ.in.cluster RETURNS i TRUE/FALSE string.p BESCRIPTIOH: -does current string fit into current cluster tl Λ boolean string_fits_in_cluster(leg, elenent.p, cltster_p, tenp_string_p, string p) 1*1! ict elenent_struct telenent.p; act cluster.struct t uster.p; uct string.struct Itenp.string.p; ■rt string.strurt tlstring i; j t elenent struct -tls, lie, tcs, tee; U, ct; -.tring.p ) - 4 ( cluster_p->stringsC (( du5ter_p-)nun_strings)-l)]); = (leg_sCleglC(tstring_p)-)indeχ].tac_tine); - (struct el nent _struct *) (leg_sCleg]C(Sstring_p)-)indeχ].elenents); * 4lsC(tstring_p)-)endl; -■ 41sCUstring_p)-)starU; » Is • • 4duster_p- ) eork_sran.e ) enentsrrluster_p- ) last_natch]; Is = 4lsClast_string_p-startl; - 54 - * (]eg_sr.pgirieftp_«*irjng_p->. r- d_tar_t.ne); - (strud elenent.struct *) (leg_sCleglCtenp_string_p-)index].elenents); - 4csfienp_rtπng_p->end]; - 4csCtenp_string_p-)start}; ((ce-)rel oo ** < ls->rel pos - RROR.REI. POS - HAX_CHAHGE~REL_POS) !! (rs-)rp)_po«; > Je-.reJ pos < FRR R_REI._POS * HAX_CHAHCE_REL_POS) !! ((cl - U) > 1) ) pturn (FAISF.); IP (■turn (TRUE); FUNCTION: trin RETURNS: tenp_string_p-)start eJenent.p DESCRIPTION: -trin current string according to «ork_string Jl d trindeg, scan.p, cluster_p, tenp_string_p, elenent.p ) leg; uct scan_εtruct tscan.p; uct cluster.struct lcluster_p; uct string.struct ttenp.string.p; ri elenent.st uct telenent_p; r.p.start, nax_rel_pos.over; change.rel.pos, index; u sran.struct told.scan.p; uct elenent.struct tlast_elenent_p, lold_elenent_p; uct stπng_struct tstrinj.p; ring.p - 4(d(ister_p-)eork_string); d_scan_p = 4(cluster_p-)«ork_scan); .elenent.p = old.scan_p-)elenents; (cluster.p- )siaius « BF.COBEIHC) hange.rel.pos - (duster_p-)cn«nge_rel_pos ♦ ERROR.CHAHCE.REL.POS ) t (scan.p-)scan.nun - old_scan_p-)scan_nun); se tιange_re)_pos = HAX_CHAHCF..RF.I._P08 t (sran_p-)sran_nun - old_scan_p-)scan_nu ); (duster_p-)string_dir « FORBARB) _P_siart - o]d_e)enent_prstring_p-)end]. rel.pos - change.rel.pos - ERROR_REL_POS; f((d«ster_p-)slatus « POSS.OPEH) !! (cluster..p-)change_rel_pos «» HAX_CHAHCE.REL.POS) II (duster_p->statκs == OPEN) ) nax_rel_pos_over = r.p.start ♦ (4tERR0R_REL_P08) • > change.rel.pos; Ue~ nax_rel_pos_over = r.p.start » (ZtERROR.REL.POS); se cnange.rel.pos ♦ _ -.__.- ; f((cluster_p-)status =- POSS P^' " !! (duster.p-. change.rel.pos == /_ΠHANCE_REI._POS) !! (dusterj.-. status " " OPEN) ) r p.start = oax_rel_pos_over - change.rel.pos - (4»ERR0R_REL.P0S ) ; r_p_start = nax_rel_pos_over - (?ΪERR0R_REL_P0S>; dex = tenp_string_p-)start; -1_pjenent_p = p)enent.pH; ndexH; ι?.t_p)pnent_p = elenent_p+*»; • ιhile((elenent_p->rel_pos ( r..p_start) 44 (elenent p-)rel pos != β) ) ? (e)eneni_p->rpJ_ρos == H) * , np_string_p-)start - index . 1; * e anp_string_p-)start = index; ιpχ--; -nent_p--; ι) p (( e)enent_p->rel_pos (= nax_τel_pos_over) 44 ( elenent " p-)bar " ) K1H_C0UHΪ) 44 (elenent.p-)space ) HIN.COUNT) 44 ( elenent p-)rel_pos != I) ) ridexH; lenent_p+»; (elenent.p- >rel_pos !- •) 44 (elenent_p-)bar~) HIH COUNT) 44 ( elenent_p-)space ) KΪH.COUHT) ideiM; _e*ent_p.*; •nent.p = Iast_elenent_p; tρ_string_p->end = index; FUNCTIONS is.cluster.old RETURNS: TRUE/FALSE BESCRIPT[QH:-ts cluster old based on proc_scan_index(flags) tl i boolean is_cluster_oIddeg, cluster_p, εtring.p) leg; ict cluster.struct tcluster.p; rt strjng_siτurt tstring.p; ict scan_struct Jscan.p; lon.kilϊ linit, htgh_kill_lu.it; >n_p = ( struct sran.strurt t)(4(Ieg_sriegJrpror_scan_indexCJeg]])); f.kill init « • scan_p-)scan_nun - I?; ]ft_kill_ltntt = sc n_p-)scan_nun ♦ β2; ( ( (duster_p->ι.ork_sr*n.sran_ Λ < (lou.kill.linit)) !! (cluster_p-)ι.ork_scaiι.scan_nun ) (high_kill_linit)) ) ) .turn(TRUE); p • turn(FALSE); FUNCTION: is..cluster.rold RETURNS: TRUE/FALSE DESCRIPTION:-is cluster old based on scan.count ( scans ) II i boolean is..cluster..rold(leg, cluster.p, string.p) leg; t cluster.struct tcluster_p; ■ rt string.stru ♦string.p; lo«_kiU_linit, high_kill_linit; ■ _kilj_)jnjt = fr n.countrieg] - §?.; jή_kill_Unit = scan_countClegl ♦ β2; ( ( (r)uster.p-)uork_sran.sran_nun ( (lou.kill.linit)) I! (clester.p-leork.scan.scan.nun ) (high_kill_)init)) ) ) .turn(TRUE); •e tuπι(FALSE); FUNCTION: kill. uster RETURNS: BESCRIPTIOH:-kill clusters after they are deternined to be old tl kill.clusterdeg, cluster.p) leg; ict cluster.struct icluster.p; uct duster_struct tenp .cluster.p; count; ip.cluster.p =(strιct cluster.struct l)(4(leg_cClegHdusterβ_startCleg]])); dusier_p-)stal«s !» POSS IPEH) /l_.-if still bad cluster log KILL.CLUSTER tl )g_error(KILL_CLUSTER); ιster_p-)status * * •; int = clusters. tartClegl; .le( (tβnp_cluster_p-)status «■ I) 44 (rount != dusteτs_endrieg]) ) jβp_cluster_p*>.; mniHj ' (count ) ~ HAX CLUSTERS) count - »; tenp_dusler_p dstruct duster. ' -uct ») (4(leg. cCleg ] C β] ) ) ; uslers.siart rieg] - count; FUNCTION: get_next_duster RFTURNS: TRUE/FAI SF duster , index cluster.p DESCRIPTION: -gets ' next cluster that is used Jl h boolean get_next_cluster(leg, cluster_index, cluster.p ) ister int leg; ister int lcluster.index; i ster st ruct duster.strurt ttc)uster_p; duster_index ) H; cluster.p )**; duster.index )= HAX_C!.USTFRS) Jcluster.index) = β; icluster.p) * = (struct cluster.struct l)(4(leg_cCleg]CB]) ) ; ( tcluster.index !~ dusters_endCIegl) eturn (TRUE); se etern (FAISE); IUNCTION: get.free uster RETURNS: TRUE/FALSE cluster.p string_p DESCRIPTION -get ' next cluster that is free Jl A boolean get_free_duster(lβg, cluster.p, string.p) ister int leg; ister struct duster_struct t*duster_p; ister struct string.struct Wstrtngj; rluster.end; uster.end - dusters.endCIegl; uster.end*.; ( cluster.end >* KAX.CLUSTERS) 1uster.end * I; (cluster_end != dusters_startCleg]) Icluster.p) = (struct cluster.struct t)(4(leg_cCleg]Ccluβters_endCleg]] )) ; • ,string_p) = (*rlttster_p)-)strinjs; Icluster.p Mstatus = STATUS.UHIHOHK; icluster.p )-)open_type » πBE YPE.UNrKO H icluster.p )-)opβn.start_stop « ST.SP.UHIHOBN; tduster.p )-)st ring.dir * HR IMNO H Icluster.p )->nun_βtrings * I; Icluster.p )->chan|e_rel_pos « •; etirn (TRUE); g_error( UU. CLUSTERS); fiur (FAISF.); FUNCTION: use.free.duster RETURNS: DESCRIPTION: -use free cluster gotten by get_free_duster Jl i use. free_clusleτ(leg) ister int leg; HAX.CLUSTERS) lusters_endClegl-β; FUNCTION: get.next.elenent RETURNS: TRUE/FALSE $telβnent_p *ienp_string_p->start DESCRIPTION: -updates pointer to next elenent within current string ~JI n boolean get_next_elenent(elenent_p, tenp.string.p ) urt elenent.struct ttelenent.p; net string.struct ttenp_string_p; (find_code =- TRUE) enp_striι.g_p-)slart*H; telenent.p)*.; enp_stringj.-)start*»; telenent.p).*); »hile(tenp_string_p * -)start ( tenp_string_p-)end); (( tenp_string_p->start (= tenp_βtring_p->end) ) eturn (TRUE); ~ se eturn (FALSE); FUNCTION: dec.linear RETURNS: " DESCRIPTION; - Jl d dec inearϋeg, cluster.p, scan.p) leg; uct cluster_struct Icluster.p; urt sran_sirurt Iscan.p; uct elenent_struct ten .elenent.p; rode . . ; ■ dustpr_p-)slring_dir -- t ' k- •np_elenent_p - 4(cluster_p-)«ot|_scan.elenentsCl]); ,p * Λ p_elenent_p = 4(cluster_p->work_scan.elenentsCHAX_ELEHEHTS-2]); -- rlns(pr_p-) * -ort_pran.Jen; tch (dusler_p-)open..type) oori inear = der_j?.5_) Jnear(c)uster_p, len, 4tenp_elenent_p ) ; pak; •5β I...9: eak; SP CODE.A_I.AR: ood inear - dec_cod_linear(duster_p, len, 4tenp_elenent_p); eak; se UPCF.AN: ood_linear = dec.upc inear(cluster_p, len, 4tenp_elenent_p); eak; se CJ28: eak; good inear) uster_p-)rodeCrluster_p->coderi]*π=l; : (rluster_p-)string.dir « FORHARI) enp_e)enent_p • 4(cluster_p-)»ork_scan.eIenentsn]); en «- duster_p-)«ork_scan.len; :lus.ter_p-)avr_rel_pos = •; : or(x ; x ( len; x*d duster_p-)avr_rel_pos « c ster_p-)#vr_rel_pos ♦ tenp_elenent_p->rel.po5; tenp_elenent_p**; luβler_p-)avr_ιel_pos * cluster. p-)avr_rel_pos / x; lusteτ_p-)avr_tac_tine * (cluster_p-)avτ_tac_ttne *■ scan.p- )tac_tiι.e) / 2; se .enp elenent p - * 4(dusler_p-)ι_ork_εcan. " elenentsCHAX.EI.EHEHTS-2] ) ; .en - cluster. p-)uork_scan. len; luster.p->avr_rp)_pos = §; or(x»-l; x ( len; x**) cluster_p-)avr_rel_pos = cluster_p->avr_rel_pos ♦ tenp_e)enent_p-)rel_pos; tenp.elenent.p--; :luster_p-)avr_rel_pos = c fter_p-)avr_rel_pos / x; lusler_p-)avr_tac_tine • = (duster_p-)avr.tac_tine ♦ scan_p-)tac_tine) 72; < (lrιnι.ng_f r(duster_p)==TRUr) f (d.oi = get_box(leg, " cluster.p l '- 255 ) '(in.ronoouf (box, cluster.p, 3) FUNCTION: is_open_for RETURNS: DESCRIPTION: - Jl d is_open_for(leg, cluster.p, scan.p, tenp.string, elenent.p, string.p) leg; uct cluster.struct Icluster.p; »d sran.s.ntri tsran_p; uct stπng.struct tenp.string; uct elenent_'itruct lelenent.p; uct string_struct tstring_p; uct string.struct neu_slring; len, x; A boolean ιs_open; x_s ( r.ng - ienp_siring; itch (dusteι_p-)open_type) ase (2S: is_open = Js_i25_open_for(duster_p, 4ne*_string, elenent.p ) ; reak; reak; ■ se COI>F._A_BAR: is_open - is_cod_open_for(duster_p, 4ne«_string, elenent.p); reak; ^ IIPCEAN: is.opeii - ιs_upc_open_for(cluster_p, 4ne»_string, elenent_p); reak; reak; (is.open) /• .'y* 5 - initialize and use dusters tl • i.ring_p = neu_string; Jιιsier_p->«ork_sran.sran_nun = sran.p-)scan_nun; luster p->uork scan.len= tenp string.end - tenp string.start ♦ 1? lus(pr_p->ιtork_sirJng = ne«_string; )ustet_p-)nun_st rings**; luster_p-)uork_scan.el nentsCf.l.bar = β; luster .ρ-)uork_scan.elenentsCI]. pace - I; Jusier_p->«ork_scan.e)enentsri]. rel.pos s β; pn *clusler_p-)t.ork_scan.leo ♦ J; «s pr.p- t»or _sran.e enen s .open_ ype - . _ -- _ iuster..p-)uork. string. end = nee ring.end - new. ing. tart »1; :luster_p->tork_string. start -1; iusipι , p->)ast_nairh = duster.pdwork.string.end; luster, -)old_lasl_ι.atch - cluster_p-)last_natch; luster p-)change_rel pos = HAX_CHANGE_REL_POS; itιsier_p-)avr_tar_iine = sran_p-)tac_tine; lusler_p-)deplh = scan_p-)depth; ster_p-)old_«ork_string = cluster.p-luork.string; iustpr_p-)old_»tork_sran.5ran_nun = cluster.p- luork.scan.sran.nun; ]uster_p-)old_uork_scan.Ien *- cluster_p-)eork_scanden; ord-β; x( cluster_p-)κork_scan.len; x + d cluster.p -)old_work_scan.eϊenentsCχ] = duster_p-)work_scan.elenentsC χ] ; se.fiee.dusterdeg); ec ineardeg, cluster.p, scan_p); luster_p-)rodeCll=8; FUNCTION: is.open rev RETURNS: BESCRIPTIOHi - Jl i is_open_rev(leg, cluster.p, scan.p, tenp.string, elenent.p, string_p, current.string) leg; urt duster.struct Icluster.p; uct scan.stπct tscan.p; uct string.struct tenp.string; uct elenent.struct Jelenβnt.p; urt string.strurt <string_p; act string.struct current.string; uct string.struct ne*.strin§; Jen, x; ft boolean is.open; u.string - tenp.string; itch (cluster.p-)open.type) ate I25t js.open = is_i?5_open_τev(c]uster_p, 4nβ«_string, elenent.p); reak; ase f.39: reak; ase COPF._A_I.AR. is.open = is_cod_open.rev(cluster_p, 4ne*_string, elenent.p); reak; ■ -* .MEAN: is.open *■ is_upc_open_rev(d«ster_p t 4ne«_string, elenent.p); reak; r»ax; ■ ) * ;_open) /$__-yes, ιniiJa)J7e and use dusters */ string.p ~ net._string; "uι<.ter_p-)wor _* * ran.scan_nun = ** can_p->scan_nun; jiι« * tpr_p- >«ork_sran.len= * tenp.string. start - current.string. start ♦ 1; ''u- * ter_π-.t.ork_-.tring = neu.stringj luster .p-)nuft_s t rings* ♦; pn = duster_p-.ι.ork_sran.Jen < .; pncpy(4duster.p- )«ork_scan.elenentsCHAX_ELEHEHTS - (len ♦ 1)1, 4scan_p-)elenents[current_string.start-π, len ) ; luster_p->ι.ork.scan.elenentsCHAX_ELEHEHTS-lϊ.bar = β; )tιstpr_p->«ork_sran.e)enentsrHAX_FIFI.FHTS-l]. spare = §; ]uster " p-)eork " εcan.elenentεCHAX_ELEKEHTS-π.rel . .pos = i; luster_p-)uork_scan,elenentsCHAX_EI.EHEHTS-l-n.open_type = cluster_p-)open_type; )ιιster_p-.» * ork_string. start = neu.string. start . (MAX.EIEHEKTS - neu.string. end - 2); luster_o-)l st_natch = cluster_p-)uork_string. start; luster_p-)old_last_natch = cluster_p-)last_natch; Jiisier_p-.work_dr.ng. end = .HAX .I FHFHTS - ?); )usteι_p->change_rel_pos - MAX_CHA CE_REL_POS; luster_p-)avr_tac_tine = scan_p-)tac_tine; luster.pddepth = scan_p-)dβpth; )usier_p-)o)d_«prk_string = duster_p-)«prk_string; luster_p-)old_uork_scan.scan_nun = cluster.p- )eork_scan. scan.nun; luster_p-)old_ι.ork_scan.len = cluster_p-)»ork_scan.len; nr(x * =f»; x< duster.p-)«ork_sran.Jen; x*d cluster.p -lold.uork.scan.elenentsCxi = duster_p-)eork_scan.elenentsCχ]; e.free.cluster(leg); ec.lineardeg, cluster.p, scan.p); ) uster_p->roder&]=&; U<**er Uane- JEFF <T* Queue: SEF -R4/PRINT Q _0 ύv ~^ \--t.\r-i H-Pt-if. OVERJ.Λ .. Servers SEK.qfi^ D-^s v j. ϊ. on s OVERLAY . C SFPTFI-WER 33, i99~t 11s 10 an :$4:»:i_*:*: .**:»^ J F.FFEF FFFFF FFFFF -J.J :4:*4:*:_t:$a:$*_#«** NAME: overlay. c DATE: *9/l4/9β PROGRAHHER: Jeff Sharpe DFSHRJPTJON. - XI PRX TF.CHHOinCY WITH DSP-THS 3?BC3β Copyright (c) 199* Accu-Sort Systens, inc. All right? reserved. :_ude "conn.exl 11 FUHCriOH: overlay RF.THRNS: c ]u«;ter_p- >«ork_slri nrj »ork_scan lastj_atch string_p-)end DESCRIPTION: - ι ovprJuy_rp ** ponce ovprIay(scan_p, string_p, c]uster_p) jrt stan_struct tscan_p; urt "ϊ tstring_p; uct cluster.struct lcluster_p; ister struct elenent.st tict tpl, Ip2, tp3, Ip4; index, nax_rel_pos,i,j, change.rel.pos, ηq_natch, fron_start, left_i»dβx, t_tndex, t.fron.start, jstop, len, t_len, scans_skipped, x, up iork; iri " elenent. rαrt HJ, It2, It3, *t4; ict elenent_struct t«ork_elenent_p, tne«_e]enent_p, old_p3{ ( lu«iter_p-)string_dir == FQ UA B) /S__-overJ*y in forward dir tl l=-«ork_elenent_p - (l(cltttter_p~)*ork_scan. elenentstcluster_p->«ork_stri»f.e»d])); > s net__elenent_p = (4(βcan_p-)elenentsCstring_p-)start]))5 ιχ_r p )_pos = «* can_p->e)Mentsr5tring_p->eBdJ.rel_pos; * _natch -• I; ron_start = β; f(string_p-.end >= «-tringj.->flart. /t__-does prior H1K_0I.F-RI.AY p.enents of ιιork_«tring.end /<__ natch with nen string tl index = β ? left.index = % ■ if( ( " j _s)n_«jdth((p.-)har ♦ p_-)»pare),(p?-)har ♦ p2-.space).) ) do { left_index*-H jfUe ' ft ndex == H1K_0VER!.AY> { -- = pl; P 4 • » p2; } ) pl-)space),(p2-)bar t p2-)space ))) ii pl-)space),(p2CU.bar ♦ p2->space))) kk ifdeft.index )= HCH VER AY) G p) - i«ork_e_enpn._pr_]; ~ 2 - ine*_elenent „ p[l]; /ϊ__-does at least the next HIH.HATCH elenents of /*__ ι.ork_string.end natch with the nev string tl κhi ( (i*i_-.in_i-idth((pt-)bar ♦ pl-)space),(p2->bar ♦ p2->space ) )) kk (is_sinj.idth((pl-)har » plE-U. space), (p2-)bar ♦ p2C-l]. space) )) kk ( p.-)re)_po5 !- β) kk ( p2-)ιel_pos !- %) kk ( p2->bar ) HIH_πθiJHT) ii ( p2->space ) HIH.COUKT) ) { index->5 pl". p24.; ) jf( (( Ipft. ndpx f index) > (qq_natrh)) kk (index >= HIH.HATCH) ) { )en - duster p-)«ork string- end <• index+1; «hile( ( pl->rel_pos != •) ii ( p2-)rel_ρos !- I) ii ( p2->har ) HIK.CO.IHT) ii ( p2-)space ) HIH.COUKT) ) { lea"; pin? p2*M 1 q natrh - ]pft index . index; ll * p | , t2 = 2; t3 = P 3; « - P4» t.index - index? t.fron.start - fron.start; t_len - len; ) /t -update ne« to next elenent, search for best fit */ fron_slart ; neii.elenent.p. »; βl - Kork.elenent.p; • ?. r neβ.elenent.p; <hile( (p2-)rel_pos < r nax.rel.pos) ii (p2-)rel pos != β) ) ? ridex - t.index; ?n « * t.len; - 66 - ovprlay */ cluster . p->change_rel_pos = HAX.CHAHCE.REL.POS; r]ιι- * -lpr_p->lii ** ._natrh = cluster.p*>t_ork_string.end; cluster.p->status = DECODElHt; r< * i:urn(OVERI.AY.OFF.START_REC); 3 )f(r)u er_p-)s<alus == OPEH) C It -if status = OPEH update nork.string.end, status = lt " _ DECODEINC, return OVERLAY_OFF_START_REC tl rlu<*tpr_π->ιιi)rlt. string. end = duster_p->last_natch - HIH.HATCH-1; c las t*jr_p- status = βECODElHC; τ p iιιrn(OVFRI.AY.OFF.START.RF.C); ) • .Is*. ( /<__-e)se nork.string.end .. XI ιf((clustPi_p-)ι.ork_string.end - dusler_p-)»ork. string. start ) < (clust<;r_p-)ι.ork_s-.an.len - I - HIH.HATCH)) £ c Justpr.p- >ι_ork.ilring,pnd ; return ( OVERLAY.RECURCE); ) else ( cluster.p-)old_*ork_string. nd.♦; cluster_p-)«ork_string * ■ cluβter_p-)old_«ork_string; rJustpr_p->ι.ork_Rr n.scan_nun = rJuster_p->old_ι_ork_scan.scan_nun; clusteι..p-)_ * ork_scan.le» = c]uster_p-)old_«ork_scan.len; for(x ; x< cluster_p->old _ork_scan.len; x*») cluster_p->»ork.scan.elenentsCx] = cluβter_p-)old_»ork_scan.elenentjCχ]; retβrn(OΫF.RIAY.RF.COVER); z ) Jse '■ tl; p2 - 12; f.3 = 13; P r . if( ( (tlttster_p-)«ork_string.end ♦ index) < (cluster_p-)last_natch-2) ) !! ( len ( (cluster_p->ι_ork_scan.len*2)) ) { up.«ork - fl; ) else f up_«oιk 1; } ρ4«p3; P?.= /t -if status ■= POSS.OPEK or OPEH set elleftents used lt__ in open pattern and calculate change.rel.pos tl if( ((cluster -)statuβ « POSS OPEK) !! . . - - ) pi = k-lU HIH..0VERLAY-D3; -Z - ip2C( H£N_OVERLAY-l)l; ι.hi)p((pJ->re]_pos != β) /t set open_type in elenent tl (p2->rel..pos !- *) ) £ jf( p.-)open_type ! ** • fl) p2-)open type = pl-)open type; pl--; P2"i ) } /-...-update cluster infornation tl cluster_p-)t»ork_string.index = string_p-)index; .f(up_*ork) luster_p-)last_natch = cluster_p-)t_ork_string.end ♦ index; rh»ngp_rpJ_pos - * (p3-)rel.pos - p4->reJ_pos); if(up_t«ork) £ jf(avr work) £ o)d_p3 - <p3; tp3 = tp4; It set-up net. work XI p3->fιar = (old_p3,har » p3-)bar)/2; ρ3-)space * ■ (old_p3. pace * p3-)space)/2; ) else * 3 = tp4; It set-up neu work t/ 1 else £ pl - p3; p2 - p4; } jstop*i»dex * HIK.OVERLAY-t; index *■ f; £ index"; p3..; p4 ; if(ρ3->rel_pos «-» •) jstop - I; if((jitop \ ~ I) it (p4-)rel_pos ! = I)) £ jstop--; J «♦: change.iel.pos -= change.rel.pos ♦ (p3-)rel_pos - p4-)rel_poβ); tftavr work) { old_p3 - $p3; . tp3 = tp4; It set-up neu Mork tl p3-)bar > (old_p3.bat . p3-)bar)/2; p3->space * (ol«l_p3. spare ♦ p3-)spare)/2; 1 else ) - 68 - else * f(tιp_t.or*) tp3 '~ »p4; }while(p4-)r( * l,pos != «); )f(( ! -ran-_-.kipppd = (scan.p- >sran_nun - clustpr_p-)«ork_scan.scan_nun )) != β) _f(cluster„p->change_re]_pos == HAX_CHAHGE_REL_POS ) •:luster_n->change_rel_pos = ((change.rel.pos) / (j ) ) / scans_skipped; else r)(i ** tpr_p-)rhange_rpl_pos = ((rluster_p-)change_re)_pos < change.rel.pos ) / (j tl)) / scans.skipped; ιf(up_»ork == β) £ -I - pi; p - p?; while(p3->rel_pos \- β) £ p3-)rp).pos = p3-)reJ_pos - rJuster.p-)change_re)_pos; ,,3H j p-* H ; ) )uster_p- )κork_scan.sran_nun = scan.p- )scan_nun; ':luster_p-)«ork_scan.len = cluster_p->ιιork_string.end ♦ index - HIK.OΫERLAY; if(r)usier_p-)5tatus == DECODF.JKt) r /t -if status = oεcnOEClHt, update nork.strinf.end */ if(cluster_p-)»ork_string.end ( cluster_p-.last .atch - HIH.HATCH - 1) rJuster_p->«ork_sfring.end = rluster.p-Ilast.natch - HIH.HATCH - 1; ) return (TRUE); SP /$__-overlay in reverce dir tl l=κork_elenent_p = (Kcluster.p-liiork.βcai.. elβ_.intsCcluster_p-)»ork.5tring.start])); >.-net__p ) enent_p = (Ksran_p->elenentβrstring_p-)start3)); -x.rel_pos • scan_p->elenentsCstring_p-)end].rel.pos; q.natch = %- ron.start = •; f(string_p->end >= string.p-lstart) /t__-does prior HJH_OVF.Rl.AY elenents of uork.string.end /<__ natch vjl nen string tl index - β; lefl_index - β; if((JF_sin_uidth((pl-)har ♦ p)-)space),(p?->bar ♦ p2->space)))) do £ left.index*.; ifUeft.index =- HIK OVERLAY) C p3 - pi; 4 - p2; o - - P2--Ϊ -ϊhi)e( (Js_fin.¥)d(h((pi-)har J -)space),(p?-)har ♦ p2-)spare ))) kk (is_sin_t_idth((p_->bar ♦ pJC-11. space), (p2-)bar ♦ p2£-lJ. space ))) kk ( pl-)rel_pos != β) ii ( p2-)rel pos != 8) >! tfdeft.index >= HIH.OVERLAY) £ pi = JV«ork_p)pnpnt_pr-J3; p2 - 4ne«_elenent_p[-π; /«__-does at least the next HIH.HATCH elenents of /t__ -_ork.slring.end natch with the ne« string tl while( (is_«.in_widtϋ((pl-)bar ♦ pt-)«.pace),(p2-)bar ♦ p2-)space ) ) ) kk (is sin widthUpt .bar ♦ pl-)space),(p2C13.bar ♦ p2-)space ))) ii ( pl-)rel_pos != K) i ( p2-)rel_po«. !-■ 8) ii ( p2-)bar ) HEH ..1UHT) ii ( p2-)space ) HIH.COUKT) ) £ indeι»+; Pl"? P?.--; ) jf((( lpfi.indpx ♦ index) > * - (qq.natrh)) ii (index >- HIH.HATCH) ) £ )eβ - HAX.E1 FHF.HTS - cluster .-)«ork_string.start t 1 ♦ index; vhile( ( pl-lrel.pαs != •) ii ( p2-)rel.pos != β) ii ( p2->bar ) HIH.COUKT) ii ( -?.->-- -c- ) HIK COUHT) ) £ )e»H; Pl"! p2--; ) qq.natch * = left index *> index; tl ' pl; .2 « p2; 13 - p3; 14 - p4; t_index = index; t_fron_start = fron.start; i.len = len; ) " } •..-update neu to next elenent, search for best fit tl fron_staιlH; neκ_elenent_p»t; pl » «ork_elenent_p; -Z - ne«_elenent.p; κkile( (p2-)rel_pos ( r nax_rel_pos) ii <p2->refpos != I) " >! ndex » t.index; - - 70 - f(qq_natch ( HIN.QQ) /t -ftring did not overlay XI if(c]uste._p->status~« POSS.OPEH) cluster.p-.change.rel.pos = HAX_CHAHCE_REL_POS; rJwsipr_p->Jasi_natfh = clusler_p->t_ork_< * tring.start; clustet_p- ) slatύs = DECOPEIKC; ~ return(OVFRI.AY_OFF_START_REC); ) .f(r)uflpr_p->staius =- OPEH) IX -ii status = OPEH update t_ork_string.end, status = lt " _ PECODEIHG, return OVERLAY_ϋFF_START_ EC */ cluster_p->βork_<itring. start = cluster_p-)last_natch ♦ HIH.HATCH ♦ 1; cluster " p->statϋs = BECOBEIHG; re<urn(OVFRI.AY_nFF_START_RFC); .Is* /t_.-else tiork.string. start -- XI if((clusler_p-)«ork_string.end - cluster_p-)«ork_string. start) < (cluster_p->t.ork_scan,len - 2 - HIH.HATCH)) £ * r ) usiρr_p-)ι_ork string. start--; return(OVERLAY_RECURCE); ) else f cluster.p- lold.vork.strxng. start— ; cluster_p->ι.ork_string « cluster.p-lold.Mork.stnng; rJester.p- >»ork_scan.sran_nun = cIuster_p-)old_»ork_scan.βcan_nun; c)usteι_p->Nork_scan.len = cIuster_p-)oJd_«ork_scan.len; for(x=f.; x< rluster.p-lold.Dork.scan.len; x**) cluster_p->κork_scan.elenβnts[χ3 = clβster_p-)old_ι_ork_scan.elenentsCx3; return(OΫERIAY RF.COVFR); } se ( (cluεter_p-)ι.oτk_string.start - index) > (cluster_p-)last_natch«2 ) ) ( len ( (cluster_p-)i.ork_scan.len*2)) ) up.eork - β; >lse )t=p3; ■2--p4; /t - f status - POSS OPEH or PEH set el t sed ) f ( < (r. ust pr_p- >status « POSS PFN ) ! ! (duster. p - >status ** OPEH) ' ii ( uo vork == I ) ) ( pl = 4pH( -HIH_0ΫERLAY*1)3; -?. -■ ip2C ( -H [ H_0VERI.AYH)1; t_hi]e((p.->re._po«- != 8)44 It set open_type in elenent */ (p2-)reJ_pos !~ 9 ) ) £ j f( pJ-)oppn_i) * pe ! r 8 ) p2-)open..type - pJ-)open_type; pl.»; PZ» ) } .-update cluster information tl cluster.p-)vork..slring.index - string_p->index; if(up_«ork) cluster_p-)last_natch = cluster_p-)vork_string.start - index; rhangp_rp)_pos = (p4-)rel_pos - p3->rel_pos); if(up_vork) £ if(avr vork) C o)d_p3 • <p3; tp3 - tp4; It set-up nev vork tl pi-)bar = (old_p3.bar ♦ p3-)bar)/2; pi->space ** (old p3.space . p3-)space)/2; ) else •P? = tp4; It set-up nev vork tl ) els £ J = p3; p2 « • ρ4; ) jltop-index • > HlH.OVERLAY-1; index ** 8; j ~ •1o £ index*.*-; p3--; P 4--; if(p3-)rel_pos « ■ ■ β) jstop = β; i fUjstop !•= 8) ii (p4-)reI.pos != ID £ jstop-; change_tel_pos = change_rel_pos • > (p4-)rel_pos - p3-)rel_poβ); if(up_Bork) if(avr vork) ( old_p3 • = Sp3; t 3 - t 4 It set-u nev vork tl -..->-- • --■ = (oifl_p... space » pj-/space.//.; — 7 '2* • — ] tp3 - tp4; ) -\-~e Jf(tιp_*ork) tρ3 - tp4; Jnhi)e(p4->rpl_po * ; != β); ιf((scaiιε. . skipppd - (scan_p- )scan_nun - duster_p-)vork_scan.scan_nun )) != β) if(clust.ft.r_p-)change.rel_pos «•= HAX_CHAHCE_REI._POS ) cluster_p->change_rel_pos = <(change_rel_pos) / (j )) / scans_skipped; e)-- cluster.p- )change_reJ_pos = ((duster_p-)change_rel_pos ♦ change.rel.pos ) / (j .1)) / scans.skipped; if(up_vork == d) > r. P-* r p ) » p4 - p2; wήile(p3->rel_pos != *)) £ p3-)rpj_po ** = p3-)rp)_pos . duster_p-)ch»nge_rel_pos; p3-; 04", ) )usier_p->vork_sran.sran_nun = sran_p-)scan_nun; i (up_voιk) ctuster_p-)vork scan. len = HAX.ELEHEKTS - cluster.p-lvork.string. start ♦ index - I - HIK.OVERLAY; f(dusipr.p-)siatus == PF.CODF.IKC) /*__-if status = OECOOEδlHC, update vork.string.end XI if ( cluster_p->i(ork.string.start > cluster_p-)last_natch ♦ HIH.HATCH ♦ 1) r )μ stpr.p-)«ork_striBg.start = cluster_p->last.natch ♦ HIH.HATCH ♦ 1; -eturn (TRUE); Uεpr N,**ιιes Jfci-F (1 : * ' > Queues SE« " Ε - /PRT.WTα_0 ' i- ' U.e i'-.:: TNT ' .XX Server: SEi ^a&C-A. J EFFEF FFFFF FFFFF .J. :>}::4:-t:*_4:$*:#*:$_t:>}:$*$*^ _ - A _ HAHE: int_u.c OATF: H9/14/9B ] PRQGRΛHHER: Jeff Slurpe DF.SΠRIPTΪOHS - tl DRX TECHNOI.OCY JTH DSP-THS 3? β π3 β Copyright (c) J??β Accu-Sort Systens, inc. All rights reserved. :lude 'coΛft.ext" FUHCπOH: c.intβtO RF TURKS: E5C IPTI0H: - l i c.intlH) FUKCTIOH: c_intl2() R TURKS: DESCRIPTIOH: - tl FUKCTIOH: c_intl3() RF TURKS: MSCRlPTIOHi - tl ϊ c.intlJO ster int box; ster street box t»ble_struct tbox_ff .(' or 2lllh,st ; ); ' it chafed fron 2lllh tl ..tine..? (box - 8; box ( MAX_BOXES| faoxH) ■ x.p - (struct box_tJble_struct tHMbox.cϋbox-DJf :(box_p-)tx_t4c_tiι.e ) β) ι(iχ.p-)tx_t#r.tif.e--; f(box_p-)tx_tac_tiι.e " •) ;x_codes(box)| ■ (' xoi 2ltfh,st > ); IX cbaaged fron 2Bllh tl . . - - - tl c.intM O -i?x union elpnent union tp?, t< * tart_d*ta, ip3, tend_data; ster int index, count, Jen, nJen, Jeg, tpl, old_scan_index, stat_reg_val; & ict sc-jn_*.truct (lsc*ιn_struct_p); = ■ (int t)HF.H_HAP_PF.R)F_BASE; /J__-dna global control disable XI Utxi) = DHA fSABLE; /t__-read in status register xl/x? tl t_reg_vaJ -- t(iι.t~t)STATUS_REG; It -save ending dna address */ . data - (union elenentjiniαn t)(t(pl.fx6>); /t__-save starting dna address, tl rt.data - (union elenent.union t)((int)end_data k (int) (OMA_START_AOO_HASK)) 5 /t__-delernin uhirh half of Ik block of internal ran gets It the dna data on the next scan tl /-...-flag light off t/ <(* and lbfh,iof); (last.x == (stat.reg.val J. lill)) kk (first_flag -= •)) _.{ ** or IMb f iof); /* flag light on *V ror.int.M - Xl.X2.SAKE,' t.x ~ (slal.reg.val 8x11); ( last.x != «) /t—'.'t neu dna starting address leg It/ pHlxtS ) DKA_START.AM.X1? (hea « X) eg - l| se f(head tr SϋPER.X) leg = ((stat.reg.val k Ix7l)/ ) - 2| Ise if(head — H.55) leg « ■ I; /t__-get new dna starting address leg ft/ plUx.) = OHA START ' AOB.XZ? if(head I- SUPER X) Jeg -= % ■ else Jeg = ((stat.reg.val k lx7l)/.6> - ?| /t__-tnit dna registers tl ΗftxS) = >HA_C0UKTF.R_RF.S? It dna transfer counter register XI • Wβrβ) = DMA.fHABI.F.- IX enable dna XI t_rfl(HHA_FNABI.F..HASK); / .«a_int_enahle_nask XI /t__-enable interrupt irβ for dna XI ft(" or rft,.e'); (firsi.fJ-'g " 1 ) /t__-jf first sran init for neu rpad cycle tl ml flag - β; /t__-save only the scans that have 1 or nore strings over IX__ K1K.TRAHS.LEHCTH and turn on flag light tl • it = end.data - start_data; fden > 5?B) len = len; r (len >= «(H_TRAKS_LEKCTH) en-it? >nd_d*ia-)a)l = β? _can_slrucl_p - (struct scan.siruct tHKIeg.sClegHscan.indexClegH) ) ! . an_strurt_p->scan_nun ■ scan.countClegl; )2 ι (union elenent.union i)scan_struct_p">elenents; ->aJJ = i- orlindex • β; index (len ; index**) if ( (start j.i->fleld.bar ( KIK.COUKT) I. (start_data-)fie]d.spare < KIK COUKT) ) £ if (count ( H(H.TRAKS .EKCTH) £ 2=p3; start. ata**; } else f aβnC or lh,iof); It flag light on tl if (nlen =* * I) nlen - 1; nlen * • nlen * count; if((start.data-)field.bar !- * I) !! (start.data-)field.space !-8)) ( tp2 - tstart.data? P?.-)field.ppe»_type * If nlenπ; ) P?.-)aJJ r %- 2H; pJl-p2; - - el se f tp2 - tstart.data; p?-)f.pJd.ppen_lype = fl; starl.data**; if((p2-)field.rel.pos > start_data-)field.rel.pos )) £ if(p2C-π.field.rel_pos == β) C p?-)fieJd.rel.pos = starl_data-)fie)d.rel_pos - (starl.dataCΪl.field.rel_pos - start_data-)field.rel.pos ) ; ) else if( (st *rt_daia-)fje)d.h*r ( HJK.r-OUKT) i ! (start.data-Jfield. space ( K?K_COUKT) ) ( p2-)field. rel_pos - p2E-l]. field. rel_pos * (p?.r-π. field. reI_pos - p2r-?3. fiel d . rel.pos ) ; } else ( ρ2- >fieJd. re)_pns * (( pos - p2[-lI.field.rel_pos ) /2); ) } [.?..♦; ount.*; if((nlen * count) ) (HAX F.I.F.HEKTS -?)) £ index - len; «rror_int_84 = SCAK TOO LOKC; ) } ) if (nlen >= XIK.TRAKS.LEKCTH) old_scan_index - scan.indexEIegl; scan.indiixClegl ♦*; It index into leg.s array tl i f (scan.indexClegJ >= KAX.SCAKS) sran ndexflegj « 8; It urap arround tl i f (scan.indexClegl -- proc.scan.indexClegl) IX field. space for neu data ?? XI £ scan.indexClegl = old.scan.index; It throu auay neu data tl errfir " _int_84 = FUIf SCARS; " } scan_struct_p->len = nlen; scan_struct_p->depth - gdepth sran_sir«ct_p-)lac_tine = tar.tine; ) :an_countClegl »*• It increnented every scan tl (IegX2) !sn(* oτ 884b,iof); It cart light on XI se ' isnC and ffbb,iof" ); IX cart light off XI - 78 - FUKCT IOH: c intβ5() RF.TIIRKS : PFSCRJ PT10N II : c intiSO FUKCTIOH: c intβόO RFTURKS: DESCRIPTION: - XI c intβάO FUKCTIOH: c_intβ7 () RFTURKS: DESCRIPTION: - XI c int!7() FUKCTIOH: c_intl8 () RFTURKS: DESCRIPTION: - */ c_intββ() FUKCTIOH: c_intβ? () RFTURKS: DFSCRJPTION: - I FUKCTIOH: c.intlβO RF.TIIRKS: DESCRIPTION: - I ■ inttβO RFTURNS: .3/ ■ r JnlJ.U User Name π JEFF (.' " ) Queues ~ ΕR4/PRΪNTG_0 il -'ii-'i'*-*:: PRFPRi . ,C Server: SEKVEE'4 D«-> sc: r . o I * . J. on K PREPROC . C F.FTFMBFR A >., 19991 11:10 an >}:#$*$#$) }:>>.«$*************#$^ i FF.FEF FFFFF FFFFF J E F F J F. F F J EEEE FFFF FFFF -I F F F J J E F F -J.J.J EEFFE F F >.:********************************************************************* PPF-'P RRRR EEEEE PF-'PP RRRR OOO CCC CCC f P R R F P P R O O C C C C P P R R E P P R R 0 0 C C PPPP RRRR EEEE PPPP RRRR 0 0 C C P R R E P R R 0 0 C ... C P R R F P R R O O C C C C F * R R EEEEE P R R OOO CCC ... CCC - - NAHE: preproc.c DATE: «?/U/9fi PROC AHHtfi: Jeff Sharpe PF.SC IPTJΠK: - tl DRX TF-CHHOIOCY WITH DSP-THS 370C38 Copyright (c) .??§ Accu-Sort Systens, inc. All rights reserved. elude "conn.ext* FUHCTION: preproc R TURKS: DFSCR1P1I0H: - / ά preprøc(leg) Jegj urt sr#n_struct ϊscan_p, tenp_uork_scan; uct elenent_strucl telef.ei.t_p, ttenp_elenent_p; uct clust*r_stru.:t Jcluster_p5 uct string.struct tstring.p; -irt string.struct tenp.string, neu.string, tenp.uork.string, cirfent.striig; n cluster.status tenp.statusf rJuster_index, rherk_code, hex, i, decoded.good, len, done, j, overlay.recover.count, overlay.recurce.count, x, scan_diff; ft overlay_responce v r t tes} A boolean overlay.recover, clιtter_is_αld| r rode rHAX.CKARsJ; (pτoc_next_scandeg, (tenp.string)) /t__- there are scans to process t/ r»n_p = (struct sran.strurt tXlr(Je|_srieg3[proc_scan_indeιriegJ] ))? OS**- »•«■- slriBf t/ hile (get.next.string (scan_p, lelei.ei.t_p, (tenp.string)) jf( clusters startrjeg3 != dusters endflegj) ( c ster.index = clusters.startCleglj cluster_p » (struct cluster.struct tX((leg_c[leg]Ccluster_indei]))j do C c)uster_Js_old = FAI.SFf if( (clusler_p-)nun_strings < KAX.STRIKCS) (( (string.fits.in.elusterdeg, elenent.p, cluster_p, (tenp.string, (string.p)) (( ((duster is.old = is.cluster.olddeg, cluster.p, string.p)) -== FALSE) (( (cJuster_p-)status ! ** STATUS.UKKHOUH) ) /l__-stri«f fits into next cluster 1/ ( tenp_Nork_string r cluster.p->«ork_stringj .pi.p_K f in._sr*n.jen = c/*ιster_p-. -wrι_sran_. en; for(x s β; x(cluster_p->«ork_sf **ι.len; x + teι.p_«nrx_'i':«n.eien ntsCxϊ iuster_p-.t.ork_scan.elenentsE χ] ; (enp_s(at«if = r ) usler_p-)slatitf.; scan iff - scan..p-)scan_nun - leg_s£leg]£string_p-> index3.scan_nun; lstπng_p* tstring.p = tenp_string; r)ustet_p->nun_?tri gs<«| overlay , recover - FALSE; over y_rerover_count = β; overlay_r * _curce_count *■ β; do C ne*_str.ng = ie«p_ ** tring; /t__-trin the string tl trindeg, scan.p, cluster_p, (neu_string, elenent.p); if(clust«r_p->string_dir == FORWARD) ( if((cluster_p-)status — DECODEIHG) (( (over.status != OVERI-AY.RECURCE) ) ( done r I; j((cluster p-)rhange re) πs == HAX CHAKCF REL.POS) i-i. else i- « )e ((( net._string. start - tenp.string.start) < KIH.OYER.AY) (( (done -- i) ) £ if((r)ust r_p-)uork_sca».elenents [cluster. ->«ork " ttring. nd 4 KIH.KATCH * jl. space ) HIK.COUKT) (( (cluster p->uork scan.elenents Ccluster~p->«ork~string.ead ♦ HIH HATCH ♦ jl.bar > HIH.COUKT ) ) { cluster.?-) uork.stnng.end ; neu.string = tenp_string| /t__-trin the string tl trindeg, scan.p, cluster.p, (leu.string, elenent.p); ifdcluster p-}t_ork scan.elenents [cluster_p->«orϋ.string.end t KIH.KATCH ♦ jl. space ) HIK.COUKT) (( ( cluster.p- >uork_sran.e)enents £clusler_p->»ork_string.end •> HIH.HATCH ♦ Jl.bar > HIH.COUKT ) IX kk (scan.diff ) l)t/ ) else done ** t; ) else do e ; ) 3 if((ne«_string. start - tenp.string.start) ( MIK. OVERLAY) •eu.string, start = tenp string. tart ♦ HIH.OVERLAY; if((tιnp_string.end - nev.string.end) ( HIH.HATCH) neu.st ring. end = tenp.string. nd - KIH.KATCH; if((duster ->status ϊ= -ECODEIKC) (( ' -. . ._ . . ) C nei._string.end = ne«_string. start ; . 3 else C j f ( (r )tιs(er_p- >sta<us == BFCODEIHC) (( (over. status != OVERLAY.RECURCE) ) ( done = β; j ftr. υst er p- . rhange rel pos == HAX CHAKtE REi POS ) else «hi)e(((tenp_string.end - net._string.end) ( KIK.OVERIAY) (( (done -■- % ) ) i jf( (r_u« * ier_p->unrk sran.p)enentsfcluster_p-)«ork_string.start - HIH.HATCH -jl.space > HIK.COUKT) (( " (cluster_p->uork scan,elenents[cluster_p-)uork_string.start - HIH.HATCH -jl.ϋar > HIH.COUKT) ) { r_uster_p- )«ork_st ring. tart--; tιe«_string = tenp.string; /t__-trin the string tl trindeg, scan.p, cluster.p, (neβ.string, elenent.p ); j f( (cluster_p- )«ork_scan.eJeneιtsrrluster p-)uork string . start - KIH.KATCH -j-ύspace ) HIK.COUKT) &(~ (ctuster_p->Mθrk_scan.elenentsCcluβter_p->βork_string . start - KIK HATCH -jllbar ) HIK.COUKT) IX kk (scan diff > 1 )1/ ) else done r l; 1 else done*. ; } ) if((tenp_string.end - ueu.string.end) < KIK.OYERLAY) nev_string.end - tenp.string. end - HIH.0VER1.AY; t f((ϋtN_string.start - ' tenp.string.start) ( KIH.KATCH) neu_stri ng. start r tenp.string.start ♦ KIK HATCH; if((cIuster_p- >sta s !<- IECOBEIKC) (( (over.status != OVERLAY.RECURCE ) (( (ne*_st ring. end ( neu.strtng. start ) ) neu string.start = neu string.end; ) 1 clttster_p-)old_last_natch « cluster_p-)last_natch; jf((over status * oveτlay(scan_p, (nev string, cluster p)) "TRUE) { / __-string overlays correctly tl It_ ' _-ii status * POSS.OPEK change it to OPEK tl if(c)uster_p->status « POSS.OPEH) / *__vhi.u»h -is ft 4 ny cna racters as possio ie */ /!__- ! . good c * < call in_coi.pl.ufl/ /t - if last g t character < last_natch mke lt__ last_ι.*tch = last good character XI du-.ter.p-^vr.tac.tine = (cluster_p-)avr_tac_tine ♦ scan_p->tac_tifte) / 2; αer i nea r d eg , c J tιsier_p , sran.p ) ; . ((overlay.recover • - TRUE) ( IX__ re_overlayed last string, re_do current string 1/ .pi . p_s-.nng = cluster. -)stringsrcluster_p->nuι._strings-_]; &can_p ~ 41eg_s[leg][lenp_string. index]; <>leι . ent_p = 4sran.p- >eleι.entsCteι.p_string. start!; overlay.recover - FALSE; over.status = OVFRI.A Y_OFF_START_REC ϊ ovei l ay.recurce count • 8; } else ( clusler_p- )old_ * _ork_string = tenp_»ork_string; cluster_ρ->old_uork_scan.scan_nun = tenp.uork.scan.scan.nun; cluster_p-)old_work_scan.len *• tei.p_vork_scan.len; x( tenp_«ork_scan.Jen; ι** ) cluster_p-)old_uork_scan.elenentsEx] = tenp_«ork_scan.eleι.ents_. χ ]; } 1 else C i f (over.status == OVERLAY RECOVFR) { if((overlay_recover != TRUE) kk (overlay recover count ( HAX RECOVER COUHT) ) ( overlay.recover - TRUE; overlay.recover.count**; tenp.string • * - cluster_p-)strin|sCcluster_p->nun_strings-21; sran.p = ->leg_sNegJrte«p_string. index]; elenent.p - can_p-)ele«entstteι»p_string. start]; over.status • * • OVERLAY.OFF.START.REC; J else ( /f__ could not re.overlay last string, restore last st ring and scip.current string tl cluster_p-)»ork_string * tenp_uork_string; r)usier_p- >«ork_sran.sran_nun - tenp_«ork_sfan.sran_nun; cluster..p- >ι.ork_scan.le* >• tenp.uork_scan.len; for(x*H; x( tenp.uork.scan.len; x»* ) cluster_p-)uork_scan.ele_.entsCχ] -> tenp.uork.scan.elenentsCxl; over.status «- OVF.Rt.AY.BABf leι.p_string ■ cluster_p->strinfs[cluster_p- >nun_strings-l] ; clmter.p-Mtatus = tenp.statβs; scan.p = 4lβg_s[leg][tenp_ιtring. index!; elenent p - Israu p-lelenentsrtenp string. tart]; } 1 (overJ«»y_rerurce_roιιnt > KAX.RfiCϋRCR.π C /»__ could nπt re_ovfc..-γ last string, restore last string and scip_current string tl r)u«.tpr_p->«ork_string = tenp _«ork_st ring; rluster_p->«ork_scan.scan_nun = tenp_»ork_scan.scan_nui.; cluster_p->uork_scan.len = tenp_uork_scan.ien; fσr(x=&; x( tenp.uork.sran.Ien; ι**) cluster.p- >uork_scan.elenentstχ] = tenp_«ork_scan.elenents [χ] ; over_statu*i = 0VERLAY_8AD; tenp.string = cluster_p-)stringsCcluster_p->nun_strings-l]; scan_p = ileg_srieg3rtenp_string. index]; elenent.p = (scan p-)elenentsttenp_string. start]; ) else C oveιlay_recurce_counlH; . ) /t_.-over_stattts«OVFRI.AY_OFF_START--retry with updated It__ «ork_slring.end tl >»hile((over_status == OVERI.AY_OFF_START_RF.C) !! (over status == OVERLAY RECURCE)); ) else ( /t -if string does not fit into cluster, sbould it tt__ be killed (ls.cluster.old) */ if(cluster_is_oldJ kill dusterdeg, cluster p); 1 /t__-try next cluster / 1 uhile (get_next_cluster(leg, icluster.index, Icluster.p)); ) Kill this string open ny. neu clusters tl current.string = tenp string; do C cherk.rode * * /t__-gel free duster tl uhile ((get.free.clusterdeg, 4duster_p, 4string_j>)> kk It free duster tl (check code ( (2NHAX COBE TYPES-1))) ) { suitch (check.code) ( rase it /t__-I?5 F0RUAR5 tl check.code^; if(enabled _ode_typesCI25J »■ YES) { clusler.p-lopen.type •= 125; is.open.fordej, cluster.p, scan.p, tenp.string, elenent.p, string.p); break; } case Is /I..-125 REVERCE t/ check codeH; if(enab!ed_code.typesCI25] =« YES) c.ustpr_p-.open_type = )Z5; ιs_open_rev(leg, cl- ter_ρ, scan.p, tenp_string, elenent.p, •ϊtring., , current_stπng); break; ) case 2: /t__-C3? FORUARD XI check_code<+; ( hreak; ) r.--- *.; /J..-C39 REVERCE tl rheck.rode-nj if(enabled_code_typesCC373 == YES) { break; } case -t: /t__-COBF._A_BAR FORyARD tl check_code< * »5 if(enab.ed_code_typesCCODE_A_BARl « YES) C r ) usier_p-)ppen_typp - COBF._A_BAR; iε ^ open.fordeg, cluster.p, scan.p, tenp.string, elenent.p, string.p); break; case Si /t__-COPF_A AR VF. CF. tl check_codeH; if(enabled.code.typeβCCnθE_A_BARl »« YES) C cluster_p-)open.type = CODF.A.BAR; is_open_revdeg, cluster.p, scan.p, tenp.string, elenent.p, string.p, current.string)! break; ) case 4: /1..-UPCF.AK F0RHAR9 tl check_code**j if nabled.code.typesCUPCEAH] « YES) ( rluster.p->open_type «- UPCFAH; is.open.fordeg, cluster.p, scan_p, tenp.string, elenent.p, string_p); break; ) r*se 7: /t__-ϋPCEAH REVERCE tl check. e^; if(enabled_code.typesCUPCEAH] *= YES) f cluster.p- lopen.type • * ■ UPCEAH; is_open_rev(leg, cluster.p, scan_p, tenp.string, elenent.p, string.p, current.string); break; ) case fi« - . . * .. . C break; ) /t__-Cl?8 REVERCE tl check.coden-; if(enabled_co e_typesCCl28] == YES ) C break; ) _ Hhile(get. next_elenent(lelenent_p, Itenp.string)); /t__-opdate to next elenent, see if this neu string *— opens any clusters tl /t__done proc. all strings in this scan return to idlet/ roc_*ϊcan_indexCleglH; f (proc.scan.indexClegl >•= HAX.SCAHS) ror.sfan ndexDegJ - S; -. * » /t - f no neu scans to process, should any clusters li__ be killed (is.cluster.rold)t/ f( lustβrs_startClegl '- clusters.endClegl) rlαster.index = rlusters.startrieg}; rlusler.p - (struct cluster.struct t)(i(leg_cCleg3Ccluster_indeι3 ) ); string_p - Kcluster_p->stringsC((cluster_p-)nun_strings)-l)l); ifds.cluster.rolddeg, cluster.p, string.p)) kiIl_cJ*steτ(leg, cluster.p); FUKCTIOH: proc.next.scan RETURNS: TRUE/FALSE sets up STRI C.P for neu string PFSCRIPTJOK: -are there scans to process for current leg " */ ft boolean proc_next_scandβg, tenp.string.p) ister int leg; ister struct string.struct ttenp.string.p; (proc.scan.indexClegl !«- scan.indexClegl) It is there scans to proceic tl "•np.string.p-Hndexs pror.sran.indexFlegJj/t init string for first string tl pnp_slπng_p-)end r -1; enp trtng " p-)start= ST.SP.UHKNOyH; etαrn (QVERLAY.COOD); se etur (OVERI.AY.βAD); FUKCTIOH: get.nezt string tei.p_ftnng_p-.end start el nent_o DESCRIPTION: -get next string in current string .-/ 1 boolean gel_iιext_string(scan..p, elenent.p, tenp_string. l urfc -.ran_struct **.can_p; act elenent_struct tlelenent_p; tr i st r ing.Ft rurt ttenp_string_p; gt-iter tnt tndex; cμster struct elenent_struct Ipt; iJe((ienp_strJng_p-)pnd ' ?.) ( sran_p-)len) tenp_string.p-)end ♦ 2; ϊelenent_p) = 4(scan_p-)elenentsCindexl); i = * teJenent.p; lile (pl-)rel_pos != %) index ; <m- **np.strjng_p-)end - --index; f((tenp string_p-)end - tenp slring_p-)start) )= <HIH_QVERI.AY~» HIH.HATCH * ' ?.) ) return (TRUF); turn (FALSE); FUKCTIOH: string_fits_in_duster RETURHSJ TRUE/FALSE string.p DESCRIPTION -does current string fit into current cluster l •_ boolean strlng.flts.in.clusterdeg, elenent.p, cluster.p, tenp.string.p, string p) 1*1? ict elenent.struct telenent.p; net cluster.struct *cluster_p; ict string.struct ttenp .string.p; ■ri stTing.strurt «stτing_pj ict elenent struct tls, tie, tcs, tee; U, ct; -.tπng.p) = Mc lust pr_p-)stringsr( (cluster.p- Inun.stringβ )-!)]); = (leg.sCleg1C(*string_p)-)indexl.tar_tine); - (strurt elenent_struct t) (leg_sCleg]C(tstring_p)-)indeχ].elenents); * 4 C(lstring_p)-)endl; -■ llsC(tstring.p)-)startl) * Is «■ 4.r)«stpr.p-)«ork_sran.elei.entsrrluster_p-)last_natcl_.J; - - - (leg_sr)eg.irienp_string_p-)jι * ι χ]itjr_tJne); - (-"true*. el-.nent_-itri.ct X ) (leg sCle tenp_string_p-) inde l.elenents); - J.csπenp_r.tπng_p-.end3; - icsttenp_string_p-)starl3; ((ce-)rel oos < l*»->rel pos - ERR0R_RE POS - HAX_CHANGE_REL_PQS> !! (rs-.re. pos > )e->re)_pos < F.RROR_REI._POS * HAX_CHAHGE_REL_POS) I! ((ct - It) > I) ) eturn (FAISF.); te eturn (TRUE); FUKCTIOH: trin RETURHS: tenp_string_p-)start el nent_p DESCRIPTION: -trin current string according to *ork_string Jl i trindeg, scan_p, cluster_p, tenp_string_p, elenent.p) leg; uct scan.εtruct tscan.p; uct cluster.struct tcluster_p; uct string.struct Itenp.string.p; urt eJenent.strect telenent_p; r.p.start, nax.rel.pos.over; change.rel.pos, index; urt sran.struct told.scan.p; uct elenent_struct tlatt_elenent_p, told_elenent_ρ; net string.struct istring.p; ring_p «■ Kclusier.p-liiork.string); d.scan.p = Kclufter.p-luork.scan); d_elenent.p - * old.scan.p-lelenents; (cluster.p- )status « DF.COJ.EJHl*) hange.rel.pos - (duster.p-lchange.rel.pos ♦ ERROR.CHAKCE.REL.POS ) (scan.p-)scan.nun - old.scan.p-lscan.nun)? se hange.rel.pos •= HAX.r.HAKCE.RF.L.POS t (sran.p- )βran_nun - old_scan_p-)scan_nun); (cluster.p-)string.dir == FORyARD) ..siart - oJd.elenent.pfstring.p-Jend]. rel.pos - cfcange.rel.pos - ERROR.REL.POS; f((cluster_p-)status « POSS.OPEH " ) ! f (cluster..p-)cljange.rel_pos =* HAX_CHAKCE_REL_POS) i! nax_rel_pos_over «• r.p.start ♦ (4tF.RR0R_RF.L.P08) ♦ change.rel.pos; lse " nax.rel.pos.over » r_p_start » (ZtERROR.REL.POS ) ; se rhang _rel_pos ♦ F.RROR.Kt .fUS; r'((cluster_p->status =- P0SS_0PF • ',', ιr)u<.tpr p-.r ange_rp]_pos == X_r.HAKCF_RFl._POS) !! (cluster_p->status --- OPEH) ) - p start = ftθi_rel_pos_over - change.rel.pos - (4*ERR0R_REL_P0S ) ; _p_slarl = «ax_rel_pos_over - (?tERROR_REL , POS ) ; iex = .enp_string_p-)start; i_p)pnpnt_p = p)pnpnt_pn; .dex» «-t_p)pnent_p = elenent.p**; ) Jle((eJenetιl_p->rel_pos ( r..p_start) kk (elenent p-)rel pos != β) »! p)eneni_p->rp)_pps == ) •np.stritig.p- .start - index *» ]; ;- _np_string_ρ->start = index; )e((p)enent_p->rel_pos <= nax_τel_pos_over) 44 (elenent.p- )bar " > KIK COUNT) kk (elenent.p-)space ) KIEH.COUHT) ii (elenent_p-)rel_pos ! * ■■ •) ) . l ; .enent_p»n (elenent_p-)rel_pos !« • I) 4 (elenent.p->bar " > HIH.COUKT) 4 ( elenent p-)space ) HIH COUKT) idexπ; .βnent. ; nent.p - last.elenenl.p; ιp_string_p-)end = index; FUHCT10H: is.cluster.old RETURHS: TRUE/FALSE DESCRIPTlOHi-is cluster old based on proc_scan_index(flags ) tl i boolean is.cluster.olddeg, cluster.p, string.p) leg; :ct cluster.struct Icluster.p; rt string.sirort tstring.p; ict scan_struct iscan.p; lo«_kilϊ_li_.it, high.kill.linit; >n_p •= ( struct sran.strurt t)(4(leg.sFleg]Fpror_scan_index[leg2])); *• h_ _ -- . = -r.--_-- ---τι_-ιιrι t ; - - . ( (rJtιstpr_p->ι*ork_pran.sran_ .. ( Uoti.kil J.linit )) !! (cluslpr_p->«ork_scaiι.scan_nun ) (high_kill_linit )) ) ) turn(TRUE); P turn(FALSE); FUKCTIOH: is_cluster_rold RETURHS: TRUE/FALSE DESCRlPTIOHr-is cluster old based on scan.count ( scans ) tl boolean is c.usler. roJddeg, cluster.p, string_p) leg; ct cluster.struct Icluster.p; rt string.strurt tstring.p; lou_kiU_linit, high.kill.linit; _kJl)_Jinit = sran_countrieg3 - %?.- h_kill_linit = scan.countClegl ♦ 82; ( ( (r)uster_p-)i(ork_sran.sran_nun ( (lou.kill.linit)) I! ( clιster_p-)Mork_scan.scan_nun ) (high.kill.linit)) ) ) turn(TRUE); e tuπ.(FALSE); FUKCTIOH: kill.cluster RETURHS: DESCRIPTIOHi-kill clusters after they are deternined to be old tl kill.clusterdeg, cluster.p) leg; ct cluster.struct Icluster.p; act duβter_struct *tenp_cluster_p; count; p.cluster.p =(struct cluster.struct l )( 4 ( leg_cCleg3Cclusters_startCleg3I)); :)«.st p r_p->stalus !- POSS.OPEH) lt__-ii still bad cluster log KILL.CLUSTER t/ g_error(KILL_CLUSTER)? ster_p-)status - •; nt = clusters.starttlegl; le( ( tβnp_cluster_p-)status " I ) 44 (count != rlusiers.endrieg]) ) ftp_cluster.p*>; unf i *; (count )= HAX CLUSTERS) fount - ft; — 92 — ιenp_c]ustet_p -"(struct duster • ruct S )(&( leg. cCleg3C β 3 ) ) ; isters startDegl r rount; FUKCTIOH: get_next_cluster Rr TURNS: TRUE/FAI SF. cluster. index cluster_p " DESCRIPTIOM: -gets ' next cluster that is used . / ,n boolean gpt_next_cluster(leg, duster.index, cluster.p ) jtster int leg; • ister int *cluster_index; ister struct r)ιιsipτ_strurt ttcJupter.p; icluster_indeι)H; tcluster_p)H; (*r)us<pr_index )= HAX .I.USTFRS) 3cluster_index) = β; icluster.p) - (struct cluster.struct l)(4(leg_c[leg]Cβ])); (tcluster_index ! r clusters.endClegl) eturn (TRUE); se eturn (FAISF.); IUKCTIOK: get free cluster RETURHS: TRUE/FALSE cluster.p string.p , ~ DESCRIPTION: -get " next duster that is free ._*/ in boolean get_free_clusterdeg, cluster.p, string.p) isier int leg; ister struct cluster.struct tlcluster.p; άster struct string.struct t*string_p; rJuster.end; uster.end - tlusters.endCleg]; .uster.end H; ( cluster.end )« HAX.CLUSTERS) lusier.pnd • * • f; ( cluster.end - clusters.startElegJ) icluster.p) = (struct cluster.struct t)(4deg_cCleg]Cclusters_endCleg]])); tstring.p) = <trluster_p)-)stπngsj tclusler_p)-)stattts - STATUS.UHKHOUH; Icluster.p )->open.type » CODE.TYPE.UMHOIJH; Icluster.p )-)open.βtart_stop « ST.SP.UKKKOBK; tr)usier_p)->string.dir « - HR.HKIKOKH; tcluster.p)-)nun_strin|s « * β; lcluster p)-)change rel pos » •; eturi (TRUE); - - <_g_error(FULL.CLUSTERS); piwrn (FAISE); FUKCTIOH: use_free_clusler _ RETURHS: DESCRIPTIOH: -use free cluster gotten by get_free_cluster JI i use. free_cluslet(leg) ister int leg; ;ιsiers_pndrieg3H; (clusters.endClegl >= HAX.CLUSTERS) lusters_endClegl-β; FUHCTIOKt get_next_elenent RETURHS: TRUE/FALSE ltelenent_p ttenp_string_p->start DESCRIPTIOH: -updates pointer to next elenent within current string JI Λ boolean get_next_elenent(elenent_p, tenp_string_p) irt elenent.struct tte)enent_pj ict string.struct ttenp.slring.p; ( find.code « TRUE) ϊnp_striiιg_p-)slarl**; telenent.p)**; * -e ϊnp_string.p->start**f !e)enent_p )»*5 *hile(tenp_string_p-)start ( tenp_string_p-)end ); ( ( tenp_string_p-)start (= tenp_string_p-)end) ) stum (TRUE); " -f ?luιn (FALSE); FUKCTIOH: dec.linear RETURHS: BESCRlPTIOKx - l ] dec ineardeg, cluster.p, scan.p ) leg; jet cluster.struct tcluster_p; irt sran_st rart tscan.p; act el«nent_struct $tenp_elenent_p; len, x, box; .nn ιng_ or r us pr.p == - ( ( σ i = gel.boxϋeg, cluster. ■ ' ! **■ 255) " ϋn_conpnuf(bflx, rluster_p, 3 ) / FUKCTIOH: js_open_for RETURHS: OESCRIPTIOH: - XI is_open_for(leg, duster_p, scan.p, tenp.string, elenent.p, string_p ) leg; ict cluster.struct *cluster_p; ri sr<m_5-(rur. tεran_p; ct string_struct tenp_string; ict elenent_*ϊtruct telenent_p; ict string_struct lstring_p; ct string.struct iieu.string; len, x; i boolean is.open; .string - tenp.string; tch (cluster _p-)open_t) * pe) s.open - is_J2S_open_for(cluster_p, 4ne«_string, elenent.p); eak; * eak; se COSE.A.BAR: s.open r is cod open for luster p, 4neu string, elenent p); eak; se UPCEAK: s.open - is_upc_open_for(clusler_p, 4new_string, elenent.p); * eak; ■ se C128: (is.open) /t__-yes, initialire and use clusters tl itring_p = neu.string; uister_p-)uork_sran.sran_nun s sran.p-)scan.nun; luster p-)work scan.len= tenp string.end - tenp string. start ♦ 1» .uster_p-)uork_sirJng = neu.string; 'ustet.p-liiun.strings**; luster_p-)uork_scan.elenentsCil.bar = 8; luster..p->uork_scan.eleneatsCI]. space = I; luster.p-luork.scan.elenentsriD. rel.pos s β; ?n --cluster.p-luork.scan.len •» 1; ιi pr_p~.wor»._- * c,ιn.pjenents_ ] .ι.open_type = c. u5tPr_p->open_ιype; ; uf-t r _ - )avr_tϋr_( inp = sran_p->tac_tjne; uster_p-)deplh = scan_p-)depth; uster_p-)ol*1_«ork_strιng = cluster_p-)trork_string; ustpr_p->old_uork_sran.sran_nun = cluster_p-)uork_scan.sran_nun; uster_p-)oId_uork , scan. len = cluβter_p-)«ork_scan.Ien; .rd-fl; x< cluster_p-)uork_scan.len; x+») :luster.p->old_ιιork_scan.eϊenentsCx3 = cluster.p- Jwork.scan.elenentsCx ] ; c ineardeg, cluster.p, scan.p); FUHCTIOHi is_open_rev RETURHS: DESCRIPTIOHi - tl is_open_rev(leg, cluster.p, scan.p, tenp.string, elenent.p, string_p, current.string) leg; ri r ιsler_strκci Icluster.p; ct scan.slruct tscan.p; ict string.struct tenp.string; :ct elenent_struct lelenent.p; ri string.strurt Istring.p; cl string.struct current.string; :ct string.struct nβu_string; Jen, x; boolean is.open; .string - tenp.string? tch ( cluster.p-)open.t pe) te 125: s.open = is.JPS.open.Tevtduster.p, 4neu_stτing, elenent.p); eak; >se C39: " eak; s.open = is_cod_open.rev(duster_p, 4neu_string, elenent.p); eak; se HPCEAH: s.open ' is_upc.open_rev(cl«βter_p, 4ne«_string, elenent. ); -eak; ()-._oppn) It -γ~.- t > ni t i a J j 7e jnd use rlustprε XI string.p - new.string; iu*iter p-)work_- * ri.n.scan_nu(. = scan_p-)scan_nun; iιi" * tpr_p-)ι.ork_sran.)pn : - tenp_stπ ' ng. start - current.string. start ♦ 1; -u*-.ter_π->¥ork_'.tring = ne«_string; luster_p-)nun_strings+*; -xt • rluftpr_p-) * (ork_sran.)en < ?ncpy(4clusteτ_p- )uork_scan.elenentsEKAX_ELEHEKTS - (len ♦ 1)1, 4scan_p-)elenentsEcurrent_string.start-n, len ) ; luster_p->*ork_scan.elenentsCHAX_ELEHEHTS-13.bar = β; )ns(pr_p->uork_sran.e)enentsrHAX_F.IFHFKTS-l]. space = β; ]uster " p-)ιrork_εcan.e]enentsCKAX_ELEKEKT8-π. rel.pos -= I; luster_p-)work_scan,elenentsCHAX.EI.EHEHTS-l-ll.open_type = cluster_p-)open_type; ) us(pr_p-)uork_string. start - neκ_string. start ♦ (HAX.ELEHEKTS - neu ' string.end - 2); luster_p-)last_natch = cluster_p-)»ork_string. start; luster_p-)old_last_natch = cluβter_p-)last_natc ; iιιster_p->«ork_str>ng,end = (HAX_EfEHF.KTS - ?); ]usler_p-)change_ιel_pos - HAX_CHAKCE_REL_POS; luster_p-)avr_tac_tine = scan_p-)tac_tine; luster.p-)depth = scan_p-)depth; Jυsier.p-lold.uork.siring - cluster.p- luork.string; luster_p-)old_«ork_scan.scan_nun = cluster.p- luork.scan.scan.nun; luβter.p-)old_«ork_scan.len = cluster_p-)«ork_scan.len; ιr(x=S; x( rluster.p-luork.sran.Jen; x*«) :luεter_p-)old_ι»ork_scan.elenents£x3 = cluster.p- >«ork_scan.eIenentsC χ ]; • * e_ f ree.cluster ( le ) ; sc.lineardeg, cluster.p, scan.p); Iuster_p-)roderβ3=l; s * , U. * .6»r Nar-ies l-F-F C") Queue?: SE " 'ER-4/F'RTK , T ( 3_.0 i*-i. I I- WERI... . C ' Server: SE.- ΕR4 D.-?τ,c: i- 1. a • •* on :; O ERL Y .. C SFPTFHT ' iFR .1 .- .1990 11 = 10 an FFFEF FFFFF FFFFF J E F F •J E F F J EEEE FFFF FFFF J F. F F -J J E F F ....... EEEEE F F tt*:*.)}..*.*:*:**.**^ V EEEEE RRRR L V E R R I V E R R L V EEEE RRRR L V E R R L V F. R R I V EEEEE R R LLLLL • •/ / '&•_/'_{ •{ ■ _/^'_ / ^ls»_ ^*_{%_ *t*»_ - - tl PRX TF HHOinCY WITH DSP-IKS 3? β C3 β Copyright (c) 199B Accu-Sort Systems, inc. AU right? reserved. chide "row. ji" elude 'coBh-ext' FUNCTION: overlay RF.TIIRKS: cluster_p-)«or _string «ork_scan string_p-)end PF.SCRJPTJON: - Jl ■t overJiiy_rpsppnce overIay(scan_p, string_p, cluster.p) uct scan slrucl tscan_p; uct <.tring_*-truct tstring.p; uct cluster.struct Icluster.p; ister struct elenent.striict tpl, tp2, tp3, tp4; index, nax_rel_pos,i,j, change.rel.pos, qq.natch, fron.start, left.index, t.index, t_fron_start, jstop, len, t.len, scans_skipped, x, up.vork; .irt elenent -trttrt ttl, tt2, $t3, tt4? ict elenent.slrucl lnork.elenent.p, Inen.elenent.p, oJd_p3j ( luster_p-)string.dir == FORyARO) •^..-overl y in fornard dir tl l"-_ork_eleι.ent_p - (l(cluster_p-)nork_scan. elenentsCcluster_p-)«ork_string.end])){ 2 * -nM_elenent_p = (4(scan_p-)eleneι.tsCstriι>g_p-)start3)); 'x.reJ.pos = 5ran_p-)e)eMntsrstring_p-)end3.rel_pos; .(.natch -• %- ron_*?tart = β; f ( string_p-)end >- ftring_p-)flart) /t__-does prior KIK_OVF.Rl.AY eJenents of »ork_string.end /t__ natch Mith ne« string tl index = β; left_index = β; j f( ϋf._sin_«id(h((pj-)har ♦ pi-)spare),(p?-)har ♦ p?.-)space)))) do ( left_indeχt»} ifdeft index == H1K OVERLAY) C r>~ = pl; p4 • ■ p2? ) p---; - 100 - ..while* (Js_siΛ_Midth((pl-)bar . pl-)space),(p2-)bar ♦ p2-)space ) » ) 44 u<-_sιn_tπ*.tl.(<pUU.h - p.-)space),(p2l_U.bar ♦ p*.->*.pace) ) ) 44 ( pl->rel_pos != β) 44 ( p?->reJ_pos !- 9) >ϊ ι f(left_index >= H(H_0VERIAY) r /J__-doep at Jeasi (he next KIN ATCH elements of IX _ *o.k_string.end natch with the ne« string XI while( » pl-)space),(p2-)bar * p2-)space ) ) ) 44 » pU-U.space),(p2-)bar ♦ p2C-13.space) )) 44 ( p2-)bar ) HfN.COUHT) 44 ( p2-)space > HIH.COUKT) ) ( index. *; pl*t| ) jf( (( Jpfi.index * index) > (qq.natrh)) 44 (index ) = HIH.MATCH) ) £ Jen -- r )* .ster_p-)«ork_string.end * index*!; Nhile( ( p2-)har ) KIH.CIHIHT) 44 ( p?-)space ) HIH.COUKT) ) { l a"; H; ) ς natrh - left index *> index; 11 - pl; t2 = p2; t3 = p3; i< - p4; l_index - index; t_fron_start = fron.start; t_len -• len; ) ! /t__-upd*te neu to next elenent, search for best fit tl fron_starto; n w_elenent_pH; jl - work.elenent.p; ι?. - ne«_elenent_p| ώilei (p2-)rel_pos r nax.rel.pos) 44 (p2-)rel pos != I) >; ridex * t.index; ?n - l.len; - - /t__-?iring d... not ovprlay XI π(dusleι_p->slatus -= P0SS_0PEN) cluster .p->change_rel_pos = HAX_CHANGE_ EL_POS; rlur-tpr_p- >] j-f-t _natr = dusier.p- >κork_string.end; duster_p-)stalus = DECODEIHG; return(OVERI*AY_OFF_START_REC); } f(r)υ er_p-)?ii»tu5 == OPEH) /*__-] ' f siatus - OPEK update trork.string.end, status = ll__ DECODEIHQ, return OVERLAY_OFF_START_REC tl clu*iter_p->i(ork_*fltring.end = cluster_p-)last_natch - HTH.HATCH-1; duster_p-)statύs = DECODEIHG? reiwrιι(OVFRl.AY_nrF_START_REC); ) C /t__-else wor .string. end ** tl if((clusteι_p-)uork_slring.end - clusler_p-)*ork_string. start) ( ( luster_p-)work_scan.len - 2 - HIH_HATCH)) C dwstpr_p->Bork_string,endM; return(OΫERLAY.RECϋRCE); } else ( cluster.p- )old_Bork_slring.endH; clβster_p-)»ork_string - eluster_p-)old_κork_string; rl«ster_p-)w(irk_sran.sran_nun = duster_p-)old ιork_scan.sc#o_nun; cluster.p- >Nork_scan. len = cluster_p-)old_«ork_scan.len; for(x=#; x( cluster_p-)old_ι»ork_scan.len; x++) cluster_p->κork_scan.elenentsCχ] = cluster.p-)old_«ork_sc».elenentsCx-l; rettrn((lVF.RIAY_RF.CnVER); ) } se il - tl; _2 ■ - 12; <- - i ~ - .4 - 14; ιf( ( (duster_p-)tιork_slring.end ♦ index) ( (duster_p-)Iast_natch-2) ) i! ( len ( (cluster_p-)«ork_scan.len-2)) ) ) ;lse up.voik r 1; ) (..-if status •= POSS.OPEH or OPEK set ellenents used /t__ in open pattern and calculate change.rel.pos tl if( ( (cluster.p- )status « POSS.OPEH) !! (up_κorx == U - 102 - ) f pl = k-lU HIH. OVERLAY-i)]; -?. - ~7SΛ M ( N_nVERI.AY-t ) l; whi)e((p.-)reJ_po? != )kk IX set open_type in elenent XI (p2->rel.pos !• β> ) C if( p)-)open_type !- d) p?.-)open type = pl-)open type; .ol--; P2"5 ) ) /t__-tιpdate cluster infornation XI dusler_p-)t_ork_string.index = string_p-)index; if(up.work) clusler_p-)lasl_natch = cluster.p-)«ork_string.end ♦ index; "hange.rpl.pos = (p3-)rel_pos - p4-)re)_pos); if(uρ_«ork) C j f(avr uork) ( o)d_p3 * tp3; tp3 • * ■ tp4; IX set-up neu uork XI p3-)bar = (nld_p3,bar ♦ p3-)bar)/2; p3-)space = (old_p3.space * p3-)space)/2; ) else tp3 = -tp4; It set-up nev work tl J else C p) A- π 3; p2 - p4; } jstop-index » HlK.OVERLAY-l; index *■ I; i ~ do C in exH; p*!*; p4»»; if(p3-)rel_pos == β) jstop - β; if((jstop !-- β) ii (p4-)rel.po5 !<= t)) C jstop--; change.rel.pos *■ change.rel.pos ♦ (p3-)rel_pos - p4-)rel_pos); if(up.nork) if(avr_work) ( old.p3 • * tp3; tf~ «• tp4; It set-up ne« uork tl p3-)bar • (old_p3.bar ♦ p3-)bar)/2; p3-) pace = (old p3.space ♦ p3-)spa*.e)/2; } )se - - else κhile(p4-.)rel_poς != «); f((«.rans skipped = ( * -can_p-)5ran_nun - duster_p-)«ork_scan.scan_nun )) != β) if(duster_ρ-khange_rpl_pos == HAX_CHAHCE_REL_POS) • :luster_p->change_rel_pos = ((change.rel.pos) / (j)) / scans.skipped; else r)u«-(pr_p->rhange_rpl_pos = ((rluster_p-)change_rel_pos ♦ change.rel.pos ) / (j H)> / scans.skipped; f(up_work == β) 3 = pi; P4 - p?; κhile(p3-)rel_pos != β) C p3-)re)_po5 = p3-)rel_pos - duster_p-)change.rel_pos; f .34.; ] uster.p- )κork.sran.sran_nun - scan_p-)scan_nun; (up.work) luster_p-)*ork_scan.len = cluster_p-)work_string.end ♦ index - KIH.OYERLAY; f(r)«ϋter_p-)status == PF.CODF.IHC) /l__-if status = OECODEβlKC, update vork.string.end / f(cluster.p-)t»ori._stri*g.e»d ( cluster_p->last_natch - HIH.HATCH - I) d»ster_p- ) ι.ork_siring.end = r)«ster_p-)last.natch - HIH_HATCH - 1; eturn (TRUE); /t._-overlay in reverce ir tl =ι.ork_elenent.p * (4(cluster_p-)ιιork_scan. elenentsCcluster_p-)Hork_string.start])); -ne«_e)enent_p = (Ksran.p-)elenentsfstring_p-)start3)); i. rel.pos • * scan_p-)elenehtsCstri*g_p-)end]. rel.pos; .natch = I; on.start = β; (string.p- >end )= string_p-)start ) /l__*does prior H1K.0VFRI.AY elenents of uork.string.end lt__ natch with new string */ ndex - β; eft.index - β; f((j5_sin.«idth((pl-)lιar ♦ pl-)space),(p?-)bar ♦ p2-)space)))) do ( left.index+f; ifOefl index « KIK OVERLAY) C p3 * - pl; p4 -• p2; * - - ?<-••; iwhi le( (.s_«.ιn_« d(h((pi-)bar . ->space),(p?-)bar ♦ p2- ) spare ))) ii (is_sιn_ftfidth((pl-)bar ♦ pJC-13. space), <p2-)bar ♦ p2C-π. space) ) ) ii ( pl-)rel_pos • = β) ii ( p2->rel_pos != β) i; • .fdeft.index >= HIH.OVERI.AY ) p) = i«ork_p)pnpni_pr-J]; P? - ■ ineκ_elenent_p[-π; /ϊ__-does at Jeast the next HIH.HATCH elenents of lt__ κork_string.end natch with the neu string tl whUe< (i*i_sin_«idth((pl-)bar ♦ pt-)«.pace),(p2-)bar ♦ p2-)space ))) ii <is_sin_«idth((pim.bar ♦ pl-)space),(p2C13.bar ♦ p2-)space ))) ii ( pl-)τel_pos != *) kk ( p2-)rel_pos != i) i ( p2-)bar ) HtH_ OUHT) ii ( p2-)sρace > HIH.COUKT) ) { indexπ; pl--; • ?.- ■ f((( Ipfi ndex ♦ index) >= (qq.natrh)) ii (index >* HIH.HATCH) ) Jen - HAX.EIFHEKTS - r)uster_p-)*ork_string. start ♦ 1 ♦ index; «hile( ( pl-)rel.pσs ! = •) ii ( p2-)rel.pos != ) kk ( p2->bar ) HIK.COUKT) ii ( pλ-)space ) HIH.COUKT) ) £ Jenπ pl-; p2-j ) qq natch = left index ♦ index; tl -. pt; 12 - p2; 13 - p3; " P<? ...index = index; t.fron.start = fron.start; /t__-update neu to next elenent, search for best fit t/ ron.stattH; ιeκ_elenent_p*t; ~ »ork_elenent_p; ?. - nen.elen nt.p; .hile( (p?-)rel_pos (= nax.rel.pos) ii (p2->refpoi !■ β) " idex ' t.index; - - ■ *f(qq_natch ( HIK. QQ) It -string did not overlay XI if(cJusler_p-)status = * ■ POSS.OPEH) ( cluster.p- >change_rel_pos = HAX_CHAHCE_REL_POS; rJustpr_p-))3si_natrh = f)uster_p-)(_ork_string. start; cluster " p-)slatuε = PEC05E1K6; return(OVERI.AY_OFF_START_REC); ) )f(r)u5(er_p-)staiu« ; =- OPEK) C /t -if status = OPEK update nork.string.end, status = tt__ PEC0PEIK6, return OYERLAY_OFF_START_REC tl cluster_p-)«ork_*, * trϊng.start = cluster_p-)last_natch ♦ HIH.HATCH ♦ 1; cluster_p- ) statύs = DECODEIHG; r p <urn(OVERLAY OFF START RFC); } slse C /*__-else *ork_stπng.start -- tl if( ( clusler_p-)work_slring.end - cluβter_p-)«ork_string.start ) ( (cluster_p-)κork_scan. n - 2 - HIH.HATCH) ) c- r)usier_p-)_.ork string.start--; retum(OVERLnY.RECURCE); ) else ( cluster.p- )old_*ork_string . start--; cluster_p->work_string * ■■ cluster_p-)old.ιιork_stτtng; clusier.p- ) «ork_sran.sran_nun - cluster_p-)oJd_uork_sca«.scan_nun; cJusler.p-lwork.scan.Ien = cIuster_p-)old_«ork_εcan.len; for ( x= β | x ( cluster_p->i)ld_»ork.scan.len; x**) cluster.p- )work_scan.elenentsEχ] = cluster_p-)old_«ork_scaβ.elenentsCx3; reiurn(OYERIAY_RE(.OWR); 3 l * tl; p2 * = t2; P3 = ( 3; -A r t4; if( ( ( duster_p-)ιιork_string.start - index) > (duster_p-)last_natch*2) ) !! ( len ( (cluster_p-)κork_ < .can.len*2)) ) ( up.uork - β; ) else f ) pl=p3; It__-ii status « = POSS.OPEH or OPEK set ellenents used . - _ . . _ . _ }' p)«.e tp3 -. tp4; ) else ) ' f (up work) tp3 ~ - tp4; )«hile(p4-)tp]_pos != β); if((scanε skipped - (scan_p-)scan_nun - duster_p-)work_scan.scan_nun)) != 8 ) if(cU-,ter_p-)change_rel_pos == HAX_CHAKCE_REI._POS) cluster_p-)change_rel_pos = ((change.rel.pos) / (j)) / scans.skipped; else cluslpr_p-)change_reI_pos = ((cluster_p-)change_rel_pos ♦ change.rel.pos) / (j »D) / scans.skipped; i f (up work == H) C 3 - -'> ■ f.4 - - p2; while(p3-)rel_pos != β) £ p3-)rp).pos = p3-)rp).pos < duster.p-Jchaβge.rel.pos; p3— ; p4 » ; ) ) r)uster_p-)«ork_sran.sran_nun - scan_p-)scan_nun; if(up.woιk) cluster.p-lwork.scan.len = HAX ELEHEHTS - clustβr_p-)work string.start ♦ index - I - HIH.OVERLAY; if ( duster p-Jstalus == JECODEJKC) C /* -if status = BECOBEJIHC, update nork.string.end tl if ( cluster_p- ) work_string.start ) duster.p-llast.natcϋ ♦ HIH.HATCH ♦ I) c ) ιιster_p-)«ork string.start - cluster.p-)last natch f HIK HATCH ♦ 1; ) return (TRUE);

Claims: - 108 - CLAIMS WHAT IS CLAIMED IS: 1. A scanner for reading machine-readable code on an object, comprising: scanning means for repetitively scanning said co and for providing a scan signal repetitively corresponding to at least fragments of said code; data means coupled to said scanning means and responsive to its scan signal for repetitively storing said scan signal; and registration means coupled to said data means for reconstructing at least a portion of said code from at least two of said fragments of said code by relatively shifting them until they are in registration. 2. A scanner according to claim 1 wherein said code comprises a plurality of data bits and wherein said data means i operable to store one of said fragments of said code, provided its length exceeds a predetermined number of data bits. 3. A scanner according to claim 2 wherein said scanning means comprises: a source for producing a beam of light; and deflecting means for tracing said beam across sai object in an "X" shaped pattern. - - 4. A scanner according to claim 3 wherein said "X" shaped pattern is traced at staggered repetitive positions. 5. A scanner according to claim 4 wherein the staggered repetitive positions of said "X" pattern are centered on the vertices of a triangle. 6. A scanner according to claim 2 wherein said data means includes: common memory means having dual independent ports for transferring data, one of said ports being coupled to said scanning means for receiving and storing data bits in response t said scan signal, the other one of said ports being coupled to said registration means, said registration means being freed fro the task of repetitively storing said scan signal in said common memory means. 7. A scanner according to claim 6 wherein said code comprises a plurality of intervals including bars and spaces eac having either a narrow or wide interval width, and wherein said data means comprises: narrow means coupled to said scanning means for measuring said narrow interval width and storing it as a narrow width value, said registration means being operable to shift and compare said fragments of said code, provided each has about the same narrow width value. - 110 - 8. A scanner according to claim 7 wherein said data means comprises: position means coupled to said scanning means for measuring within a scan of said code the position of the last valid one of said intervals and storing that position as a scan position value, said registration means being operable to shift and compare said fragments of said code, provided each has about the same scan position value. 9. A scanner according to claim 1 wherein said code comprises a plurality of intervals including bars and spaces of either narrow or wide interval widths, and wherein said data means comprises: quantizing means for measuring the interval widths of said intervals and providing a discrete ratio signal signifying whether the ratio of the last measured one of said interval widths to a prior one of said interval widths is about one, one-half or two. 10. A scanner according to claim 9 wherein said quantizing means comprises: look-up means for providing three pairs of limit values corresponding to predetermined tolerances on said last measured one of said interval widths with respect to three nominal values centered around one (unity) , one-half and two times said prior one of said interval widths; and - - comparison means coupled to said look-up means for providing said discrete ratio signal at a discrete value corresponding to one of said three nominal values in response to the last measured one of said interval widths being within one of the three predetermined tolerances signified by said three pairs of limit values. 11. A scanner according to claim 10 wherein said data means comprises: pattern means coupled to said comparison means and responsive to its discrete ratio signal, said pattern means having two pluralities of states, each of said two pluralities corresponding to a bit pattern starting with a different binary value, said pattern means being operable to select one of said two pluralities in response to said discrete ratio signal providing a non-unity value; and register means for storing said bit pattern with an initial binary value determined by which one of said two pluralities of states is selected. 12. A scanner according to claim 11 wherein said pattern means is operable to end said bit pattern in response to the last non-unity value of said discrete ratio signal being the same as the immediately preceding non-unity value. - 112 - 13. A scanner according to claim 12 wherein said dat means comprises: scan means for counting the number of scans of said scanning means and storing that number as a scan number, said registration means being coupled to said scan means and operable to read said scan number. 14. A scanner according to claim 13 wherein said data means comprises: empty means for counting the number of- scans of said scanning means that fail to produce a valid code fragment and storing that number as a bad scan number, said registration means being coupled to said empty means and operable to read sai bad scan number. 15. A scanner according to claim 9 wherein said data means comprises: a first, second and third register coupled together to shift data from said first and second register to said second and third register, respectively, the first register being coupled to said scanning means for storing in response to said scan signal a value corresponding to the interval width of the last one of said intervals, said quantizing means being coupled to at least said first and third register to provide said discrete ratio signal by comparing the states of said first and third register. le. A scanner according to claim 15 wherein said quantizing means is initially operable for each scan of the scanning means to compare the states of said first and second register before said discrete ratio signal is first validly provided by the quantizing means. 17. A scanner according to claim 1 wherein said scanning means comprises: a source for producing a beam of light; and deflecting means for tracing said beam across sai object in an "X" shaped pattern. 18. A scanner according to claim 17 wherein said scanning means comprises: a rotating mirror; and a primary pair of non-coplanar mirrors, said non-coplanar mirrors being angularly adjacent from the optical perspective of said rotating mirror. 19. A scanner according to claim 18 wherein said scanning means comprises: a secondary and tertiary pair of non-coplanar mirrors angularly spaced from said primary pair, said non-coplanar mirrors of each pair of mirrors being angularly adjacent from the optical perspective of said rotating mirror. - 114 - 20. A scanner according to claim 18 wherein said primary pair of non-coplanar mirrors comprises: first and second contiguous mirrors positioned to form an obtuse angle as measured on the side facing said rotatin mirror. 21. A scanner according to claim 6 wherein said data means comprises: register means coupled to said scanning means for sequentially storing said data bits in response to said scan signal; address means coupled to said common memory means for pointing to a location in said common memory means for storing said data bits; and state means coupled to said address means for indexing it and changing the location to which it points, said state means being operable after a predetermined number of said data bits are validly stored in said register means to transfer said data bits in said register means to said common memory means at the location to which the address means points. 22. A scanner according to claim 21 wherein said code comprises a plurality of intervals including bars and spaces each having either a narrow or wide interval width, and wherein said data means comprises: narrow means coupled to said scanning means for - 115 - measuring said narrow interval width and storing it as a narrow width value; and position means coupled to said scanning means for measuring within a scan of said code the position of the last valid one of said intervals and storing that position as a scan position value, said state means being coupled to said narrow means and said position means for transferring said scan positio value and said narrow width value to said common memory means at the location to which the address means points in response to th ending of a succession of valid data bits arriving at said register means, said registration means being operable to shift and compare said fragments of said code, provided each has about the same scan position value and about the same narrow width value. 23. A scanner according to claim 17 comprising: zone means for measuring the distance between an object and said source and for providing a zone signal signifyin said distance; and focussing means optically coupled to said source for focussing it in response to said zone signal. 24. A scanner according to claim 1 wherein said data means comprises: counting means coupled to said scanning means for developing pluralities of counts responsive to said scan signal; - 116 - and means coupled to said counting means for compressing said pluralities of counts for storing and for reconstructing by said registration means. 25. A scanner according to claim 24 wherein said registration means comprises: means for digitally processing said stored scan signal so that one of said fragments provides a first portion o a digital code and another of said fragments provides a second portion of said digital code, both portions providing a registered middle portion of said digital code. 26. A scanner according to claim 25 which further comprises: means coupled to said registration means for decoding a reconstructed digital code. 27. A scanner according to claim 1 wherein said data means comprises: counting means coupled to said scanning means for developing pluralities of counts responsive to said scan signal for storing and for reconstructing by said registration means. 28. A scanner according to claim 27 wherein said registration means comprises: - 117 - means for numerically processing said stored scan signal so that one of said fragments provides a first portion of said code and another of said fragments provides a second portio of said code, both portions providing a registered middle portio of said code. 29. A scanner according to claim 28 which further comprises: means coupled to said registration means for compressing said registered pluralities of counts to digital form, providing a reconstructed digital code; and means coupled to said compressing means for decoding said reconstructed digital code. 30. A method for reading machine-readable code on an object, comprising the steps of: repetitively scanning said code and obtaining at least fragments of said code; repetitively recording said fragments of said code; and reconstructing said code from at least two of sai fragments of said code by relatively shifting them until they ar in registration. 31. A method according to claim 30 wherein said scanning of said code is performed by: - 118 - repetitively tracing across said object in an "X shaped pattern at staggered repetitive positions. 32. A method according to claim 31 wherein said code comprises a plurality of intervals including bars and spaces ea having either a narrow or wide interval width, said method comprising the step of: measuring said narrow interval width and recordin it as a narrow width value, the step of restoring said code bein performed among fragments of said code having about the same narrow width value. 33. A method according to claim 32 comprising the ste of: measuring within a scan of said code the position of the last valid one of said intervals and recording that position as a scan position value, the step of reconstructing said code being performed among fragments of said code having about the same scan position value. 34. A method according to claim 30 wherein said code comprises a plurality of intervals including bars and spaces of either narrow or wide interval widths, said method comprising th step of: quantizing the interval widths of said intervals when they are within predetermined ranges such that the ratio of - 119 - the last measured one of said interval widths to a prior one of said interval widths is about one (unity) , one-half or two. 35. A scanner according to claim 34 wherein the step of quantizing comprises: correlating three pairs of limit values corresponding to predetermined tolerances on said last measured one of said interval widths with respect to three nominal values centered around one (unity) , one-half and two times said prior one of said interval widths; and declaring a discrete value corresponding to one o said three nominal values in response to the last measured one o said interval widths being within one of the three predetermined tolerances signified by said three pairs of limit values. 36. A method according to claim 35 comprising the steps of: selecting one of two binary values in response to said discrete value providing either non-unity value; and recording a bit pattern with its initial binary value determined by the first non-unity value occurring in a valid succession of discrete values. 37. A method according to claim 36 wherein said recording of said bit pattern ends in response to the last non-unity value occurring in a valid succession of discrete - 120 - values being the same as the immediately preceding non-unity value. 38. A method according to claim 34 wherein said metho comprises the step of: recording values corresponding to the interval width of the last three valid ones of said intervals, the step o quantizing being performed by comparing the last and third to last one of said intervals. 39. A method according to claim 38 wherein the step o quantizing is initially performed for each scan by comparing the last and next to last one of said intervals before a third valid one of said intervals is recorded in the step of recording values. 40. A method according to claim 30 wherein the step o repetitively recording the fragments of said code comprises the steps of: sequentially recording data bits corresponding to the sequence of said code; indexing and pointing to an address for recording said data bits; and rerecording said data bits at the address after a predetermined number of said data bits are validly recorded. 41. A method according to claim 30 wherein said repetitive recording of said fragments of said code comprises: developing pluralities of counts responsive to said repetitive scans of said code; and compressing said pluralities of counts for storin and reconstructing. 42. A method according to claim 41 wherein said reconstructing is performed by: digitally processing said compressed pluralities of counts so that one of said fragments provides a first portion of a digital code and another of said fragments provides a secon portion of said digital code, both portions providing a registered middle portion of said digital code. 43. A method according to claim 42 comprising the ste of: decoding a reconstructed digital code. 44. A method according to claim 30 wherein said repetitive recording of said fragments of said code comprises: developing pluralities of counts responsive to said repetitive scans of said code for storing and reconstructing. - 122 - 45. A method according to claim 44 wherein said reconstructing is performed by: numerically processing said pluralities of counts so that one of said fragments provides a first portion of said code and another of said fragments provides a second portion of said code, both portions providing a registered middle portion o said code. 46. A method according to claim 45 which comprises th step of: repetitively processing said pluralities of count so that additional fragments are combined with said first and second portions of said code. 47. A method according to claim 46 wherein said repetitive processing comprises the step of: adding fragments to said first and second portion of said code until said code includes a beginning and an ending portion, providing a reconstructed code. 48. A method according to claim 45 which comprises the steps of: compressing a reconstructed code to digital form, providing a reconstructed digital code; and decoding said reconstructed digital code.

Inventors: CHALEFF EDWARD, COX JAMES, ECKERT CHARLES, LAPINSKI CHARLES, SCOTT WILLIAM, SHARPE JEFFREY G, SKOKOWSKI RICHARD, WURZ DAVID A, CHALEFF, EDWARD, COX, JAMES, ECKERT, CHARLES, LAPINSKI, CHARLES, SCOTT, WILLIAM, SHARPE, JEFFREY, G., SKOKOWSKI, RICHARD, WURZ, DAVID, A.
Applicants: ACCU SORT SYSTEMS INC, ACCU-SORT SYSTEMS, INC.
Application year: 1991
Main classification: G06K7
IPC codes: G06K7