Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199512_2.adf » !Regulars » Regulars/StarInfo/Seery/h/fittapes

Regulars/StarInfo/Seery/h/fittapes

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199512_2.adf » !Regulars
Filename: Regulars/StarInfo/Seery/h/fittapes
Read OK:
File size: 0AD2 bytes
Load address: 0000
Exec address: 0000
File contents
#ifndef _fittapes_h
#  define _fittapes_h

/** fittapes.h ***************************************************************
 *
 *  Global definitions
 *
 *  (c) David Seery 1995
 *
 *****************************************************************************/

/** Types ********************************************************************/

typedef enum {false, true} boolean;

struct lexeme_class {
  enum {
    begin,
    end,
    video,
    e480,
    e360,
    e240,
    e180,
    e120,
    e60,
    categories,
    programme,
    from,
    starts,
    ends,
    category,
    precedes,
    follows,
    leftBrace,
    rightBrace,
    comma,
    semiColon,
    identifier,
    stringLiteral,
    constant,
    endOfStream
  } lexeme_type;
  union {
    char *identifierValue;
    char *stringLiteralValue;
    int constantValue;
  } lexeme_value;
  char *source_file;
  int source_line;
  struct lexeme_class *next;
  struct lexeme_class *prev;
};

typedef struct lexeme_class lexeme_instance;
typedef lexeme_instance *Lexeme;

struct video_class {
  int length;
  char *name;
  struct video_class *next;
  struct video_class *prev;
};

typedef struct video_class video_instance;
typedef video_instance *Video;

struct category_class {
  char *name;
  int number;
  struct category_class *next;
  struct category_class *prev;
};

typedef struct category_class category_instance;
typedef category_instance *Category;

struct programme_class {
  Video from;
  int start_hrs, start_mins, start_secs;
  int end_hrs, end_mins, end_secs;
  int length;
  Category type;
  char *precedes;
  char *follows;
  char *name;
  struct programme_class *next;
  struct programme_class *prev;
};

typedef struct programme_class programme_instance;
typedef programme_instance *Programme;

struct programmeList_class {
  Programme programme;
  struct programmeList_class *next;
};

typedef struct programmeList_class programmeList_instance;
typedef programmeList_instance *ProgrammeList;

struct videoList_class {
  Video video;
  ProgrammeList programmes;
  int usedTime;
  struct videoList_class *next;
};

typedef struct videoList_class videoList_instance;
typedef videoList_instance *VideoList;

/** Anchors ******************************************************************/

extern Lexeme    lexList_head, lexList_tail;
extern Video     videoList_head, videoList_tail;
extern Category  categoryList_head, categoryList_tail;
extern Programme progList_head, progList_tail;
extern VideoList bestFit;

/** Variables ****************************************************************/

extern int number_categories;

/**�Functions ****************************************************************/

extern void lex(char *file);
extern int yyparse(void);
extern void fit(FILE *f);

#endif
00000000  23 69 66 6e 64 65 66 20  5f 66 69 74 74 61 70 65  |#ifndef _fittape|
00000010  73 5f 68 0a 23 20 20 64  65 66 69 6e 65 20 5f 66  |s_h.#  define _f|
00000020  69 74 74 61 70 65 73 5f  68 0a 0a 2f 2a 2a 20 66  |ittapes_h../** f|
00000030  69 74 74 61 70 65 73 2e  68 20 2a 2a 2a 2a 2a 2a  |ittapes.h ******|
00000040  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000070  2a 2a 2a 2a 2a 2a 2a 2a  2a 0a 20 2a 0a 20 2a 20  |*********. *. * |
00000080  20 47 6c 6f 62 61 6c 20  64 65 66 69 6e 69 74 69  | Global definiti|
00000090  6f 6e 73 0a 20 2a 0a 20  2a 20 20 28 63 29 20 44  |ons. *. *  (c) D|
000000a0  61 76 69 64 20 53 65 65  72 79 20 31 39 39 35 0a  |avid Seery 1995.|
000000b0  20 2a 0a 20 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  | *. ************|
000000c0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000100  2a 2f 0a 0a 2f 2a 2a 20  54 79 70 65 73 20 2a 2a  |*/../** Types **|
00000110  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000150  2a 2a 2f 0a 0a 74 79 70  65 64 65 66 20 65 6e 75  |**/..typedef enu|
00000160  6d 20 7b 66 61 6c 73 65  2c 20 74 72 75 65 7d 20  |m {false, true} |
00000170  62 6f 6f 6c 65 61 6e 3b  0a 0a 73 74 72 75 63 74  |boolean;..struct|
00000180  20 6c 65 78 65 6d 65 5f  63 6c 61 73 73 20 7b 0a  | lexeme_class {.|
00000190  20 20 65 6e 75 6d 20 7b  0a 20 20 20 20 62 65 67  |  enum {.    beg|
000001a0  69 6e 2c 0a 20 20 20 20  65 6e 64 2c 0a 20 20 20  |in,.    end,.   |
000001b0  20 76 69 64 65 6f 2c 0a  20 20 20 20 65 34 38 30  | video,.    e480|
000001c0  2c 0a 20 20 20 20 65 33  36 30 2c 0a 20 20 20 20  |,.    e360,.    |
000001d0  65 32 34 30 2c 0a 20 20  20 20 65 31 38 30 2c 0a  |e240,.    e180,.|
000001e0  20 20 20 20 65 31 32 30  2c 0a 20 20 20 20 65 36  |    e120,.    e6|
000001f0  30 2c 0a 20 20 20 20 63  61 74 65 67 6f 72 69 65  |0,.    categorie|
00000200  73 2c 0a 20 20 20 20 70  72 6f 67 72 61 6d 6d 65  |s,.    programme|
00000210  2c 0a 20 20 20 20 66 72  6f 6d 2c 0a 20 20 20 20  |,.    from,.    |
00000220  73 74 61 72 74 73 2c 0a  20 20 20 20 65 6e 64 73  |starts,.    ends|
00000230  2c 0a 20 20 20 20 63 61  74 65 67 6f 72 79 2c 0a  |,.    category,.|
00000240  20 20 20 20 70 72 65 63  65 64 65 73 2c 0a 20 20  |    precedes,.  |
00000250  20 20 66 6f 6c 6c 6f 77  73 2c 0a 20 20 20 20 6c  |  follows,.    l|
00000260  65 66 74 42 72 61 63 65  2c 0a 20 20 20 20 72 69  |eftBrace,.    ri|
00000270  67 68 74 42 72 61 63 65  2c 0a 20 20 20 20 63 6f  |ghtBrace,.    co|
00000280  6d 6d 61 2c 0a 20 20 20  20 73 65 6d 69 43 6f 6c  |mma,.    semiCol|
00000290  6f 6e 2c 0a 20 20 20 20  69 64 65 6e 74 69 66 69  |on,.    identifi|
000002a0  65 72 2c 0a 20 20 20 20  73 74 72 69 6e 67 4c 69  |er,.    stringLi|
000002b0  74 65 72 61 6c 2c 0a 20  20 20 20 63 6f 6e 73 74  |teral,.    const|
000002c0  61 6e 74 2c 0a 20 20 20  20 65 6e 64 4f 66 53 74  |ant,.    endOfSt|
000002d0  72 65 61 6d 0a 20 20 7d  20 6c 65 78 65 6d 65 5f  |ream.  } lexeme_|
000002e0  74 79 70 65 3b 0a 20 20  75 6e 69 6f 6e 20 7b 0a  |type;.  union {.|
000002f0  20 20 20 20 63 68 61 72  20 2a 69 64 65 6e 74 69  |    char *identi|
00000300  66 69 65 72 56 61 6c 75  65 3b 0a 20 20 20 20 63  |fierValue;.    c|
00000310  68 61 72 20 2a 73 74 72  69 6e 67 4c 69 74 65 72  |har *stringLiter|
00000320  61 6c 56 61 6c 75 65 3b  0a 20 20 20 20 69 6e 74  |alValue;.    int|
00000330  20 63 6f 6e 73 74 61 6e  74 56 61 6c 75 65 3b 0a  | constantValue;.|
00000340  20 20 7d 20 6c 65 78 65  6d 65 5f 76 61 6c 75 65  |  } lexeme_value|
00000350  3b 0a 20 20 63 68 61 72  20 2a 73 6f 75 72 63 65  |;.  char *source|
00000360  5f 66 69 6c 65 3b 0a 20  20 69 6e 74 20 73 6f 75  |_file;.  int sou|
00000370  72 63 65 5f 6c 69 6e 65  3b 0a 20 20 73 74 72 75  |rce_line;.  stru|
00000380  63 74 20 6c 65 78 65 6d  65 5f 63 6c 61 73 73 20  |ct lexeme_class |
00000390  2a 6e 65 78 74 3b 0a 20  20 73 74 72 75 63 74 20  |*next;.  struct |
000003a0  6c 65 78 65 6d 65 5f 63  6c 61 73 73 20 2a 70 72  |lexeme_class *pr|
000003b0  65 76 3b 0a 7d 3b 0a 0a  74 79 70 65 64 65 66 20  |ev;.};..typedef |
000003c0  73 74 72 75 63 74 20 6c  65 78 65 6d 65 5f 63 6c  |struct lexeme_cl|
000003d0  61 73 73 20 6c 65 78 65  6d 65 5f 69 6e 73 74 61  |ass lexeme_insta|
000003e0  6e 63 65 3b 0a 74 79 70  65 64 65 66 20 6c 65 78  |nce;.typedef lex|
000003f0  65 6d 65 5f 69 6e 73 74  61 6e 63 65 20 2a 4c 65  |eme_instance *Le|
00000400  78 65 6d 65 3b 0a 0a 73  74 72 75 63 74 20 76 69  |xeme;..struct vi|
00000410  64 65 6f 5f 63 6c 61 73  73 20 7b 0a 20 20 69 6e  |deo_class {.  in|
00000420  74 20 6c 65 6e 67 74 68  3b 0a 20 20 63 68 61 72  |t length;.  char|
00000430  20 2a 6e 61 6d 65 3b 0a  20 20 73 74 72 75 63 74  | *name;.  struct|
00000440  20 76 69 64 65 6f 5f 63  6c 61 73 73 20 2a 6e 65  | video_class *ne|
00000450  78 74 3b 0a 20 20 73 74  72 75 63 74 20 76 69 64  |xt;.  struct vid|
00000460  65 6f 5f 63 6c 61 73 73  20 2a 70 72 65 76 3b 0a  |eo_class *prev;.|
00000470  7d 3b 0a 0a 74 79 70 65  64 65 66 20 73 74 72 75  |};..typedef stru|
00000480  63 74 20 76 69 64 65 6f  5f 63 6c 61 73 73 20 76  |ct video_class v|
00000490  69 64 65 6f 5f 69 6e 73  74 61 6e 63 65 3b 0a 74  |ideo_instance;.t|
000004a0  79 70 65 64 65 66 20 76  69 64 65 6f 5f 69 6e 73  |ypedef video_ins|
000004b0  74 61 6e 63 65 20 2a 56  69 64 65 6f 3b 0a 0a 73  |tance *Video;..s|
000004c0  74 72 75 63 74 20 63 61  74 65 67 6f 72 79 5f 63  |truct category_c|
000004d0  6c 61 73 73 20 7b 0a 20  20 63 68 61 72 20 2a 6e  |lass {.  char *n|
000004e0  61 6d 65 3b 0a 20 20 69  6e 74 20 6e 75 6d 62 65  |ame;.  int numbe|
000004f0  72 3b 0a 20 20 73 74 72  75 63 74 20 63 61 74 65  |r;.  struct cate|
00000500  67 6f 72 79 5f 63 6c 61  73 73 20 2a 6e 65 78 74  |gory_class *next|
00000510  3b 0a 20 20 73 74 72 75  63 74 20 63 61 74 65 67  |;.  struct categ|
00000520  6f 72 79 5f 63 6c 61 73  73 20 2a 70 72 65 76 3b  |ory_class *prev;|
00000530  0a 7d 3b 0a 0a 74 79 70  65 64 65 66 20 73 74 72  |.};..typedef str|
00000540  75 63 74 20 63 61 74 65  67 6f 72 79 5f 63 6c 61  |uct category_cla|
00000550  73 73 20 63 61 74 65 67  6f 72 79 5f 69 6e 73 74  |ss category_inst|
00000560  61 6e 63 65 3b 0a 74 79  70 65 64 65 66 20 63 61  |ance;.typedef ca|
00000570  74 65 67 6f 72 79 5f 69  6e 73 74 61 6e 63 65 20  |tegory_instance |
00000580  2a 43 61 74 65 67 6f 72  79 3b 0a 0a 73 74 72 75  |*Category;..stru|
00000590  63 74 20 70 72 6f 67 72  61 6d 6d 65 5f 63 6c 61  |ct programme_cla|
000005a0  73 73 20 7b 0a 20 20 56  69 64 65 6f 20 66 72 6f  |ss {.  Video fro|
000005b0  6d 3b 0a 20 20 69 6e 74  20 73 74 61 72 74 5f 68  |m;.  int start_h|
000005c0  72 73 2c 20 73 74 61 72  74 5f 6d 69 6e 73 2c 20  |rs, start_mins, |
000005d0  73 74 61 72 74 5f 73 65  63 73 3b 0a 20 20 69 6e  |start_secs;.  in|
000005e0  74 20 65 6e 64 5f 68 72  73 2c 20 65 6e 64 5f 6d  |t end_hrs, end_m|
000005f0  69 6e 73 2c 20 65 6e 64  5f 73 65 63 73 3b 0a 20  |ins, end_secs;. |
00000600  20 69 6e 74 20 6c 65 6e  67 74 68 3b 0a 20 20 43  | int length;.  C|
00000610  61 74 65 67 6f 72 79 20  74 79 70 65 3b 0a 20 20  |ategory type;.  |
00000620  63 68 61 72 20 2a 70 72  65 63 65 64 65 73 3b 0a  |char *precedes;.|
00000630  20 20 63 68 61 72 20 2a  66 6f 6c 6c 6f 77 73 3b  |  char *follows;|
00000640  0a 20 20 63 68 61 72 20  2a 6e 61 6d 65 3b 0a 20  |.  char *name;. |
00000650  20 73 74 72 75 63 74 20  70 72 6f 67 72 61 6d 6d  | struct programm|
00000660  65 5f 63 6c 61 73 73 20  2a 6e 65 78 74 3b 0a 20  |e_class *next;. |
00000670  20 73 74 72 75 63 74 20  70 72 6f 67 72 61 6d 6d  | struct programm|
00000680  65 5f 63 6c 61 73 73 20  2a 70 72 65 76 3b 0a 7d  |e_class *prev;.}|
00000690  3b 0a 0a 74 79 70 65 64  65 66 20 73 74 72 75 63  |;..typedef struc|
000006a0  74 20 70 72 6f 67 72 61  6d 6d 65 5f 63 6c 61 73  |t programme_clas|
000006b0  73 20 70 72 6f 67 72 61  6d 6d 65 5f 69 6e 73 74  |s programme_inst|
000006c0  61 6e 63 65 3b 0a 74 79  70 65 64 65 66 20 70 72  |ance;.typedef pr|
000006d0  6f 67 72 61 6d 6d 65 5f  69 6e 73 74 61 6e 63 65  |ogramme_instance|
000006e0  20 2a 50 72 6f 67 72 61  6d 6d 65 3b 0a 0a 73 74  | *Programme;..st|
000006f0  72 75 63 74 20 70 72 6f  67 72 61 6d 6d 65 4c 69  |ruct programmeLi|
00000700  73 74 5f 63 6c 61 73 73  20 7b 0a 20 20 50 72 6f  |st_class {.  Pro|
00000710  67 72 61 6d 6d 65 20 70  72 6f 67 72 61 6d 6d 65  |gramme programme|
00000720  3b 0a 20 20 73 74 72 75  63 74 20 70 72 6f 67 72  |;.  struct progr|
00000730  61 6d 6d 65 4c 69 73 74  5f 63 6c 61 73 73 20 2a  |ammeList_class *|
00000740  6e 65 78 74 3b 0a 7d 3b  0a 0a 74 79 70 65 64 65  |next;.};..typede|
00000750  66 20 73 74 72 75 63 74  20 70 72 6f 67 72 61 6d  |f struct program|
00000760  6d 65 4c 69 73 74 5f 63  6c 61 73 73 20 70 72 6f  |meList_class pro|
00000770  67 72 61 6d 6d 65 4c 69  73 74 5f 69 6e 73 74 61  |grammeList_insta|
00000780  6e 63 65 3b 0a 74 79 70  65 64 65 66 20 70 72 6f  |nce;.typedef pro|
00000790  67 72 61 6d 6d 65 4c 69  73 74 5f 69 6e 73 74 61  |grammeList_insta|
000007a0  6e 63 65 20 2a 50 72 6f  67 72 61 6d 6d 65 4c 69  |nce *ProgrammeLi|
000007b0  73 74 3b 0a 0a 73 74 72  75 63 74 20 76 69 64 65  |st;..struct vide|
000007c0  6f 4c 69 73 74 5f 63 6c  61 73 73 20 7b 0a 20 20  |oList_class {.  |
000007d0  56 69 64 65 6f 20 76 69  64 65 6f 3b 0a 20 20 50  |Video video;.  P|
000007e0  72 6f 67 72 61 6d 6d 65  4c 69 73 74 20 70 72 6f  |rogrammeList pro|
000007f0  67 72 61 6d 6d 65 73 3b  0a 20 20 69 6e 74 20 75  |grammes;.  int u|
00000800  73 65 64 54 69 6d 65 3b  0a 20 20 73 74 72 75 63  |sedTime;.  struc|
00000810  74 20 76 69 64 65 6f 4c  69 73 74 5f 63 6c 61 73  |t videoList_clas|
00000820  73 20 2a 6e 65 78 74 3b  0a 7d 3b 0a 0a 74 79 70  |s *next;.};..typ|
00000830  65 64 65 66 20 73 74 72  75 63 74 20 76 69 64 65  |edef struct vide|
00000840  6f 4c 69 73 74 5f 63 6c  61 73 73 20 76 69 64 65  |oList_class vide|
00000850  6f 4c 69 73 74 5f 69 6e  73 74 61 6e 63 65 3b 0a  |oList_instance;.|
00000860  74 79 70 65 64 65 66 20  76 69 64 65 6f 4c 69 73  |typedef videoLis|
00000870  74 5f 69 6e 73 74 61 6e  63 65 20 2a 56 69 64 65  |t_instance *Vide|
00000880  6f 4c 69 73 74 3b 0a 0a  2f 2a 2a 20 41 6e 63 68  |oList;../** Anch|
00000890  6f 72 73 20 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |ors ************|
000008a0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000008d0  2a 2a 2a 2a 2a 2a 2f 0a  0a 65 78 74 65 72 6e 20  |******/..extern |
000008e0  4c 65 78 65 6d 65 20 20  20 20 6c 65 78 4c 69 73  |Lexeme    lexLis|
000008f0  74 5f 68 65 61 64 2c 20  6c 65 78 4c 69 73 74 5f  |t_head, lexList_|
00000900  74 61 69 6c 3b 0a 65 78  74 65 72 6e 20 56 69 64  |tail;.extern Vid|
00000910  65 6f 20 20 20 20 20 76  69 64 65 6f 4c 69 73 74  |eo     videoList|
00000920  5f 68 65 61 64 2c 20 76  69 64 65 6f 4c 69 73 74  |_head, videoList|
00000930  5f 74 61 69 6c 3b 0a 65  78 74 65 72 6e 20 43 61  |_tail;.extern Ca|
00000940  74 65 67 6f 72 79 20 20  63 61 74 65 67 6f 72 79  |tegory  category|
00000950  4c 69 73 74 5f 68 65 61  64 2c 20 63 61 74 65 67  |List_head, categ|
00000960  6f 72 79 4c 69 73 74 5f  74 61 69 6c 3b 0a 65 78  |oryList_tail;.ex|
00000970  74 65 72 6e 20 50 72 6f  67 72 61 6d 6d 65 20 70  |tern Programme p|
00000980  72 6f 67 4c 69 73 74 5f  68 65 61 64 2c 20 70 72  |rogList_head, pr|
00000990  6f 67 4c 69 73 74 5f 74  61 69 6c 3b 0a 65 78 74  |ogList_tail;.ext|
000009a0  65 72 6e 20 56 69 64 65  6f 4c 69 73 74 20 62 65  |ern VideoList be|
000009b0  73 74 46 69 74 3b 0a 0a  2f 2a 2a 20 56 61 72 69  |stFit;../** Vari|
000009c0  61 62 6c 65 73 20 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |ables **********|
000009d0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000a00  2a 2a 2a 2a 2a 2a 2f 0a  0a 65 78 74 65 72 6e 20  |******/..extern |
00000a10  69 6e 74 20 6e 75 6d 62  65 72 5f 63 61 74 65 67  |int number_categ|
00000a20  6f 72 69 65 73 3b 0a 0a  2f 2a 2a a0 46 75 6e 63  |ories;../**.Func|
00000a30  74 69 6f 6e 73 20 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |tions **********|
00000a40  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000a70  2a 2a 2a 2a 2a 2a 2f 0a  0a 65 78 74 65 72 6e 20  |******/..extern |
00000a80  76 6f 69 64 20 6c 65 78  28 63 68 61 72 20 2a 66  |void lex(char *f|
00000a90  69 6c 65 29 3b 0a 65 78  74 65 72 6e 20 69 6e 74  |ile);.extern int|
00000aa0  20 79 79 70 61 72 73 65  28 76 6f 69 64 29 3b 0a  | yyparse(void);.|
00000ab0  65 78 74 65 72 6e 20 76  6f 69 64 20 66 69 74 28  |extern void fit(|
00000ac0  46 49 4c 45 20 2a 66 29  3b 0a 0a 23 65 6e 64 69  |FILE *f);..#endi|
00000ad0  66 0a                                             |f.|
00000ad2