/*
 *  MODULE  :   module.h
 *              handle import and initialisation of modules
{*  last modification:  03.01.91  13:43   }
 *  uli 03.01.91 : moduniquename move to idtab.h
*/
 
#define op_export(p)   ( to_export (p) )
#define getpath(ini)   ini->md->path
#define getname(ini)   ini->md->name
 
#ifndef OLD_MODULE
 
#include "import.h"
#include "export.h"
 
#else
 
typedef struct md  *modptr;               /* name 'mod' not possible (mod=%) */
typedef struct ini *iniptr;
 
 
#ifdef LINT_ARGS
 
global modptr insmod     (char*,boolean,boolean);/* insert module in modlist */
global void   import     (void);     /* reads Interface-files, uses initlist */
global void   export     (void);   /* generates Interface-file, uses binroot */
global void   linklist   (void);     /* creates a info-file for linker with  */
                                               /* a list of imported modules */
global boolean to_export (binptr);
 
#else
 
global modptr insmod     ( );
global void   import     ( );
global void   export     ( );
global void   linklist   ( );
 
global boolean to_export ( );
 
#endif
 
extern modptr modlist ;                                /* linear list */
extern modptr modlast ;                 /* last member of linear list */
extern iniptr initlist;                                /* linear list */
extern iniptr initlast;                 /* last member of linear list */
 
 
 
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/* The following declaration is necessary to satisfy forward declaration. */
/* Do not use the following names globally. */
 
typedef struct md {
          struct md *next;      /* next member of linear list */
          char   name[FILENAME_MAX+1];      /* modulename, at most 8 char */
          char   path[FILENAME_MAX+1];      /* path, where module was found */
          int    time[ 4];      /* creating date of module */
          int     version;      /* strings or BYTE-codes */
          postype  nampos;      /* position of module-name in the use-clause */
          boolean  usglob;      /* same as imported */
          boolean  inited;      /* is member of inilist */
          boolean  direct;      /* used directly by translated prog */
          boolean  stdmod;      /* module is a standart-module */
        } modrecord;
 
typedef struct ini {
          struct ini *next;     /* next member of linear list */
          struct md *md;        /* pointer to modlist to get modulename */
          boolean initrout;     /* module has initialisation-routine */
        } inirecord;
 
#endif
