We require some additional functions for use within the Cypress USB Host controller as per our recent chat (excerpts shown below) :
1. There exists on a mass storag device a csv file which contains perhaps 20,000 records, each having perhaps eight fields. We need a function which will generate a new file where every record has the same length, and we can specify the size of each field. Commas and quotation marks would have to be removed, and the fields padded with zero bytes.
2. We then need a function which will perform a binary search of this file for a specified string in the first field. The records will be ordered by the content of the first field. If a match was found the record would be returned to the Z80, otherwise we would nees facilty to insert a new record positioned to keep the records in order.
The buffer 4 size could be reduced to 1024bytes but it may be that we still needan extra 8K for the code!
In the CSV file each record (line) has a different length because the amount of text in any field varies from line to line and there are no padding characters.
It is much easier to implement a fast search if an field on any line can be accessed by a simple byte address calculation
Thus for a binary search you would first find number of bytes in the file using LSEEK and TELL - this would be a multiple of the record (Line) length.
We will specify the size of each field
Then the first field of the record at the middle of the file would be compared with the reference string
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
Cypress EZ-Host CY3663 Development for CY4640 RDK using cygwin.