Home » Archimedes archive » Acorn User » AU 1996-03 B.adf » Features » Vocabulary/Source/loader

Vocabulary/Source/loader

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 » Archimedes archive » Acorn User » AU 1996-03 B.adf » Features
Filename: Vocabulary/Source/loader
Read OK:
File size: 08D6 bytes
Load address: 0000
Exec address: 0000
File contents
#include "inc.h"
/*
extern os_error *wimp_bordericon (mouse);
extern os_error *wimp_borderwindow (redraw_box);
extern os_error *wimp_claiminterface (void);
extern os_error *wimp_releaseinterface (void);
extern os_error *wimp_setworkareapointer (pointer);
extern os_error *wimp_releaseworkareapointer (pointer);
extern os_error *wimp_pollpointer (poll);
extern os_error *wimp_sendhelp (message_block);


*/
extern int n;
extern char title[70];
extern char subtitle[70];
extern char german[170][40];
extern dbox m;
extern char english[170][40];
extern char file_to_load[50];
extern void kill_gaps(void);
extern void redraw_edit(void);
extern void restart(void);
extern void redraw_wrong(void);
extern void restart(void);
extern void change_german(void);
extern void change_english(void);
extern void change_language(void);
extern void change_subtitle(void);
extern void change_title(void);
extern void mload(void);
extern char wrong_word_english[170][40];
extern char wrong_word_german[170][40];
/* extern void mchkmsg(wimp_eventstr *e, void *handle); */
extern char language[70];
extern dbox edit;
extern dbox wrong;
extern int wn;
extern void get_new_n(void);
FILE *fp;



int loader(void)
{
int er;
er=0;

      memset(german,0,6800);
      memset(english,0,6800);
      memset(wrong_word_german,0,6800);
      memset(wrong_word_english,0,6800);
    
      dbox_setfield(m,2,"");
      strcpy(title,"");
      strcpy(language,"");
      strcpy(subtitle,"");


  if ((fp = fopen(file_to_load,"r")) == 0) return 0;

  fscanf (fp,"%s\n",title);
  fscanf (fp,"%s\n",subtitle);
  fscanf (fp,"%s\n",language);

  if (strcmp(title,"*")==0)
  {
  strcpy(title,"");
  }


  if (strcmp(subtitle,"*")==0)
  {
  strcpy(subtitle,"");
  }


  if (strcmp(language,"*")==0)
  {
  strcpy(language,"<None>");
  }






for (er=0;er<150;er++)
  {
  fscanf (fp,"%s %s\n",german[er], english[er]);

  if (strcmp(german[er],"*")==0)
  strcpy(german[er],"");

  if (strcmp(english[er],"*")==0)
  strcpy(english[er],"");

  }
fclose(fp);

change_german();
change_english();
change_title();
change_subtitle();
change_language();
dbox_hide(edit);
dbox_hide(wrong);
get_new_n();
redraw_edit();
dbox_setfield(m,2,"");
redraw_wrong();
restart();
wn=0;
 /* kill_gaps(); */

return n;


}



00000000  23 69 6e 63 6c 75 64 65  20 22 69 6e 63 2e 68 22  |#include "inc.h"|
00000010  0a 2f 2a 0a 65 78 74 65  72 6e 20 6f 73 5f 65 72  |./*.extern os_er|
00000020  72 6f 72 20 2a 77 69 6d  70 5f 62 6f 72 64 65 72  |ror *wimp_border|
00000030  69 63 6f 6e 20 28 6d 6f  75 73 65 29 3b 0a 65 78  |icon (mouse);.ex|
00000040  74 65 72 6e 20 6f 73 5f  65 72 72 6f 72 20 2a 77  |tern os_error *w|
00000050  69 6d 70 5f 62 6f 72 64  65 72 77 69 6e 64 6f 77  |imp_borderwindow|
00000060  20 28 72 65 64 72 61 77  5f 62 6f 78 29 3b 0a 65  | (redraw_box);.e|
00000070  78 74 65 72 6e 20 6f 73  5f 65 72 72 6f 72 20 2a  |xtern os_error *|
00000080  77 69 6d 70 5f 63 6c 61  69 6d 69 6e 74 65 72 66  |wimp_claiminterf|
00000090  61 63 65 20 28 76 6f 69  64 29 3b 0a 65 78 74 65  |ace (void);.exte|
000000a0  72 6e 20 6f 73 5f 65 72  72 6f 72 20 2a 77 69 6d  |rn os_error *wim|
000000b0  70 5f 72 65 6c 65 61 73  65 69 6e 74 65 72 66 61  |p_releaseinterfa|
000000c0  63 65 20 28 76 6f 69 64  29 3b 0a 65 78 74 65 72  |ce (void);.exter|
000000d0  6e 20 6f 73 5f 65 72 72  6f 72 20 2a 77 69 6d 70  |n os_error *wimp|
000000e0  5f 73 65 74 77 6f 72 6b  61 72 65 61 70 6f 69 6e  |_setworkareapoin|
000000f0  74 65 72 20 28 70 6f 69  6e 74 65 72 29 3b 0a 65  |ter (pointer);.e|
00000100  78 74 65 72 6e 20 6f 73  5f 65 72 72 6f 72 20 2a  |xtern os_error *|
00000110  77 69 6d 70 5f 72 65 6c  65 61 73 65 77 6f 72 6b  |wimp_releasework|
00000120  61 72 65 61 70 6f 69 6e  74 65 72 20 28 70 6f 69  |areapointer (poi|
00000130  6e 74 65 72 29 3b 0a 65  78 74 65 72 6e 20 6f 73  |nter);.extern os|
00000140  5f 65 72 72 6f 72 20 2a  77 69 6d 70 5f 70 6f 6c  |_error *wimp_pol|
00000150  6c 70 6f 69 6e 74 65 72  20 28 70 6f 6c 6c 29 3b  |lpointer (poll);|
00000160  0a 65 78 74 65 72 6e 20  6f 73 5f 65 72 72 6f 72  |.extern os_error|
00000170  20 2a 77 69 6d 70 5f 73  65 6e 64 68 65 6c 70 20  | *wimp_sendhelp |
00000180  28 6d 65 73 73 61 67 65  5f 62 6c 6f 63 6b 29 3b  |(message_block);|
00000190  0a 0a 0a 2a 2f 0a 65 78  74 65 72 6e 20 69 6e 74  |...*/.extern int|
000001a0  20 6e 3b 0a 65 78 74 65  72 6e 20 63 68 61 72 20  | n;.extern char |
000001b0  74 69 74 6c 65 5b 37 30  5d 3b 0a 65 78 74 65 72  |title[70];.exter|
000001c0  6e 20 63 68 61 72 20 73  75 62 74 69 74 6c 65 5b  |n char subtitle[|
000001d0  37 30 5d 3b 0a 65 78 74  65 72 6e 20 63 68 61 72  |70];.extern char|
000001e0  20 67 65 72 6d 61 6e 5b  31 37 30 5d 5b 34 30 5d  | german[170][40]|
000001f0  3b 0a 65 78 74 65 72 6e  20 64 62 6f 78 20 6d 3b  |;.extern dbox m;|
00000200  0a 65 78 74 65 72 6e 20  63 68 61 72 20 65 6e 67  |.extern char eng|
00000210  6c 69 73 68 5b 31 37 30  5d 5b 34 30 5d 3b 0a 65  |lish[170][40];.e|
00000220  78 74 65 72 6e 20 63 68  61 72 20 66 69 6c 65 5f  |xtern char file_|
00000230  74 6f 5f 6c 6f 61 64 5b  35 30 5d 3b 0a 65 78 74  |to_load[50];.ext|
00000240  65 72 6e 20 76 6f 69 64  20 6b 69 6c 6c 5f 67 61  |ern void kill_ga|
00000250  70 73 28 76 6f 69 64 29  3b 0a 65 78 74 65 72 6e  |ps(void);.extern|
00000260  20 76 6f 69 64 20 72 65  64 72 61 77 5f 65 64 69  | void redraw_edi|
00000270  74 28 76 6f 69 64 29 3b  0a 65 78 74 65 72 6e 20  |t(void);.extern |
00000280  76 6f 69 64 20 72 65 73  74 61 72 74 28 76 6f 69  |void restart(voi|
00000290  64 29 3b 0a 65 78 74 65  72 6e 20 76 6f 69 64 20  |d);.extern void |
000002a0  72 65 64 72 61 77 5f 77  72 6f 6e 67 28 76 6f 69  |redraw_wrong(voi|
000002b0  64 29 3b 0a 65 78 74 65  72 6e 20 76 6f 69 64 20  |d);.extern void |
000002c0  72 65 73 74 61 72 74 28  76 6f 69 64 29 3b 0a 65  |restart(void);.e|
000002d0  78 74 65 72 6e 20 76 6f  69 64 20 63 68 61 6e 67  |xtern void chang|
000002e0  65 5f 67 65 72 6d 61 6e  28 76 6f 69 64 29 3b 0a  |e_german(void);.|
000002f0  65 78 74 65 72 6e 20 76  6f 69 64 20 63 68 61 6e  |extern void chan|
00000300  67 65 5f 65 6e 67 6c 69  73 68 28 76 6f 69 64 29  |ge_english(void)|
00000310  3b 0a 65 78 74 65 72 6e  20 76 6f 69 64 20 63 68  |;.extern void ch|
00000320  61 6e 67 65 5f 6c 61 6e  67 75 61 67 65 28 76 6f  |ange_language(vo|
00000330  69 64 29 3b 0a 65 78 74  65 72 6e 20 76 6f 69 64  |id);.extern void|
00000340  20 63 68 61 6e 67 65 5f  73 75 62 74 69 74 6c 65  | change_subtitle|
00000350  28 76 6f 69 64 29 3b 0a  65 78 74 65 72 6e 20 76  |(void);.extern v|
00000360  6f 69 64 20 63 68 61 6e  67 65 5f 74 69 74 6c 65  |oid change_title|
00000370  28 76 6f 69 64 29 3b 0a  65 78 74 65 72 6e 20 76  |(void);.extern v|
00000380  6f 69 64 20 6d 6c 6f 61  64 28 76 6f 69 64 29 3b  |oid mload(void);|
00000390  0a 65 78 74 65 72 6e 20  63 68 61 72 20 77 72 6f  |.extern char wro|
000003a0  6e 67 5f 77 6f 72 64 5f  65 6e 67 6c 69 73 68 5b  |ng_word_english[|
000003b0  31 37 30 5d 5b 34 30 5d  3b 0a 65 78 74 65 72 6e  |170][40];.extern|
000003c0  20 63 68 61 72 20 77 72  6f 6e 67 5f 77 6f 72 64  | char wrong_word|
000003d0  5f 67 65 72 6d 61 6e 5b  31 37 30 5d 5b 34 30 5d  |_german[170][40]|
000003e0  3b 0a 2f 2a 20 65 78 74  65 72 6e 20 76 6f 69 64  |;./* extern void|
000003f0  20 6d 63 68 6b 6d 73 67  28 77 69 6d 70 5f 65 76  | mchkmsg(wimp_ev|
00000400  65 6e 74 73 74 72 20 2a  65 2c 20 76 6f 69 64 20  |entstr *e, void |
00000410  2a 68 61 6e 64 6c 65 29  3b 20 2a 2f 0a 65 78 74  |*handle); */.ext|
00000420  65 72 6e 20 63 68 61 72  20 6c 61 6e 67 75 61 67  |ern char languag|
00000430  65 5b 37 30 5d 3b 0a 65  78 74 65 72 6e 20 64 62  |e[70];.extern db|
00000440  6f 78 20 65 64 69 74 3b  0a 65 78 74 65 72 6e 20  |ox edit;.extern |
00000450  64 62 6f 78 20 77 72 6f  6e 67 3b 0a 65 78 74 65  |dbox wrong;.exte|
00000460  72 6e 20 69 6e 74 20 77  6e 3b 0a 65 78 74 65 72  |rn int wn;.exter|
00000470  6e 20 76 6f 69 64 20 67  65 74 5f 6e 65 77 5f 6e  |n void get_new_n|
00000480  28 76 6f 69 64 29 3b 0a  46 49 4c 45 20 2a 66 70  |(void);.FILE *fp|
00000490  3b 0a 0a 0a 0a 69 6e 74  20 6c 6f 61 64 65 72 28  |;....int loader(|
000004a0  76 6f 69 64 29 0a 7b 0a  69 6e 74 20 65 72 3b 0a  |void).{.int er;.|
000004b0  65 72 3d 30 3b 0a 0a 20  20 20 20 20 20 6d 65 6d  |er=0;..      mem|
000004c0  73 65 74 28 67 65 72 6d  61 6e 2c 30 2c 36 38 30  |set(german,0,680|
000004d0  30 29 3b 0a 20 20 20 20  20 20 6d 65 6d 73 65 74  |0);.      memset|
000004e0  28 65 6e 67 6c 69 73 68  2c 30 2c 36 38 30 30 29  |(english,0,6800)|
000004f0  3b 0a 20 20 20 20 20 20  6d 65 6d 73 65 74 28 77  |;.      memset(w|
00000500  72 6f 6e 67 5f 77 6f 72  64 5f 67 65 72 6d 61 6e  |rong_word_german|
00000510  2c 30 2c 36 38 30 30 29  3b 0a 20 20 20 20 20 20  |,0,6800);.      |
00000520  6d 65 6d 73 65 74 28 77  72 6f 6e 67 5f 77 6f 72  |memset(wrong_wor|
00000530  64 5f 65 6e 67 6c 69 73  68 2c 30 2c 36 38 30 30  |d_english,0,6800|
00000540  29 3b 0a 20 20 20 20 0a  20 20 20 20 20 20 64 62  |);.    .      db|
00000550  6f 78 5f 73 65 74 66 69  65 6c 64 28 6d 2c 32 2c  |ox_setfield(m,2,|
00000560  22 22 29 3b 0a 20 20 20  20 20 20 73 74 72 63 70  |"");.      strcp|
00000570  79 28 74 69 74 6c 65 2c  22 22 29 3b 0a 20 20 20  |y(title,"");.   |
00000580  20 20 20 73 74 72 63 70  79 28 6c 61 6e 67 75 61  |   strcpy(langua|
00000590  67 65 2c 22 22 29 3b 0a  20 20 20 20 20 20 73 74  |ge,"");.      st|
000005a0  72 63 70 79 28 73 75 62  74 69 74 6c 65 2c 22 22  |rcpy(subtitle,""|
000005b0  29 3b 0a 0a 0a 20 20 69  66 20 28 28 66 70 20 3d  |);...  if ((fp =|
000005c0  20 66 6f 70 65 6e 28 66  69 6c 65 5f 74 6f 5f 6c  | fopen(file_to_l|
000005d0  6f 61 64 2c 22 72 22 29  29 20 3d 3d 20 30 29 20  |oad,"r")) == 0) |
000005e0  72 65 74 75 72 6e 20 30  3b 0a 0a 20 20 66 73 63  |return 0;..  fsc|
000005f0  61 6e 66 20 28 66 70 2c  22 25 73 5c 6e 22 2c 74  |anf (fp,"%s\n",t|
00000600  69 74 6c 65 29 3b 0a 20  20 66 73 63 61 6e 66 20  |itle);.  fscanf |
00000610  28 66 70 2c 22 25 73 5c  6e 22 2c 73 75 62 74 69  |(fp,"%s\n",subti|
00000620  74 6c 65 29 3b 0a 20 20  66 73 63 61 6e 66 20 28  |tle);.  fscanf (|
00000630  66 70 2c 22 25 73 5c 6e  22 2c 6c 61 6e 67 75 61  |fp,"%s\n",langua|
00000640  67 65 29 3b 0a 0a 20 20  69 66 20 28 73 74 72 63  |ge);..  if (strc|
00000650  6d 70 28 74 69 74 6c 65  2c 22 2a 22 29 3d 3d 30  |mp(title,"*")==0|
00000660  29 0a 20 20 7b 0a 20 20  73 74 72 63 70 79 28 74  |).  {.  strcpy(t|
00000670  69 74 6c 65 2c 22 22 29  3b 0a 20 20 7d 0a 0a 0a  |itle,"");.  }...|
00000680  20 20 69 66 20 28 73 74  72 63 6d 70 28 73 75 62  |  if (strcmp(sub|
00000690  74 69 74 6c 65 2c 22 2a  22 29 3d 3d 30 29 0a 20  |title,"*")==0). |
000006a0  20 7b 0a 20 20 73 74 72  63 70 79 28 73 75 62 74  | {.  strcpy(subt|
000006b0  69 74 6c 65 2c 22 22 29  3b 0a 20 20 7d 0a 0a 0a  |itle,"");.  }...|
000006c0  20 20 69 66 20 28 73 74  72 63 6d 70 28 6c 61 6e  |  if (strcmp(lan|
000006d0  67 75 61 67 65 2c 22 2a  22 29 3d 3d 30 29 0a 20  |guage,"*")==0). |
000006e0  20 7b 0a 20 20 73 74 72  63 70 79 28 6c 61 6e 67  | {.  strcpy(lang|
000006f0  75 61 67 65 2c 22 3c 4e  6f 6e 65 3e 22 29 3b 0a  |uage,"<None>");.|
00000700  20 20 7d 0a 0a 0a 0a 0a  0a 0a 66 6f 72 20 28 65  |  }.......for (e|
00000710  72 3d 30 3b 65 72 3c 31  35 30 3b 65 72 2b 2b 29  |r=0;er<150;er++)|
00000720  0a 20 20 7b 0a 20 20 66  73 63 61 6e 66 20 28 66  |.  {.  fscanf (f|
00000730  70 2c 22 25 73 20 25 73  5c 6e 22 2c 67 65 72 6d  |p,"%s %s\n",germ|
00000740  61 6e 5b 65 72 5d 2c 20  65 6e 67 6c 69 73 68 5b  |an[er], english[|
00000750  65 72 5d 29 3b 0a 0a 20  20 69 66 20 28 73 74 72  |er]);..  if (str|
00000760  63 6d 70 28 67 65 72 6d  61 6e 5b 65 72 5d 2c 22  |cmp(german[er],"|
00000770  2a 22 29 3d 3d 30 29 0a  20 20 73 74 72 63 70 79  |*")==0).  strcpy|
00000780  28 67 65 72 6d 61 6e 5b  65 72 5d 2c 22 22 29 3b  |(german[er],"");|
00000790  0a 0a 20 20 69 66 20 28  73 74 72 63 6d 70 28 65  |..  if (strcmp(e|
000007a0  6e 67 6c 69 73 68 5b 65  72 5d 2c 22 2a 22 29 3d  |nglish[er],"*")=|
000007b0  3d 30 29 0a 20 20 73 74  72 63 70 79 28 65 6e 67  |=0).  strcpy(eng|
000007c0  6c 69 73 68 5b 65 72 5d  2c 22 22 29 3b 0a 0a 20  |lish[er],"");.. |
000007d0  20 7d 0a 66 63 6c 6f 73  65 28 66 70 29 3b 0a 0a  | }.fclose(fp);..|
000007e0  63 68 61 6e 67 65 5f 67  65 72 6d 61 6e 28 29 3b  |change_german();|
000007f0  0a 63 68 61 6e 67 65 5f  65 6e 67 6c 69 73 68 28  |.change_english(|
00000800  29 3b 0a 63 68 61 6e 67  65 5f 74 69 74 6c 65 28  |);.change_title(|
00000810  29 3b 0a 63 68 61 6e 67  65 5f 73 75 62 74 69 74  |);.change_subtit|
00000820  6c 65 28 29 3b 0a 63 68  61 6e 67 65 5f 6c 61 6e  |le();.change_lan|
00000830  67 75 61 67 65 28 29 3b  0a 64 62 6f 78 5f 68 69  |guage();.dbox_hi|
00000840  64 65 28 65 64 69 74 29  3b 0a 64 62 6f 78 5f 68  |de(edit);.dbox_h|
00000850  69 64 65 28 77 72 6f 6e  67 29 3b 0a 67 65 74 5f  |ide(wrong);.get_|
00000860  6e 65 77 5f 6e 28 29 3b  0a 72 65 64 72 61 77 5f  |new_n();.redraw_|
00000870  65 64 69 74 28 29 3b 0a  64 62 6f 78 5f 73 65 74  |edit();.dbox_set|
00000880  66 69 65 6c 64 28 6d 2c  32 2c 22 22 29 3b 0a 72  |field(m,2,"");.r|
00000890  65 64 72 61 77 5f 77 72  6f 6e 67 28 29 3b 0a 72  |edraw_wrong();.r|
000008a0  65 73 74 61 72 74 28 29  3b 0a 77 6e 3d 30 3b 0a  |estart();.wn=0;.|
000008b0  20 2f 2a 20 6b 69 6c 6c  5f 67 61 70 73 28 29 3b  | /* kill_gaps();|
000008c0  20 2a 2f 0a 0a 72 65 74  75 72 6e 20 6e 3b 0a 0a  | */..return n;..|
000008d0  0a 7d 0a 0a 0a 0a                                 |.}....|
000008d6