Contact us Heritage collections Image license terms
HOME ACL Associates Technology Literature Applications Society Software revisited
Further reading □ OverviewNo.1No.2No.3No.4No.5No.8No.9No.11No.12No.13No.14No.15No.17No.19No.21No.22No.23No.24No.25No.26No.27No.28No.29No.30No.31No.32No.33No.37No.38No.39No.40No.41No.43No.44No.45No.46No.47No.48No.49No.50No.51No.52
ACD C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
ACLLiteratureProgress ReportsSPROGS Papers
ACLLiteratureProgress ReportsSPROGS Papers
ACL ACD C&A INF CCD CISD Archives
Further reading

Overview
No.1
No.2
No.3
No.4
No.5
No.8
No.9
No.11
No.12
No.13
No.14
No.15
No.17
No.19
No.21
No.22
No.23
No.24
No.25
No.26
No.27
No.28
No.29
No.30
No.31
No.32
No.33
No.37
No.38
No.39
No.40
No.41
No.43
No.44
No.45
No.46
No.47
No.48
No.49
No.50
No.51
No.52

SPROGS Paper No 22: Proposals for the Picture File Library

A H Francis

October 9 1972

1. Purpose of the Libraries

There will be two types of library for Sprogs picture files (and film files). The first type will be the System picture file library. This will contain the picture files for the software characters, several different fonts, and some standard pictures which it is felt may be common to most users of Sprogs. Among this latter category may come leader frames and trailer frames. The second type of library will be the user's picture file library. Here the user may store, and access on later runs, picture files generated by his Sprogs program. A user may have more than one user library, selection being made by the users program. Also a user may use another user's library if the appropriate traps have been set. This means that users may share picture file libraries.

2. Method of Use

Both system and user picture file libraries have the same format and mode of use. The system library and several user libraries may be used by a particular run of Sprogs. The current library is selected by its channel number. Each library has to be assigned to a channel number at run time. by the Macro which runs Sprogs. Each library is a standard EDS file and can thus be assigned to a channel number. References to picture files in a library are made by copying that picture file across from the library into the Sprogs Filestore. This can either be done by calling a routine which simply copies the picture file across (see 5) or by attempting to draw the picture file. The program would first search the Filestore to see if the picture file was currently in store. If it is not the currently selected user library is searched for the named picture file. If it is not found there the system library is searched. If it is still not found an error is flagged. If it is found in either library it is copied across to the filestore and then used in the normal manner. Picture files may be copied to the users own library from the filestore (see 5). Picture files may also be erased from the users own library. A user may not write to or erase items in the system picture file library.

3. Format of a Library

Each library will have a minimum size of 8 blocks. Each block is 512 words long. A hash function on the real number which is the encoded form of the name of the picture file (see Sprogs Note 5) and the picture file number will decide which block the search for the picture file begins in. Each picture file in the library has a header preceding it which contains:

    Address of the first word of the next header 
    Real number representing the picture file name 
    Picture File number 

The picture file itself contains information on the length and mode so this information does not need to be repeated. This paper is assuming the layout shown in figure 1, where each header is followed immediately by the picture file. However other layouts are still under consideration (see Appendix) but they do not significantly effect the use of the libraries. They do however effect the efficiency of storage and speed of access. It is also proposed that when any particular block becomes full the disc file may be expanded if there is any available space on the disc.

Fig 1 Next Address Real Number File Number PICTURE FILE 1 Next Address Real Number File Number PICTURE FILE 2

4. Disc Transfer Routines

There will be several basic routines, written mostly in PLAN, which will handle the disc transfers. The user will be unaware of these. They are described briefly below.

      DREAD (IBNO,ARR(1)) 

This routine reads block number IBNO from the disc and places the contents in location ARR(1) to ARR(256)

      DWRITE (IBNO,ARR(1)) 

This routine writes the contents of ARR(1) to ARR(256) to block number IBNO on the disc.

      DS1ZE (N) 

This routine expands the disc file by N blocks if they are available. If not N is returned as -N (or minus the number of blocks which are available).

5. User Routines

There will also be several Fortran routines which will be called by the users Sprogs program or by the Sprogs system itself. They are described briefly below.

      GETFILE ('NAME') 

This routine gets a picture file from the library and copies it into the Filestore, It converts the argument 'NAME' to a real number using the standard Sprogs text storage algorithm described in Sprogs Note 5. The hash is then performed on this number to give the block number in which to start the search. This block is read from the disc into an array. The array is searched sequentially until the file is found. It is then transferred to the Sprogs Filestore and an entry is made in the Filetable.

      PUTFILE ('NAME') 

This routine puts a picture file into the library from the Filestore. Similar to GETFILE except that it searches the appropriate block of disc file for an unused area at least equal to the size of the picture file and then writes a header and copies the picture file across.

      GETFONT (CD) 

This routine will get the set of picture files comprising a complete font from the library and add them to the Filestore. All fonts have 64 entries whose value ranges from 0 to 63 (0-77 octal). The picture file number is set to N and a loop is set up to get all 64 characters which have filenumber N. This will be done by calling GETFILE inside the loop.

      ERFILE ('NAME') 

This routine will erase the named picture file from the library. A search will be made of the appropriate block of the disc file, as in GETFILE, and when the picture file is found the real number representing the file name is set to zero.

      DSEL (N) 

This routine selects the user library assigned to channel number N as the current one.

6. Appendix

In section 3 a format was suggested for the layout of the headers and picture files. Here two other layouts are considered.

Note that, as soon as conditions have once been restored, the entry can be deleted from the stack, and also that only backward pointers are required. (Numbers refer to the sequence list.)

Fig 2 REAL NUMBER FILE NUMBER ADDRESS SIZE REAL NUMBER F ADD SIZE PICTURE FILE 1 PICTURE FILE 2 Fig 3 REAL NUMBER FILE NUMBER ADDRESS SIZE R F A S PICTURE FILE 2 PICTURE FILE 1

The method shown in Figure 2 has an easily readable directory at the beginning of each block but has the disadvantage that the maximum number of files the block can hold has to be decided before the first file is written. This may waste storage space.

The method shown in Figure 3 overcomes the disadvantage of the method in Figure 2 but still has a readily accessible directory at the beginning of each block. The method shown in Figure 1 has the disadvantage that each block does not have a directory at its head. The method of Figure 1 is more easily extended when a block is full.

⇑ Top of page
© Chilton Computing and UKRI Science and Technology Facilities Council webmaster@chilton-computing.org.uk
Our thanks to UKRI Science and Technology Facilities Council for hosting this site