This paper supersedes SPROGS Paper No 22.
There will be two types of library for SPROGS picture files (and film files). The first type will be the Font libraries. Each library will contain the picture files to define a particular font. File numbers will be used to distinguish between upper and lower case versions of the same font. There will be several font libraries, each one assigned to a different channel number. The second type of library will be the user's own picture file libraries. Here, the user may store, and access on later runs, picture files generated by the user's SPROGS program. A user may have several libraries, each one assigned to a different channel number. Also, a user may access another user's library if the appropriate traps have been set. This allows users to share picture file libraries.
Two libraries may be currently selected at any time during a SPROGS run. One of these will be a font library and the other may be one of the user's own libraries. Each library is a normal EDS file and can thus be assigned to a channel number. Selection of a library is made by choosing the appropriate channel number. Each library has to be assigned to a channel number at run time by the GEORGE macro which runs SPROGS.
Each library will consist of a directory which will be contained in the first block and a number of other blocks containing the picture files. Each block is 512 words long and the minimum library size is 2 blocks, 1 block for the directory and 1 for the picture files. The directory will be hashed on the real number which represents the picture file name and the picture file number. There will be 8 entry points to the hash table, but this number may be changed if it is not the optimum.
Each entry in the directory will consist of :
Real number representing the filename, File number, Address of the first word of the picture file.
This will occupy 4 words and so each library can only contain 128 picture files. The actual picture files will be stored sequentially from the beginning of the second block. When the last block is full the disc file will be extended by another block if there is any space available. The picture file itself contains information on its length and mode so this does not need to be repeated in the directory (see Fig I for an example of the layout).
There will be a special method for accessing fonts (see next section). If only one file is required from a library then the display routine GETFILE ('FNAME', N) will be used. This will cause the directory of library N to be searched for filename 'FNAME' with the current file number. If an entry in the directory is not found an error is reported. If an entry is found then the filename and file number are added to the file table. The filestore pointer of the file table is left blank. The backing store pointer has the library number and the backing store address of the first word of the picture file inserted into it. The actual picture file is not copied across at this time.
When DRA('FNAME') is executed, the file table is referenced. At the first occurrence, since the filestore pointer is blank, the backing store pointer is examined. This will contain the library number and address of the picture file. The picture file is then copied across to the filestore and the filestore pointer is updated. The DRAW then proceeds as usual. The backing store pointer is not erased since the picture file may be erased from the filestore at some point and then read from the library again. If the display routine GETLIB(N) is used then the backing store pointers for all the picture files in that library are added to the file table. Again, the actual picture files are not copied across until they are called by a DRAW command.
Any character, ie picture file, in a library may be accessed as described above. However, where fonts are concerned this method would not be very convenient. A standard font will consist of 64 picture files having a standard set of names, eg 'A', 'B', 'C', etc. The first 64 positions of the file table will be set up for this standard set of picture files in the most commonly used font. Each of the other standard font libraries will contain a set of picture files with the same names. When the display routine GETFONT(N) is executed, the 64 picture files from library 'N' will over-write the first 64 entries in the file table, if the filenames are the same. If it is not a standard font then the picture file names will be different and so the standard font will not be overwritten.
It would be very time-consuming to attempt to overwrite the filestore in the same way unless a fixed area is defined for fonts, eg the top end or the bottom end of the filestore. Each of these alternatives causes other difficulties (see SPROGS Note 8).
Lower case fonts are often required along with the appropriate upper case font. To keep swapping them every time the case changed would be very wasteful. It is therefore proposed that a lower case font will be in the same library as its upper case equivalent but distinguished from it by its file number. For example, 'A' is filename A, file number 1, while 'a' is filename A, file number 2. This will mean that the file table search for a lower case letter will be slower than that for an upper case letter.
A library is created by assigning an EDS file of at least 2 blocks in length to a channel number. The whole file is zeroed and it can then be used as a library. Picture files are added to the library by the display routine PUTFILE('FNAME',N). This will copy picture file FNAME across to the library on channel N. The EDS file must, of course, be trapped for writing. It will put an entry in the library directory pointing to the location of the picture file. It will also put an entry in the backing store pointer of the file table. The picture file will begin after the last word of the previous picture file. The directory entry will follow the last entry in the appropriate section of the hash table.