•  Back 
  •  MagiC 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : TOS - The Operating System
Author      : 
Version     : tos.hyp (December 19, 2008)
Subject     : Programmieren/Atari
Nodes       : 3010
Index Size  : 93790
HCP-Version : 5
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Title
@help       : 
@options    : +g -i -s +x +zz -t4
@width      : 70
View Ref-File11.1  AESVARS, Pointer to AESVARS                                  TOS

/* The following code obtains the pointer to the AESVARS structure of
   MagiC in a reliable manner.

   The routine is particularly important as the relevant components
   in the MagX cookie do not yet have a valid value at boot-up. */


AESVARS* DOMagixAESVars (VOID)
{
    LOCAL WORD have_it = 0;
    LOCAL AESVARS *ap = 0;

    if (!have_it)
    {
        OSHEADER *O;

        have_it = 1;

        O = (OSHEADER *) Supexec (get_osheader);
        ap = (AESVARS *) O->os_magic;

        if (!get_cookie ('MagX', NULL) ||
            ap->magic != 0x87654321L || ap->magic2 != 'MAGX')
              ap = 0;
    }

    return (ap);

} /* DOMagixAESVars */

See also: Test for MagiC   get_cookie