view 3rdparty/packages/uucpbb/src/nmload.c @ 3295:6b7a7b233925 default tip

makefile: Allow PORTS with level1/2 mix https://sourceforge.net/p/nitros9/feature-requests/10/
author Tormod Volden <debian.tormod@gmail.com>
date Tue, 19 Apr 2022 18:12:17 +0200
parents 515da1fd1ca4
children
line wrap: on
line source

#ifndef _OSK

/* Our own versions of modlink() and modload() which use
   F$NMLink and F$NMLoad to load a module  --BGP  */

#include <os9.h>

#define F_NMLINK  0x21
#define F_NMLOAD  0x22
#if 0
#define F_UNLOAD  0x1d
#endif

extern int errno;


int nmlink (mod, type, lang)
char *mod;
int type, lang;
{
     struct registers reg;
     int result;
     
     reg.rg_a = type | lang;
     reg.rg_x = mod;
     result = _os9 (F_NMLINK, &reg);
     errno = reg.rg_b & 0xff;
     return (result);
}



int nmload (mod, type, lang)
char *mod;
int type, lang;
{
     struct registers reg;
     int result;

     reg.rg_a = type | lang;
     reg.rg_x = mod;
     result = _os9 (F_NMLOAD, &reg);
     errno = reg.rg_b & 0xff;
     return (result);
}


/* our own munload using F$UnLoad to unlink the module --REB */

int munload (mod, typelang)
char *mod;
int typelang;
{
     struct registers reg;
     int result;

     reg.rg_a = typelang;
     reg.rg_x = mod;
     result = _os9 (F_UNLOAD, &reg);
     errno = reg.rg_b & 0xff;
     return (result);
}
#endif